[Piglit] [PATCH] glsl: Try some chained assignments

Ian Romanick idr at freedesktop.org
Fri Jan 24 11:08:43 PST 2014


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

Mesa currently passes the chained-assignment.vert, but it fails
chained-assignment-with-array-deref.vert with:

0:5(12): error: value of type vec4 cannot be assigned to variable of type float

It seems the type checker is getting confused by the array
dereference.

I have been told that cases similar to
chained-assignment-with-array-deref pass on all other known desktop
OpenGL implementations.

Note: chained-assignment-with-vector-constant-index.vert and
chained-assignment-with-vector-dynamic-index.vert currently fail on
Mesa.

v2: Simplify the constant indexing test slightly (suggested by Ken).
Add a couple more variations.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../chained-assignment-with-vector-constant-index.vert         | 10 ++++++++++
 .../chained-assignment-with-vector-dynamic-index.vert          | 10 ++++++++++
 .../chained-assignment-with-vector-mask.vert                   | 10 ++++++++++
 .../compiler/assignment-operators/chained-assignment.vert      | 10 ++++++++++
 4 files changed, 40 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-constant-index.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-dynamic-index.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-mask.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment.vert

diff --git a/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-constant-index.vert b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-constant-index.vert
new file mode 100644
index 0000000..1b6daf6
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-constant-index.vert
@@ -0,0 +1,10 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * [end config]
+ */
+
+void splat(vec2 a, float b)
+{
+    a[0] = a[1] = b;
+}
diff --git a/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-dynamic-index.vert b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-dynamic-index.vert
new file mode 100644
index 0000000..82a4319
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-dynamic-index.vert
@@ -0,0 +1,10 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * [end config]
+ */
+
+void splat(vec2 a, float b, int i, int j)
+{
+    a[i] = a[j] = b;
+}
diff --git a/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-mask.vert b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-mask.vert
new file mode 100644
index 0000000..5ae7915
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment-with-vector-mask.vert
@@ -0,0 +1,10 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * [end config]
+ */
+
+void splat(vec2 a, float b)
+{
+    a.x = a.y = b;
+}
diff --git a/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment.vert b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment.vert
new file mode 100644
index 0000000..866941d
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/assignment-operators/chained-assignment.vert
@@ -0,0 +1,10 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * [end config]
+ */
+
+void splat(float a, float b, float c)
+{
+    a = b = c;
+}
-- 
1.8.1.4



More information about the Piglit mailing list