[Piglit] [PATCH] glsl-es: Test whether or not sequence can be a constant expression

Ian Romanick idr at freedesktop.org
Mon Oct 5 15:57:45 PDT 2015


From: Ian Romanick <ian.d.romanick at intel.com>

The rules changed from GLSL ES 1.00 to GLSL ES 3.00, so the two tests
expect opposite results.

NOTE: Mesa currently fails
tests/spec/glsl-es-3.00/compiler/constant-sequence.vert and the related
GLES3 conformance test.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Tapani Pälli <tapani.palli at intel.com>
Cc: Mark Janes <mark.a.janes at intel.com>
Cc: Marta Lofstedt <marta.lofstedt at intel.com>
---
 .../glsl-es-1.00/compiler/constant-sequence.vert    | 17 +++++++++++++++++
 .../glsl-es-3.00/compiler/constant-sequence.vert    | 21 +++++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 tests/spec/glsl-es-1.00/compiler/constant-sequence.vert
 create mode 100644 tests/spec/glsl-es-3.00/compiler/constant-sequence.vert

diff --git a/tests/spec/glsl-es-1.00/compiler/constant-sequence.vert b/tests/spec/glsl-es-1.00/compiler/constant-sequence.vert
new file mode 100644
index 0000000..f57707b
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/constant-sequence.vert
@@ -0,0 +1,17 @@
+#version 100
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * While the sequnece operator is specifically disallowed as a constant
+ * expression in GLSL ES 3.0 and later, it is allowed in GLSL ES 1.00.
+ */
+
+const float f = (1.0, 2.0);
+
+void main()
+{
+    gl_Position = vec4(f);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/constant-sequence.vert b/tests/spec/glsl-es-3.00/compiler/constant-sequence.vert
new file mode 100644
index 0000000..260e8ef
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/constant-sequence.vert
@@ -0,0 +1,21 @@
+#version 300 es
+
+/* [config]
+ * expect_result: fail
+ * glsl_version: 3.00
+ * [end config]
+ *
+ * Section 4.3.3 "Constant Expressions" of the OpenGL GLSL ES 3.00.4 spec
+ * says:
+ *
+ *     "However, the sequence operator ( , ) and the assignment operators ( =,
+ *     +=, ...)  are not included in the operators that can create a constant
+ *     expression."
+ */
+
+const float f = (1.0, 2.0);
+
+void main()
+{
+    gl_Position = vec4(f);
+}
-- 
2.1.0



More information about the Piglit mailing list