[Piglit] [PATCH V3 04/11] tests/spec: ARB_arrays_of_arrays function parameter and comparision tests
Timothy Arceri
t_arceri at yahoo.com.au
Wed Jan 29 23:23:50 PST 2014
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
equal-implicit-size.vert
AMD: pass
Nvida: pass
Intel: pass
equal-mismatched-size.vert
AMD: pass
Nvida: pass
Intel: pass
equal.vert
AMD: pass
Nvida: pass
Intel: crash (arrays of arrays not supported for uniforms yet)
function-parameter-declaration-array-array-var.vert
AMD: pass
Nvida: pass
Intel: pass
function-parameter-declaration-array-var-array.vert
AMD: pass
Nvida: pass
Intel: pass
function-parameter-declaration-var-array-array.vert
AMD: pass
Nvida: pass
Intel: pass
function-parameter-definition-array-array-var.vert
AMD: pass
Nvida: pass
Intel: pass
function-parameter-definition-array-var-array.vert
AMD: pass
Nvida: pass
Intel: pass
function-parameter-definition-var-array-array.vert
AMD: pass
Nvida: pass
Intel: pass
function-parameter-unsized.vert
AMD: pass
Nvida: pass
Intel: pass
Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
---
.../compiler/equal-implicit-size.vert | 33 ++++++++++++++++++++++
.../compiler/equal-mismatched-size.vert | 23 +++++++++++++++
.../spec/arb_arrays_of_arrays/compiler/equal.vert | 24 ++++++++++++++++
...tion-parameter-declaration-array-array-var.vert | 19 +++++++++++++
...tion-parameter-declaration-array-var-array.vert | 19 +++++++++++++
...tion-parameter-declaration-var-array-array.vert | 19 +++++++++++++
...ction-parameter-definition-array-array-var.vert | 22 +++++++++++++++
...ction-parameter-definition-array-var-array.vert | 22 +++++++++++++++
...ction-parameter-definition-var-array-array.vert | 22 +++++++++++++++
.../compiler/function-parameter-unsized.vert | 22 +++++++++++++++
10 files changed, 225 insertions(+)
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/equal-implicit-size.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/equal-mismatched-size.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/equal.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-array-var.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-var-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-var-array-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-array-var.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-var-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-var-array-array.vert
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/function-parameter-unsized.vert
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/equal-implicit-size.vert b/tests/spec/arb_arrays_of_arrays/compiler/equal-implicit-size.vert
new file mode 100644
index 0000000..44d531b
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/equal-implicit-size.vert
@@ -0,0 +1,33 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "The equality operators and assignment operator are only allowed if the
+ * two operands are same size and type....Both array operands must be
+ * explicitly sized. When using the equality operators ... two arrays are
+ * equal if and only if all the elements are element-wise equal.
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 a[2][3];
+
+void main()
+{
+ vec4 b[][3];
+ vec4[3] c[]
+
+ // Implicitly size b to match a.
+ b[0][2] = vec4(1.0);
+ b[1][2] = vec4(1.0);
+
+ // Implicitly size c to match a.
+ c[0][2] = vec4(1.0);
+ c[1][2] = vec4(1.0);
+
+ gl_Position = vec4(float(a == b), float(b == c), 0, 1);
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/equal-mismatched-size.vert b/tests/spec/arb_arrays_of_arrays/compiler/equal-mismatched-size.vert
new file mode 100644
index 0000000..52591cc
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/equal-mismatched-size.vert
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "The equality operators and assignment operator are only allowed if the
+ * two operands are same size and type....Both array operands must be
+ * explicitly sized. When using the equality operators ... two arrays are
+ * equal if and only if all the elements are element-wise equal.
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 a[2][3];
+uniform vec4 b[3][2]; // Note the differing size
+
+void main()
+{
+ gl_Position = vec4(a == b);
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/equal.vert b/tests/spec/arb_arrays_of_arrays/compiler/equal.vert
new file mode 100644
index 0000000..31daf43
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/equal.vert
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * From page 35 (page 41 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "The equality operators and assignment operator are only allowed if the
+ * two operands are same size and type....Both array operands must be
+ * explicitly sized. When using the equality operators ... two arrays are
+ * equal if and only if all the elements are element-wise equal.
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+uniform vec4 a[2][3];
+uniform vec4 b[2][3];
+uniform vec4[3] c[2];
+
+void main()
+{
+ gl_Position = vec4(float(a == b), float(b == c), 0, 1);
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-array-var.vert b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-array-var.vert
new file mode 100644
index 0000000..8c83f69
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-array-var.vert
@@ -0,0 +1,19 @@
+/* [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
+
+attribute vec4 vert;
+
+void foo(vec4[3][2] x);
+
+void main()
+{
+ vec4 y[3][2];
+ foo(y);
+ gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-var-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-var-array.vert
new file mode 100644
index 0000000..b003ed5
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-array-var-array.vert
@@ -0,0 +1,19 @@
+/* [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
+
+attribute vec4 vert;
+
+void foo(vec4 [2] x[4]);
+
+void main()
+{
+ vec4 y[4][2];
+ foo(y);
+ gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-var-array-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-var-array-array.vert
new file mode 100644
index 0000000..088a9cc
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-declaration-var-array-array.vert
@@ -0,0 +1,19 @@
+/* [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
+
+attribute vec4 vert;
+
+void foo(vec4 x[2][3]);
+
+void main()
+{
+ vec4 y[2][3];
+ foo(y);
+ gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-array-var.vert b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-array-var.vert
new file mode 100644
index 0000000..12043db
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-array-var.vert
@@ -0,0 +1,22 @@
+/* [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
+
+attribute vec4 vert;
+
+void foo(vec4[3][2] x)
+{
+ gl_Position = vert;
+}
+
+void main()
+{
+ vec4 y[3][2];
+ foo(y);
+ gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-var-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-var-array.vert
new file mode 100644
index 0000000..63cf860
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-array-var-array.vert
@@ -0,0 +1,22 @@
+/* [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
+
+attribute vec4 vert;
+
+void foo(vec4 [2] x[2])
+{
+ gl_Position = vert;
+}
+
+void main()
+{
+ vec4 y[2][2];
+ foo(y);
+ gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-var-array-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-var-array-array.vert
new file mode 100644
index 0000000..f8ba53b
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-definition-var-array-array.vert
@@ -0,0 +1,22 @@
+/* [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
+
+attribute vec4 vert;
+
+void foo(vec4 x[2][3])
+{
+ gl_Position = vert;
+}
+
+void main()
+{
+ vec4 y[2][3];
+ foo(y);
+ gl_Position = vert;
+}
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-unsized.vert b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-unsized.vert
new file mode 100644
index 0000000..28af069
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/compiler/function-parameter-unsized.vert
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * require_extensions: GL_ARB_arrays_of_arrays
+ * [end config]
+ *
+ * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "Arrays declared as formal parameters in a function declaration
+ * must specify a size."
+ */
+#version 120
+#extension GL_ARB_arrays_of_arrays: enable
+
+vec4 a_function(vec4 [][6] p);
+
+uniform vec4 [9][6] an_array;
+
+void main()
+{
+ gl_Position = a_function(an_array);
+}
--
1.8.4.2
More information about the Piglit
mailing list