[Piglit] [PATCH] GLSL 1.50: Test that superfluous declarations of output variables is allowed

Nicholas Mack nichmack at gmail.com
Tue Aug 6 10:37:59 PDT 2013


---
 .../glsl-1.50/linker/unused-outputs.shader_test    | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/linker/unused-outputs.shader_test

diff --git a/tests/spec/glsl-1.50/linker/unused-outputs.shader_test b/tests/spec/glsl-1.50/linker/unused-outputs.shader_test
new file mode 100644
index 0000000..ed44d60
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/unused-outputs.shader_test
@@ -0,0 +1,48 @@
+# Test that superfluous declarations are allowed
+#
+# GLSLangSpec.1.50, 4.3.6 ():
+# "Only output variables that are read by the subsequent pipeline stage need
+#  to be written; it is allowed to have superfluous declarations of output
+#  variables."
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+
+out float a;
+out float b;
+out vec2 c;
+
+void main()
+{
+	a = 3.0;
+	b = 1.0;
+	gl_Position = vertex;
+}
+
+[fragment shader]
+#version 150
+
+in float b;
+in vec2 c;
+
+void main()
+{
+	gl_FragColor = vec4(0.0, b, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgba 0.0 1.0 0.0 1.0
+
-- 
1.8.3.1



More information about the Piglit mailing list