[Piglit] [PATCH 2/2] shaders: test linking similar unnamed types

Grigori Goronzy greg at chown.ath.cx
Fri Jan 17 16:37:45 PST 2014


GLSL allows unnamed structure types in variable declarations. This
test verifies that the GLSL linker recognizes similar unnamed structure
types declared across multiple shader stages.
---
 tests/shaders/glsl-link-unnamed-types.shader_test | 29 +++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 tests/shaders/glsl-link-unnamed-types.shader_test

diff --git a/tests/shaders/glsl-link-unnamed-types.shader_test b/tests/shaders/glsl-link-unnamed-types.shader_test
new file mode 100644
index 0000000..c3a5e4b
--- /dev/null
+++ b/tests/shaders/glsl-link-unnamed-types.shader_test
@@ -0,0 +1,29 @@
+# Verifies that the GLSL linker can handle similar unnamed types
+# that appear in multiple shader stages.
+
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+varying vec4 color;
+uniform struct { vec4 x; } a;
+
+void main()
+{
+    gl_Position = gl_Vertex;
+    color = a.x;
+}
+
+[fragment shader]
+varying vec4 color;
+uniform struct { vec4 x; } a;
+
+void main()
+{
+    gl_FragColor = color;
+}
+
+[test]
+uniform vec4 a.x 0.0 1.0 0.0 1.0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
1.8.1.2



More information about the Piglit mailing list