[Piglit] [PATCH] spec/glsl-es-1.00/linker: test pass cases for invariant conditions
Lars Hamre
chemecse at gmail.com
Fri May 6 20:23:48 UTC 2016
These test the cases where gl_FragCoord and gl_PointCoord are
allowed to be declared invariant.
Signed-off-by: Lars Hamre <chemecse at gmail.com>
---
NOTE: someone with access will need to commit this after the
review process
.../linker/glsl-fcoord-invariant-pass.shader_test | 27 +++++++++++++++++++++
.../linker/glsl-pcoord-invariant-pass.shader_test | 28 ++++++++++++++++++++++
2 files changed, 55 insertions(+)
create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
diff --git a/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
new file mode 100644
index 0000000..76348a6
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.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]
+invariant gl_Position;
+void main() {
+ gl_Position = vec4(0.0);
+}
+
+[fragment shader]
+invariant gl_FragCoord;
+void main() {
+ gl_FragColor = vec4(gl_FragCoord.x);
+}
+
+[test]
+link success
diff --git a/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
new file mode 100644
index 0000000..c0e9673
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
@@ -0,0 +1,28 @@
+#
+# 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]
+invariant gl_PointSize;
+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 success
--
2.5.5
More information about the Piglit
mailing list