aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gall <tom.gall@linaro.org>2013-01-07 14:43:52 -0600
committerTom Gall <tom.gall@linaro.org>2013-01-23 14:08:50 -0600
commitff65d27812d01a176c560d826b299bf50038d34c (patch)
treebcdc3021f5e3337a0c18c911b9e584c8b9487b09
parent6abfe3c2c3ba0208f3c3796bc68d21de5a9e04aa (diff)
downloadpiglit-ff65d27812d01a176c560d826b299bf50038d34c.tar.gz
gles2: glslparser tests ported to glsl es 1.00 from glsl 1.10
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/centroid-01.vert14
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag29
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert30
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.frag29
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.vert30
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag29
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert30
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.frag29
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.vert30
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/in-01.vert9
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/in-02.vert16
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/inout-01.vert9
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/invariant-01.vert14
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/out-01.vert9
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/out-02.vert16
-rw-r--r--tests/spec/glsl-es-1.00/compiler/qualifiers/out-conversion-int-to-float.vert31
16 files changed, 354 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/centroid-01.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/centroid-01.vert
new file mode 100644
index 00000000..398b1d64
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/centroid-01.vert
@@ -0,0 +1,14 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// "centroid" is a reserved word in GLSL 1.20
+
+uniform vec4 centroid;
+
+void main()
+{
+ gl_Position = centroid;
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
new file mode 100644
index 00000000..25575da9
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function inout parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using C-style array
+// declaration syntax (float x[2] as opposed to float[2] x).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(inout float x[2])
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
new file mode 100644
index 00000000..2bd80bfe
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function inout parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using C-style array
+// declaration syntax (float x[2] as opposed to float[2] x).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(inout float x[2])
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+ gl_Position = vec4(0.0);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.frag b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.frag
new file mode 100644
index 00000000..48257794
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.frag
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function inout parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using GLSL-style array
+// declaration syntax (float[2] x as opposed to float x[2]).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(inout float[2] x)
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.vert
new file mode 100644
index 00000000..232536b0
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-inout-array-allowed.vert
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function inout parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using GLSL-style array
+// declaration syntax (float[2] x as opposed to float x[2]).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(inout float[2] x)
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+ gl_Position = vec4(0.0);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
new file mode 100644
index 00000000..c553b838
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function out parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using C-style array
+// declaration syntax (float x[2] as opposed to float[2] x).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(out float x[2])
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
new file mode 100644
index 00000000..cca80e34
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function out parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using C-style array
+// declaration syntax (float x[2] as opposed to float[2] x).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(out float x[2])
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+ gl_Position = vec4(0.0);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.frag b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.frag
new file mode 100644
index 00000000..f9ae1037
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.frag
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function out parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using GLSL-style array
+// declaration syntax (float[2] x as opposed to float x[2]).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(out float[2] x)
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.vert
new file mode 100644
index 00000000..86000011
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/fn-out-array-allowed.vert
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that an array can be used as a function out parameter in
+// GLSL 1.20.
+//
+// In this test, the array is declared using GLSL-style array
+// declaration syntax (float[2] x as opposed to float x[2]).
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(out float[2] x)
+{
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+ gl_Position = vec4(0.0);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/in-01.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/in-01.vert
new file mode 100644
index 00000000..ea522d22
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/in-01.vert
@@ -0,0 +1,9 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// "in" is only allowed in parameter list in GLSL 1.20
+
+in vec4 foo;
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/in-02.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/in-02.vert
new file mode 100644
index 00000000..7341a04a
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/in-02.vert
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// "in" is only allowed in parameter list in GLSL 1.20
+
+attribute vec4 vertex;
+
+void main()
+{
+ in vec4 foo;
+
+ gl_Position = vertex;
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/inout-01.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/inout-01.vert
new file mode 100644
index 00000000..c95a62c3
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/inout-01.vert
@@ -0,0 +1,9 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// "inout" is only allowed in parameter list in GLSL 1.20
+
+inout vec4 foo;
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/invariant-01.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/invariant-01.vert
new file mode 100644
index 00000000..896783b3
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/invariant-01.vert
@@ -0,0 +1,14 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// "invariant" is a reserved word in GLSL 1.20
+
+uniform vec4 invariant;
+
+void main()
+{
+ gl_Position = invariant;
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/out-01.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/out-01.vert
new file mode 100644
index 00000000..90204f46
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/out-01.vert
@@ -0,0 +1,9 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// "out" is only allowed in parameter list in GLSL 1.20
+
+out vec4 foo;
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/out-02.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/out-02.vert
new file mode 100644
index 00000000..ce91389d
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/out-02.vert
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// "out" is only allowed in parameter list in GLSL 1.20
+
+attribute vec4 vertex;
+
+void main()
+{
+ out vec4 foo;
+
+ gl_Position = vertex;
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/qualifiers/out-conversion-int-to-float.vert b/tests/spec/glsl-es-1.00/compiler/qualifiers/out-conversion-int-to-float.vert
new file mode 100644
index 00000000..b047069a
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/qualifiers/out-conversion-int-to-float.vert
@@ -0,0 +1,31 @@
+/*
+ * [config]
+ * glsl_version: 1.20
+ * glsles_version: 1.00
+ * expect_result: pass
+ * [end_config]
+ *
+ * Test that implicit type conversion of out parameters is properly
+ * used to match function calls to callees.
+ *
+ * From the GLSL 1.30 spec (which clarifies, but does not change, the
+ * rules for implicit type conversion in GLSL 1.20), section 6.1
+ * (Function Definitions):
+ *
+ * Mismatched types on output parameters (out or inout) must have a
+ * conversion from the formal parameter type to the calling argument
+ * type.
+ */
+attribute vec4 vertex;
+
+void f(out int x)
+{
+ x = 0;
+}
+
+void
+main() {
+ float x;
+ f(x);
+ gl_Position = vertex;
+}