diff options
author | Timothy Arceri <timothy.arceri@collabora.com> | 2015-11-30 18:36:07 +1100 |
---|---|---|
committer | Timothy Arceri <timothy.arceri@collabora.com> | 2015-12-02 09:07:48 +1100 |
commit | 2b2bb62ce03ffa065e9b591cd05e12c623ed4759 (patch) | |
tree | dfaad3ed452f605f36e5354879ce69615f2d9877 | |
parent | f1e416b8e65ad95c6ce9e04a80d83e7f9e1e9239 (diff) |
arb_separate_shader_objects: test explicit location with a struct
Test results:
Nvidia GeForce 840M - NVIDIA 352.41: pass
i965 - Mesa 11.2-dev: fail
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
-rw-r--r-- | tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test b/tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test new file mode 100644 index 000000000..b6b3d1c63 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/execution/layout-location-struct.shader_test @@ -0,0 +1,51 @@ +// Test that inputs and outputs are assigned the correct location when using +// a struct and explicit locations. + +[require] +GLSL >= 1.50 +GL_ARB_separate_shader_objects + +[vertex shader] +#version 150 +#extension GL_ARB_separate_shader_objects: require + +in vec4 piglit_vertex; + +layout(location = 0) out struct S { + vec4 a; +} s; + +layout(location = 2) out struct S2 { + vec4 a; +} s2; + +void main() +{ + s.a = vec4(1.0, 0.0, 0.0, 1.0); + s2.a = vec4(0.0, 1.0, 1.0, 1.0); + + gl_Position = piglit_vertex; +} + +[fragment shader] +#version 150 +#extension GL_ARB_separate_shader_objects: require + +layout(location = 2) in struct S { + vec4 a; +} s; + +layout(location = 0) in struct S1 { + vec4 a; +} s2; + +out vec4 color; + +void main() +{ + color = s2.a; +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 1 0 0 |