[Piglit] [PATCH V2 8/9] tests/spec: ARB_arrays_of_arrays assignment tests

Timothy Arceri t_arceri at yahoo.com.au
Tue Jan 14 00:20:06 PST 2014


---
 .../compiler/assigment-invalid-implicit-sized.vert |   28 ++++++++++++++++++++
 .../compiler/assignment-1d-to-3d.vert              |   18 +++++++++++++
 .../compiler/assignment-2d-to-3d-from-3d.vert      |   18 +++++++++++++
 .../compiler/assignment-2d-to-3d.vert              |   18 +++++++++++++
 .../compiler/assignment-array-array-var-array.vert |   16 +++++++++++
 5 files changed, 98 insertions(+)
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/assigment-invalid-implicit-sized.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/assignment-1d-to-3d.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d-from-3d.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/assignment-array-array-var-array.vert

diff --git a/tests/spec/arb_arrays_of_arrays/compiler/assigment-invalid-implicit-sized.vert b/tests/spec/arb_arrays_of_arrays/compiler/assigment-invalid-implicit-sized.vert
new file mode 100644
index 0000000..652109f
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/assigment-invalid-implicit-sized.vert
@@ -0,0 +1,28 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ *
+ * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec:
+ *
+ *     "However, implicitly sized arrays cannot be assigned to.  Note, this is
+ *     a rare case that initializers and assignments appear to have different
+ *     semantics."
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+  float [][3] an_array;
+  float [3][3] an_array2;
+
+  an_array[0][2] = 0.0;
+  an_array[1][2] = 1.0;
+  an_array[2][2] = 2.0;
+
+  an_array = an_array2;
+
+  gl_Position = vec4(an_array[2][2]);
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/assignment-1d-to-3d.vert b/tests/spec/arb_arrays_of_arrays/compiler/assignment-1d-to-3d.vert
new file mode 100644
index 0000000..8addbbf
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/assignment-1d-to-3d.vert
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+  vec4 a[4];
+  vec4[2][4] b[3];
+
+  b[2][1] = a;
+
+  gl_Position = b[0][1][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d-from-3d.vert b/tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d-from-3d.vert
new file mode 100644
index 0000000..8cc3640
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d-from-3d.vert
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+  vec4 a[4][2][4];
+  vec4[2][4] b[3];
+
+  b[0] = a[2];
+
+  gl_Position = b[0][1][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d.vert b/tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d.vert
new file mode 100644
index 0000000..34037ec
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/assignment-2d-to-3d.vert
@@ -0,0 +1,18 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+  vec4 a[2][4];
+  vec4[2][4] b[3];
+
+  b[0] = a;
+
+  gl_Position = b[0][1][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/assignment-array-array-var-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/assignment-array-array-var-array.vert
new file mode 100644
index 0000000..a8e3b4b
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/assignment-array-array-var-array.vert
@@ -0,0 +1,16 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+void main()
+{
+  vec4 a[3][2][4];
+  vec4[2][4] b[3] = a;
+
+  gl_Position = a[2][1][1];
+}
-- 
1.7.9.5



More information about the Piglit mailing list