From: Dave Airlie <airl...@redhat.com> As for previous test, suggestions for a better location,
This tests redeclaring a struct like UE4 does works with mesa. Signed-off-by: Dave Airlie <airl...@redhat.com> --- .../execution/redecl-struct.shader_test | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test diff --git a/tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test b/tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test new file mode 100644 index 0000000..e613f6f --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/execution/redecl-struct.shader_test @@ -0,0 +1,35 @@ +# pass an anon struct from one stage to another +[require] +GLSL >= 3.30 +GL_ARB_separate_shader_objects + +[vertex shader] +#version 330 +#extension GL_ARB_separate_shader_objects: require + +layout(location=1) out struct TC0 { vec4 Data; } mycolor; +layout(location=2) out struct TC0 { vec4 Data; } mycolor2; +in vec4 piglit_vertex; + +void main() +{ + gl_Position = piglit_vertex; + mycolor.Data = vec4(0.5, 0.5, 0.0, 1.0); + mycolor2.Data = vec4(-0.5, 0.5, 0.0, 0.0); +} + +[fragment shader] +#version 330 +#extension GL_ARB_separate_shader_objects: require + +layout(location = 1) in struct TC0 { vec4 Data; } mycolor; +layout(location = 2) in struct TC0 { vec4 Data; } mycolor2; + +void main() +{ + gl_FragColor = vec4(mycolor.Data + mycolor2.Data); +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 -- 2.5.5 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit