Test results: Nvidia GeForce 840M - NVIDIA 352.41: pass --- .../sso-block-member-layout-location.shader_test | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 tests/spec/arb_enhanced_layouts/execution/block-member-locations/sso-block-member-layout-location.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/execution/block-member-locations/sso-block-member-layout-location.shader_test b/tests/spec/arb_enhanced_layouts/execution/block-member-locations/sso-block-member-layout-location.shader_test new file mode 100644 index 0000000..3b9204c --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/execution/block-member-locations/sso-block-member-layout-location.shader_test @@ -0,0 +1,84 @@ +// Test that interface block members are correctly matched by explicit +// location. + +[require] +GLSL >= 1.50 +GL_ARB_separate_shader_objects +GL_ARB_explicit_uniform_location +GL_ARB_explicit_attrib_location +GL_ARB_enhanced_layouts + +[vertex sso] +#version 150 +#extension GL_ARB_separate_shader_objects: require +#extension GL_ARB_enhanced_layouts: require + +in vec4 piglit_vertex; + +layout(location = 0) out block { + layout(location = 2) vec4 c; + vec4 d; + layout(location = 0) vec4 a; + vec4 b; +} name; + +out gl_PerVertex { + vec4 gl_Position; +}; + +void main() +{ + name.a = vec4(1.0, 0.0, 0.0, 1.0); + name.b = vec4(0.0, 1.0, 0.0, 1.0); + name.c = vec4(0.0, 0.0, 1.0, 1.0); + name.d = vec4(1.0, 1.0, 1.0, 1.0); + + gl_Position = piglit_vertex; +} + +[fragment sso] +#version 150 +#extension GL_ARB_separate_shader_objects: require +#extension GL_ARB_explicit_uniform_location: require +#extension GL_ARB_explicit_attrib_location: require + +layout(location = 0) in vec4 a; +layout(location = 1) in vec4 b; +layout(location = 2) in vec4 c; +layout(location = 3) in vec4 d; + +layout(location = 0) uniform int i; + +out vec4 color; + +void main() +{ + if (i == 0) { + color = a; + } else if (i == 1) { + color = b; + } else if (i == 2) { + color = c; + } else if (i == 3) { + color = d; + } +} + +[test] +active shader program GL_FRAGMENT_SHADER + +uniform int 0 0 +draw rect -1 -1 1 1 +relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 0.0, 0.0) + +uniform int 0 1 +draw rect 0 -1 1 1 +relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 1.0, 0.0) + +uniform int 0 2 +draw rect -1 0 1 1 +relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 1.0) + +uniform int 0 3 +draw rect 0 0 1 1 +relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0) -- 2.4.3 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit