diff mbox

[V4,10/11] arb_arrays_of_arrays: assignment tests

Message ID 1402749495-11964-1-git-send-email-t_arceri@yahoo.com.au
State New
Headers show

Commit Message

'Timothy Arceri' via Patchwork Forward June 14, 2014, 12:38 p.m. UTC
Test results are from the following hardware/driver combinations:

AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3
Nvidia GeForce 210 - NVIDIA 331.20 OpenGL 3.3
Intel Ivy Bridge - Mesa 10.1(815e064) with ARB_arrays_of_arrays enabled

assigment-invalid-implicit-sized.vert
AMD: fail
Nvida: fail
Intel: pass

assignment-1d-to-3d.vert
AMD: pass
Nvida: pass
Intel: pass

assignment-2d-to-3d-from-3d.vert
AMD: pass
Nvida: pass
Intel: pass

assignment-2d-to-3d.vert
AMD: pass
Nvida: pass
Intel: pass

assignment-array-array-var-array.vert
AMD: pass
Nvida: pass
Intel: pass

assignment-invalid-1d-to-3d.vert
AMD: pass
Intel: pass

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
---
 .../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 +++++++++++++
 .../compiler/assignment-invalid-1d-to-3d.vert      | 18 ++++++++++++++
 .../assignment-invalid-implicit-sized.vert         | 28 ++++++++++++++++++++++
 6 files changed, 116 insertions(+)
 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
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-1d-to-3d.vert
 create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-implicit-sized.vert
diff mbox

Patch

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];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-1d-to-3d.vert b/tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-1d-to-3d.vert
new file mode 100644
index 0000000..62fcbdb
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-1d-to-3d.vert
@@ -0,0 +1,18 @@ 
+/* [config]
+ * expect_result: fail
+ * 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 = a;
+
+  gl_Position = b[0][1][1];
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-implicit-sized.vert b/tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-implicit-sized.vert
new file mode 100644
index 0000000..1458aa6
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/assignment-invalid-implicit-sized.vert
@@ -0,0 +1,28 @@ 
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * 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."
+ */
+#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]);
+}