summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.frag25
-rw-r--r--tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.vert23
-rw-r--r--tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.frag28
-rw-r--r--tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.vert26
-rw-r--r--tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.frag17
-rw-r--r--tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.vert14
-rw-r--r--tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.frag24
-rw-r--r--tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.vert21
8 files changed, 178 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.frag b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.frag
new file mode 100644
index 000000000..fe0268c22
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.frag
@@ -0,0 +1,25 @@
+#version 100
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Section 5.10 (Constant Expressions) of the GLSL ES 1.00.17 spec says:
+ *
+ * "A constant expression is one of
+ *
+ * ...
+ *
+ * - a built-in function call whose arguments are all constant
+ * expressions, with the exception of the texture lookup functions."
+ */
+
+precision mediump float;
+
+const float f = cos(0.0);
+
+void main()
+{
+ gl_FragData[0] = vec4(f);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.vert b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.vert
new file mode 100644
index 000000000..b96fcf800
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.vert
@@ -0,0 +1,23 @@
+#version 100
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Section 5.10 (Constant Expressions) of the GLSL ES 1.00.17 spec says:
+ *
+ * "A constant expression is one of
+ *
+ * ...
+ *
+ * - a built-in function call whose arguments are all constant
+ * expressions, with the exception of the texture lookup functions."
+ */
+
+const float f = cos(0.0);
+
+void main()
+{
+ gl_Position = vec4(f);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.frag b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.frag
new file mode 100644
index 000000000..0e398173d
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.frag
@@ -0,0 +1,28 @@
+#version 100
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Section 5.10 (Constant Expressions) of the GLSL ES 1.00.17 spec says:
+ *
+ * "A constant expression is one of
+ *
+ * ...
+ *
+ * - a built-in function call whose arguments are all constant
+ * expressions, with the exception of the texture lookup functions."
+ *
+ * While the sequence operator is specifically disallowed as a constant
+ * expression in GLSL ES 3.0 and later, it is allowed in GLSL ES 1.00.
+ */
+
+precision mediump float;
+
+const float f = cos((1.0, 2.0));
+
+void main()
+{
+ gl_FragData[0] = vec4(f);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.vert b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.vert
new file mode 100644
index 000000000..ffebd6bac
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.vert
@@ -0,0 +1,26 @@
+#version 100
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Section 5.10 (Constant Expressions) of the GLSL ES 1.00.17 spec says:
+ *
+ * "A constant expression is one of
+ *
+ * ...
+ *
+ * - a built-in function call whose arguments are all constant
+ * expressions, with the exception of the texture lookup functions."
+ *
+ * While the sequence 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 = cos((1.0, 2.0));
+
+void main()
+{
+ gl_Position = vec4(f);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.frag b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.frag
new file mode 100644
index 000000000..8a90994e5
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.frag
@@ -0,0 +1,17 @@
+#version 300 es
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 3.00
+ * [end config]
+ */
+
+precision mediump float;
+
+const float f = cos(0.0);
+out vec4 fragdata;
+
+void main()
+{
+ fragdata = vec4(f);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.vert b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.vert
new file mode 100644
index 000000000..851ba76ef
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-function.vert
@@ -0,0 +1,14 @@
+#version 300 es
+
+/* [config]
+ * expect_result: pass
+ * glsl_version: 3.00
+ * [end config]
+ */
+
+const float f = cos(0.0);
+
+void main()
+{
+ gl_Position = vec4(f);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.frag b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.frag
new file mode 100644
index 000000000..84ed272ac
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.frag
@@ -0,0 +1,24 @@
+#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."
+ */
+
+precision mediump float;
+
+const float f = cos((1.0, 2.0));
+out vec4 fragdata;
+
+void main()
+{
+ fragdata = vec4(f);
+}
diff --git a/tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.vert b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.vert
new file mode 100644
index 000000000..5dad4194f
--- /dev/null
+++ b/tests/spec/glsl-es-3.00/compiler/const-initializer/from-sequence-in-function.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 = cos((1.0, 2.0));
+
+void main()
+{
+ gl_Position = vec4(f);
+}