Mesa treats each GS input as taking up 3 locations instead of 1, because it doesn't de-array the vars. This causes it to take col3 from VS instead of col1.
Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu> --- .../execution/vs-gs-linking.shader_test | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/execution/vs-gs-linking.shader_test diff --git a/tests/spec/arb_separate_shader_objects/execution/vs-gs-linking.shader_test b/tests/spec/arb_separate_shader_objects/execution/vs-gs-linking.shader_test new file mode 100644 index 0000000..938df13 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/execution/vs-gs-linking.shader_test @@ -0,0 +1,57 @@ +[require] +GLSL >= 1.50 +SSO ENABLED + +[vertex shader] +#version 150 + +in vec4 piglit_vertex; +out vec4 col0; +out vec4 col1; +out vec4 col2; +out vec4 col3; +out vec4 col4; +out vec4 col5; + +void main() { + gl_Position = piglit_vertex; + col1 = vec4(0, 1, 0, 1); + col0 = col2 = col3 = col4 = col5 = vec4(1, 0, 0, 1); +} + +[geometry shader] +#version 150 + +layout (triangles) in; +layout (triangle_strip, max_vertices=3) out; + +in vec4 color0[]; +in vec4 color1[]; + +out vec4 color; + +void main() { + int i; + for (i = 0; i < 3; i++) { + gl_Position = gl_in[i].gl_Position; + color = color1[i]; + EmitVertex(); + } +} + +[fragment shader] +#version 150 + +in vec4 color; +out vec4 col; + +void main() { + col = color; +} + +[test] +clear color 0.2 0.2 0.2 0.2 +clear + +draw rect -1 -1 2 2 +probe all rgba 0 1 0 1 -- 2.4.10 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit