<div dir="ltr">On 5 October 2013 04:21, Timothy Arceri <span dir="ltr"><<a href="mailto:t_arceri@yahoo.com.au" target="_blank">t_arceri@yahoo.com.au</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Signed-off-by: Timothy Arceri <<a href="mailto:t_arceri@yahoo.com.au">t_arceri@yahoo.com.au</a>><br>
---<br>
tests/all.tests | 7 +++++++<br>
...-function-parameter-declaration-new-syntax.vert | 17 ++++++++++++++++<br>
...ay-of-array-function-parameter-declaration.vert | 17 ++++++++++++++++<br>
...y-function-parameter-definition-new-syntax.vert | 20 +++++++++++++++++++<br>
...ray-of-array-function-parameter-definition.vert | 20 +++++++++++++++++++<br>
.../array-of-array-structure-field-new-syntax.frag | 17 ++++++++++++++++<br>
.../compiler/array-of-array-structure-field.frag | 17 ++++++++++++++++<br>
.../array-of-array-uniform-new-syntax.vert | 15 ++++++++++++++<br>
...f-array-uniform-unsized-invalid-new-syntax.vert | 21 ++++++++++++++++++++<br>
...-array-uniform-unsized-invalid-new-syntax2.vert | 21 ++++++++++++++++++++<br>
.../array-of-array-uniform-unsized-invalid.vert | 21 ++++++++++++++++++++<br>
.../array-of-array-uniform-unsized-invalid2.vert | 21 ++++++++++++++++++++<br>
.../array-of-array-uniform-unsized-new-syntax.vert | 15 ++++++++++++++<br>
.../compiler/array-of-array-uniform-unsized.vert | 15 ++++++++++++++<br>
.../compiler/array-of-array-uniform.vert | 15 ++++++++++++++<br>
15 files changed, 259 insertions(+)<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert<br>
create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert<br></blockquote><div><br></div><div>General comment: it seems redundant to have "arb_arrays_of_arrays" in the folder name and "array-of-array-" as a prefix to each parser test. Can we remove "array-of-array-" from the parser test file names (so for example tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert becomes tests/spec/arb_arrays_of_arrays/compiler/uniform.vert).<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index 3e5e1a3..1737138 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -1272,6 +1272,13 @@ for backing_type in ('texture', 'renderbuffer'):<br>
'arb_framebuffer_srgb-' + test_name)<br>
add_plain_test(arb_framebuffer_srgb, 'framebuffer-srgb')<br>
<br>
+# Group ARB_arrays_of_arrays<br>
+arb_arrays_of_arrays = Group()<br>
+spec['ARB_arrays_of_arrays'] = arb_arrays_of_arrays<br>
+import_glsl_parser_tests(arb_arrays_of_arrays,<br>
+ os.path.join(testsDir, 'spec', 'arb_arrays_of_arrays'),<br>
+ ['compiler'])<br>
+<br>
arb_gpu_shader5 = Group()<br>
spec['ARB_gpu_shader5'] = arb_gpu_shader5<br>
add_shader_test_dir(arb_gpu_shader5,<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert<br>
new file mode 100644<br>
index 0000000..d4f8bf8<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert<br></blockquote><div><br></div><div>Calling this test "new syntax" is confusing. All three of these syntaxes are new:<br>
<br></div><div>vec4[3][2] a;<br>vec4[2] a[3];<br></div><div>vec4 a[3][2];<br><br></div><div>I'd suggest a naming convention that just names the syntax elements in the order they appear. So for instance:<br><br></div>
<div>vec4[3][2] a; // tested by *-array-array-var<br></div><div>vec4[2] a[3]; // tested by *-array-var-array<br></div><div>vec4 a[3][2]; // tested by *-var-array-array<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
@@ -0,0 +1,17 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+attribute vec4 vert;<br>
+<br>
+void foo(vec4 [2] x[2]);<br>
+<br>
+void main()<br>
+{<br></blockquote><div><br></div><div>It would be nice to include a call to the function here in main(), so that we can verify that the compiler's type checking logic correctly deduces that the function can be called.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ gl_Position = vert;<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert<br>
new file mode 100644<br>
index 0000000..60fec71<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert<br>
@@ -0,0 +1,17 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+attribute vec4 vert;<br>
+<br>
+void foo(vec4 x[2][3]);<br>
+<br>
+void main()<br>
+{<br></blockquote><div><br></div><div>Same comment applies here.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ gl_Position = vert;<br>
+}<br></blockquote><div><br></div><div>Can we also add a test to verify that the following works:<br><br>void foo(vec4[3][2] x);<br><br></div><div>(this is explicitly allowed by the spec).<br><br></div><div>A similar comment goes for all the other tests in this patch.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert<br>
new file mode 100644<br>
index 0000000..c93ed9d<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert<br>
@@ -0,0 +1,20 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+attribute vec4 vert;<br>
+<br>
+void foo(vec4 [2] x[2])<br>
+{<br>
+ gl_Position = vert;<br>
+}<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = vert;<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert<br>
new file mode 100644<br>
index 0000000..f43284a<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert<br>
@@ -0,0 +1,20 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+attribute vec4 vert;<br>
+<br>
+void foo(vec4 x[2][3])<br>
+{<br>
+ gl_Position = vert;<br>
+}<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = vert;<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag<br>
new file mode 100644<br>
index 0000000..54c4da5<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag<br>
@@ -0,0 +1,17 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+struct S {<br>
+ vec4 [2] x[2];<br>
+};<br>
+<br>
+void main()<br>
+{<br>
+ gl_FragData[0] = vec4(0.0);<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag<br>
new file mode 100644<br>
index 0000000..e0de2b9<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag<br>
@@ -0,0 +1,17 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+struct S {<br>
+ vec4 x[2][3];<br>
+};<br>
+<br>
+void main()<br>
+{<br>
+ gl_FragData[0] = vec4(0.0);<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert<br>
new file mode 100644<br>
index 0000000..588152e<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert<br>
@@ -0,0 +1,15 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 [1] an_array[1];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert<br>
new file mode 100644<br>
index 0000000..7af032a<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert<br>
@@ -0,0 +1,21 @@<br>
+/* [config]<br>
+ * expect_result: fail<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ *<br>
+ * For ARB_arrays_of_arrays spec:<br>
+ *<br>
+ * "For unsized arrays, only the outermost dimension can be lacking a<br>
+ * size. A type that includes an unknown array size cannot be formed into<br>
+ * an array until it gets an explicit size."<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 [] an_array[];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert<br>
new file mode 100644<br>
index 0000000..fcb0239<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert<br>
@@ -0,0 +1,21 @@<br>
+/* [config]<br>
+ * expect_result: fail<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ *<br>
+ * For ARB_arrays_of_arrays spec:<br>
+ *<br>
+ * "For unsized arrays, only the outermost dimension can be lacking a<br>
+ * size. A type that includes an unknown array size cannot be formed into<br>
+ * an array until it gets an explicit size."<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 [] an_array[1];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert<br>
new file mode 100644<br>
index 0000000..83da6cc<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert<br>
@@ -0,0 +1,21 @@<br>
+/* [config]<br>
+ * expect_result: fail<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ *<br>
+ * For ARB_arrays_of_arrays spec:<br>
+ *<br>
+ * "For unsized arrays, only the outermost dimension can be lacking a<br>
+ * size. A type that includes an unknown array size cannot be formed into<br>
+ * an array until it gets an explicit size."<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 an_array[][];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert<br>
new file mode 100644<br>
index 0000000..49aacce<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert<br>
@@ -0,0 +1,21 @@<br>
+/* [config]<br>
+ * expect_result: fail<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ *<br>
+ * For ARB_arrays_of_arrays spec:<br>
+ *<br>
+ * "For unsized arrays, only the outermost dimension can be lacking a<br>
+ * size. A type that includes an unknown array size cannot be formed into<br>
+ * an array until it gets an explicit size."<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 an_array[1][];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert<br>
new file mode 100644<br>
index 0000000..e801f65<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert<br>
@@ -0,0 +1,15 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 [1] an_array[];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert<br>
new file mode 100644<br>
index 0000000..99a52a1<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert<br>
@@ -0,0 +1,15 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 an_array[][1];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
diff --git a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert<br>
new file mode 100644<br>
index 0000000..95215bb<br>
--- /dev/null<br>
+++ b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert<br>
@@ -0,0 +1,15 @@<br>
+/* [config]<br>
+ * expect_result: pass<br>
+ * glsl_version: 1.20<br>
+ * require_extensions: GL_ARB_arrays_of_arrays<br>
+ * [end config]<br>
+ */<br>
+#version 120<br>
+#extension GL_ARB_arrays_of_arrays: enable<br>
+<br>
+uniform vec4 an_array[1][1];<br>
+<br>
+void main()<br>
+{<br>
+ gl_Position = an_array[0][0];<br>
+}<br>
<span class=""><font color="#888888">--<br>
1.7.9.5<br></font></span></blockquote><div><br></div><div>As a side note, are you planning to add other tests in subsequent patches? Glancing at the spec, it seems like there's a lot more that still needs to be tested.</div>
</div></div></div>