[Piglit] [PATCH 2/2] glsl-1.30: Add a test for a regression in fragment-outputs handling.

Eric Anholt eric at anholt.net
Tue Apr 24 10:23:40 PDT 2012


---
 .../write-gl_FragColor-and-not-user-output.frag    |   23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 tests/spec/glsl-1.30/compiler/fragment-outputs/write-gl_FragColor-and-not-user-output.frag

diff --git a/tests/spec/glsl-1.30/compiler/fragment-outputs/write-gl_FragColor-and-not-user-output.frag b/tests/spec/glsl-1.30/compiler/fragment-outputs/write-gl_FragColor-and-not-user-output.frag
new file mode 100644
index 0000000..84f8c45
--- /dev/null
+++ b/tests/spec/glsl-1.30/compiler/fragment-outputs/write-gl_FragColor-and-not-user-output.frag
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.30
+ * [end config]
+ *
+ * From page 68 of the GLSL 1.30 spec:
+ *
+ *     "Similarly, if user declared output variables are in use (statically
+ *     assigned to), then the built-in variables gl_FragColor and gl_FragData
+ *     may not be assigned to. These incorrect usages all generate compile
+ *     time errors."
+ *
+ * However, the first fix for this at compile time caused an unused
+ * out variable to be considered as statically written.
+ */
+#version 130
+
+out vec4 unused_color;
+
+void main()
+{
+	gl_FragColor = vec4(1.0);
+}
-- 
1.7.10



More information about the Piglit mailing list