[Piglit] [PATCH] glsl-es-1.00: add invariance tests for builtin variables

Tapani Pälli tapani.palli at intel.com
Fri Nov 7 03:21:33 PST 2014


Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 .../execution/glsl-fcoord-invariant.shader_test    | 26 +++++++++++++++++++++
 .../execution/glsl-fface-invariant.shader_test     | 23 ++++++++++++++++++
 .../execution/glsl-pcoord-invariant.shader_test    | 27 ++++++++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100644 tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test
 create mode 100644 tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test
 create mode 100644 tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test

diff --git a/tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test b/tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test
new file mode 100644
index 0000000..18037cd
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test
@@ -0,0 +1,26 @@
+#
+# OpenGL ES 1.00 specification "Invariance and linkage":
+#
+#    "For the built-in special variables, gl_FragCoord can
+#    only be declared invariant if and only if gl_Position is
+#    declared invariant. Similarly gl_PointCoord can only be
+#    declared invariant if and only if gl_PointSize is declared
+#    invariant. It is an error to declare gl_FrontFacing as invariant."
+#
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader]
+void main() {
+	gl_Position = vec4(0.0);
+}
+
+[fragment shader]
+invariant gl_FragCoord;
+void main() {
+	gl_FragColor = vec4(gl_FragCoord.x);
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test b/tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test
new file mode 100644
index 0000000..ee91098
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test
@@ -0,0 +1,23 @@
+#
+# OpenGL ES 1.00 specification "Invariance and linkage":
+#
+#    "For the built-in special variables, gl_FragCoord can
+#    only be declared invariant if and only if gl_Position is
+#    declared invariant. Similarly gl_PointCoord can only be
+#    declared invariant if and only if gl_PointSize is declared
+#    invariant. It is an error to declare gl_FrontFacing as invariant."
+#
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader passthrough]
+
+[fragment shader]
+invariant gl_FrontFacing;
+void main() {
+	gl_FragColor = vec4(gl_FrontFacing);
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test b/tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test
new file mode 100644
index 0000000..2dff8fb
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test
@@ -0,0 +1,27 @@
+#
+# OpenGL ES 1.00 specification "Invariance and linkage":
+#
+#    "For the built-in special variables, gl_FragCoord can
+#    only be declared invariant if and only if gl_Position is
+#    declared invariant. Similarly gl_PointCoord can only be
+#    declared invariant if and only if gl_PointSize is declared
+#    invariant. It is an error to declare gl_FrontFacing as invariant."
+#
+[require]
+GL ES >= 2.0
+GLSL ES >= 1.00
+
+[vertex shader]
+void main() {
+	gl_PointSize = 1.0;
+	gl_Position = vec4(0.0);
+}
+
+[fragment shader]
+invariant gl_PointCoord;
+void main() {
+	gl_FragColor = vec4(gl_PointCoord.x);
+}
+
+[test]
+link error
-- 
1.9.3



More information about the Piglit mailing list