--- .../sso-vs-gs-fs-array-interleave.shader_test | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 tests/spec/arb_enhanced_layouts/execution/component-layout/sso-vs-gs-fs-array-interleave.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/execution/component-layout/sso-vs-gs-fs-array-interleave.shader_test b/tests/spec/arb_enhanced_layouts/execution/component-layout/sso-vs-gs-fs-array-interleave.shader_test new file mode 100644 index 0000000..0219eed --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/execution/component-layout/sso-vs-gs-fs-array-interleave.shader_test @@ -0,0 +1,106 @@ +# Test layout componet qualifier between multiple shader stages with SSO +# enabled. + +[require] +GLSL >= 1.50 +GL_ARB_enhanced_layouts +GL_ARB_separate_shader_objects +SSO ENABLED + +[vertex shader] +#version 150 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require + +// consume X/Y/Z components of 6 vectors +layout(location = 0) out vec3 a[6]; + +// consumes W component of 6 vectors +layout(location = 0, component = 3) out float b[6]; + +out vec4 vertex_to_gs; + +in vec4 piglit_vertex; + +void main() +{ + a[0] = vec3(0.0); + a[1] = vec3(1.0); + a[2] = vec3(2.0); + a[3] = vec3(3.0); + a[4] = vec3(4.0); + a[5] = vec3(5.0); + b[0] = 6.0; + b[1] = 7.0; + b[2] = 8.0; + b[3] = 9.0; + b[4] = 10.0; + b[5] = 11.0; + + vertex_to_gs = piglit_vertex; +} + +[geometry shader] +#version 150 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require +#extension GL_ARB_arrays_of_arrays: require + +layout(triangles) in; +layout(triangle_strip, max_vertices = 3) out; + +// consume X/Y/Z components of 6 vectors +layout(location = 0) in vec3 a[3][6]; + +// consumes W component of 6 vectors +layout(location = 0, component = 3) in float b[3][6]; + +in vec4 vertex_to_gs[3]; + +// consume X/Y/Z components of 6 vectors +layout(location = 0) out vec3 a_to_fs[6]; + +// consumes W component of 6 vectors +layout(location = 0, component = 3) out float b_to_fs[6]; + +void main() +{ + for (int i = 0; i < 3; i++) { + gl_Position = vertex_to_gs[i]; + a_to_fs = a[i]; + b_to_fs = b[i]; + EmitVertex(); + } +} + +[fragment shader] +#version 150 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require + +out vec4 color; + +// consume X/Y/Z components of 6 vectors +layout(location = 0) in vec3 a_to_fs[6]; + +// consumes W component of 6 vectors +layout(location = 0, component = 3) in float b_to_fs[6]; + +void main() +{ + color = vec4(1, 0, 0, 1); + + for (int i = 0; i < 6; i++) { + if (a_to_fs[i] != vec3(float(i))) + color = vec4(0, 1, 0, 1); + } + + for (int i = 6; i < 12; i++) { + if (b_to_fs[i-6] != float(i)) + color = vec4(0, 1, 0, 1); + } +} + +[test] +draw rect -1 -1 2 2 +probe all rgb 1 0 0 -- 2.4.3 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit