On 13 September 2011 08:23, Ian Romanick <span dir="ltr">&lt;<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div><div class="im">On 09/12/2011 06:12 PM, Paul Berry wrote:<br>
&gt; In GLSL 1.10, whole arrays are not lvalues (even though their<br>
&gt; elements are).  This means it is illegal to use an array on the<br>
&gt; left hand side of an assigment, or to use it as an out or inout<br>
&gt; parameter of a function.<br>
&gt;<br>
&gt; In GLSL 1.20 and later versions, an array is a proper lvalue, so<br>
&gt; all of these uses are allowed.<br>
&gt;<br>
&gt; This patch adds tests to verify that all the above usages are<br>
&gt; prohibited in GLSL 1.10 and allowed in GLSL 1.20.  In addition it<br>
&gt; verifies that in GLSL 1.20, a built-in array may be used as an<br>
&gt; lvalue (since this currently exercises a different code path in<br>
&gt; Mesa).<br>
<br>
</div>There are a few comments below.<br>
<br>
Since the GLSL ES 1.00 behavior is different from both GLSL 1.10 and<br>
GLSL 1.20, we should have tests for that as well.<br></blockquote><div><br>Yes, good point.  I&#39;ll add some more tests.  Two quick questions before I do:<br><br>- Am I right that all I need to do to write a parser test for GLSL ES 1.00 is to specify a GLSL version of &quot;1.00&quot;?<br>
- Where would be a good place in the directory tree to put these tests?  I&#39;m thinking of creating a new directory &quot;tests/spec/glsl-es-1.00&quot;.<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
&gt; --- .../assign-array-prohibited.frag                   |   19<br>
<div><div></div><div class="h5">&gt; ++++++++++++++++ .../assign-array-prohibited.vert<br>
&gt; |   19 ++++++++++++++++ .../fn-inout-array-prohibited-cstyle.frag<br>
&gt; |   21 ++++++++++++++++++ .../fn-inout-array-prohibited-cstyle.vert<br>
&gt; |   21 ++++++++++++++++++<br>
&gt; .../qualifiers/fn-inout-array-prohibited.frag      |   21<br>
&gt; ++++++++++++++++++ .../qualifiers/fn-inout-array-prohibited.vert<br>
&gt; |   21 ++++++++++++++++++<br>
&gt; .../qualifiers/fn-out-array-prohibited-cstyle.frag |   21<br>
&gt; ++++++++++++++++++<br>
&gt; .../qualifiers/fn-out-array-prohibited-cstyle.vert |   21<br>
&gt; ++++++++++++++++++ .../qualifiers/fn-out-array-prohibited.frag<br>
&gt; |   21 ++++++++++++++++++<br>
&gt; .../qualifiers/fn-out-array-prohibited.vert        |   21<br>
&gt; ++++++++++++++++++<br>
&gt; .../assignment-operators/assign-array-allowed.frag |   21<br>
&gt; ++++++++++++++++++<br>
&gt; .../assignment-operators/assign-array-allowed.vert |   21<br>
&gt; ++++++++++++++++++ .../assign-builtin-array-allowed.vert<br>
&gt; |   21 ++++++++++++++++++<br>
&gt; .../qualifiers/fn-inout-array-allowed-cstyle.frag  |   23<br>
&gt; ++++++++++++++++++++<br>
&gt; .../qualifiers/fn-inout-array-allowed-cstyle.vert  |   23<br>
&gt; ++++++++++++++++++++ .../qualifiers/fn-inout-array-allowed.frag<br>
&gt; |   23 ++++++++++++++++++++<br>
&gt; .../qualifiers/fn-inout-array-allowed.vert         |   23<br>
&gt; ++++++++++++++++++++<br>
&gt; .../qualifiers/fn-out-array-allowed-cstyle.frag    |   23<br>
&gt; ++++++++++++++++++++<br>
&gt; .../qualifiers/fn-out-array-allowed-cstyle.vert    |   23<br>
&gt; ++++++++++++++++++++<br>
&gt; .../compiler/qualifiers/fn-out-array-allowed.frag  |   23<br>
&gt; ++++++++++++++++++++<br>
&gt; .../compiler/qualifiers/fn-out-array-allowed.vert  |   23<br>
&gt; ++++++++++++++++++++ 21 files changed, 453 insertions(+), 0<br>
&gt; deletions(-) create mode 100644<br>
&gt; tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
&gt;<br>
&gt;<br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
&gt; create mode 100644<br>
&gt; tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
&gt;<br>
&gt; diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
&gt; b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..086b574 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,19 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that assignment to an array is illegal<br>
&gt; in GLSL 1.10. +// +// From section 5.8 of the GLSL 1.10 spec: +//<br>
&gt; Other binary or unary expressions, non-dereferenced arrays, +//<br>
&gt; function names, swizzles with repeated fields, and constants +//<br>
&gt; cannot be l-values. + +#version 110 + +void f(float[2] x)<br>
<br>
</div></div>This array declaration syntax is not legal in GLSL 1.10.  It was added<br>
in GLSL 1.20.<br></blockquote><div><br>Oh, I didn&#39;t realize that.  (...checks spec...)  You&#39;re right.  I&#39;ll remove the bogus tests glsl-1.10/compiler/qualifiers/fn-{inout,out}-array-prohibited.{frag,vert}, and I&#39;ll modify glsl-1.10/compiler/assignment-operators/assign-array-prohibited.{frag,vert} to use the proper GLSL 1.10 syntax.<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
&gt; +{ +  float[2] y; +  y = x; +} diff --git<br>
<div><div></div><div class="h5">&gt; a/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
&gt; b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..086b574 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,19 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that assignment to an array is illegal<br>
&gt; in GLSL 1.10. +// +// From section 5.8 of the GLSL 1.10 spec: +//<br>
&gt; Other binary or unary expressions, non-dereferenced arrays, +//<br>
&gt; function names, swizzles with repeated fields, and constants +//<br>
&gt; cannot be l-values. + +#version 110 + +void f(float[2] x) +{ +<br>
&gt; float[2] y; +  y = x; +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..a56d197 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
&gt; the array is declared using C-style array +// declaration syntax<br>
&gt; (float x[2] as opposed to float[2] x). +// +// From section 5.8 of<br>
&gt; the GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(inout float x[2]) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..a56d197 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
&gt; the array is declared using C-style array +// declaration syntax<br>
&gt; (float x[2] as opposed to float[2] x). +// +// From section 5.8 of<br>
&gt; the GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(inout float x[2]) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..a2836e2 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
&gt; the array is declared using GLSL-style array +// declaration syntax<br>
&gt; (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
&gt; the GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(inout float[2] x) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..a2836e2 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
&gt; the array is declared using GLSL-style array +// declaration syntax<br>
&gt; (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
&gt; the GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(inout float[2] x) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..d9a8f8a --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
&gt; array is declared using C-style array +// declaration syntax (float<br>
&gt; x[2] as opposed to float[2] x). +// +// From section 5.8 of the<br>
&gt; GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(out float x[2]) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..d9a8f8a --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
&gt; array is declared using C-style array +// declaration syntax (float<br>
&gt; x[2] as opposed to float[2] x). +// +// From section 5.8 of the<br>
&gt; GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(out float x[2]) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..43cb43e --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
&gt; array is declared using GLSL-style array +// declaration syntax<br>
&gt; (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
&gt; the GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(out float[2] x) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..43cb43e --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
&gt; [end config] +// +// Check that an array can&#39;t be used as a<br>
&gt; function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
&gt; array is declared using GLSL-style array +// declaration syntax<br>
&gt; (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
&gt; the GLSL 1.10 spec: +//     Other binary or unary expressions,<br>
&gt; non-dereferenced arrays, +//     function names, swizzles with<br>
&gt; repeated fields, and constants +//     cannot be l-values. +<br>
&gt; +#version 110 + +void f(out float[2] x) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
&gt; b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..7b65d4b --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that assignment to an array is allowed<br>
&gt; in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20 spec: +//<br>
&gt; Variables that are built-in types, entire structures or arrays, +//<br>
&gt; structure fields, l-values with the field selector ( . ) +//<br>
&gt; applied to select components or swizzles without repeated +//<br>
&gt; fields, l-values within parentheses, and l-values dereferenced +//<br>
&gt; with the array subscript operator ( [] ) are all l-values. +<br>
&gt; +#version 120 + +void f(float[2] x) +{ +  float[2] y; +  y = x; +}<br>
&gt; diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
&gt; b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..7b65d4b --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that assignment to an array is allowed<br>
&gt; in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20 spec: +//<br>
&gt; Variables that are built-in types, entire structures or arrays, +//<br>
&gt; structure fields, l-values with the field selector ( . ) +//<br>
&gt; applied to select components or swizzles without repeated +//<br>
&gt; fields, l-values within parentheses, and l-values dereferenced +//<br>
&gt; with the array subscript operator ( [] ) are all l-values. +<br>
&gt; +#version 120 + +void f(float[2] x) +{ +  float[2] y; +  y = x; +}<br>
&gt; diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
&gt; b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..0daf6e0 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,21 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that bulk assignment to a built-in array<br>
&gt; is allowed in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20<br>
&gt; spec: +//     Variables that are built-in types, entire structures<br>
&gt; or arrays, +//     structure fields, l-values with the field<br>
&gt; selector ( . ) +//     applied to select components or swizzles<br>
&gt; without repeated +//     fields, l-values within parentheses, and<br>
&gt; l-values dereferenced +//     with the array subscript operator (<br>
&gt; [] ) are all l-values. + +#version 120 +varying vec4<br>
&gt; gl_TexCoord[gl_MaxTextureCoords]; + +void<br>
&gt; f(vec4[gl_MaxTextureCoords] x) +{ +  gl_TexCoord = x; +}<br>
<br>
</div></div>glslparsertest tests that are expected to pass should also be<br>
linkable.  That means they should have a main function and should<br>
write  gl_Position in the vertex shader.<br></blockquote><div><br>Makes sense.  I&#39;ll also add &quot;check_link: true&quot; to these tests so that if they don&#39;t link properly, piglit will report an error.<br> </div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
&gt; diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..aebc81a --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
&gt; is declared using C-style array +// declaration syntax (float x[2]<br>
&gt; as opposed to float[2] x). +// +// From section 5.8 of the GLSL<br>
&gt; 1.20 spec: +//     Variables that are built-in types, entire<br>
&gt; structures or arrays, +//     structure fields, l-values with the<br>
&gt; field selector ( . ) +//     applied to select components or<br>
&gt; swizzles without repeated +//     fields, l-values within<br>
&gt; parentheses, and l-values dereferenced +//     with the array<br>
&gt; subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
&gt; f(inout float x[2]) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..aebc81a --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
&gt; is declared using C-style array +// declaration syntax (float x[2]<br>
&gt; as opposed to float[2] x). +// +// From section 5.8 of the GLSL<br>
&gt; 1.20 spec: +//     Variables that are built-in types, entire<br>
&gt; structures or arrays, +//     structure fields, l-values with the<br>
&gt; field selector ( . ) +//     applied to select components or<br>
&gt; swizzles without repeated +//     fields, l-values within<br>
&gt; parentheses, and l-values dereferenced +//     with the array<br>
&gt; subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
&gt; f(inout float x[2]) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..0d4b8c0 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
&gt; is declared using GLSL-style array +// declaration syntax (float[2]<br>
&gt; x as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
&gt; 1.20 spec: +//     Variables that are built-in types, entire<br>
&gt; structures or arrays, +//     structure fields, l-values with the<br>
&gt; field selector ( . ) +//     applied to select components or<br>
&gt; swizzles without repeated +//     fields, l-values within<br>
&gt; parentheses, and l-values dereferenced +//     with the array<br>
&gt; subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
&gt; f(inout float[2] x) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..0d4b8c0 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
&gt; is declared using GLSL-style array +// declaration syntax (float[2]<br>
&gt; x as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
&gt; 1.20 spec: +//     Variables that are built-in types, entire<br>
&gt; structures or arrays, +//     structure fields, l-values with the<br>
&gt; field selector ( . ) +//     applied to select components or<br>
&gt; swizzles without repeated +//     fields, l-values within<br>
&gt; parentheses, and l-values dereferenced +//     with the array<br>
&gt; subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
&gt; f(inout float[2] x) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..d3792a4 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
&gt; declared using C-style array +// declaration syntax (float x[2] as<br>
&gt; opposed to float[2] x). +// +// From section 5.8 of the GLSL 1.20<br>
&gt; spec: +//     Variables that are built-in types, entire structures<br>
&gt; or arrays, +//     structure fields, l-values with the field<br>
&gt; selector ( . ) +//     applied to select components or swizzles<br>
&gt; without repeated +//     fields, l-values within parentheses, and<br>
&gt; l-values dereferenced +//     with the array subscript operator (<br>
&gt; [] ) are all l-values. + +#version 120 + +void f(out float x[2])<br>
&gt; +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..d3792a4 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
&gt; declared using C-style array +// declaration syntax (float x[2] as<br>
&gt; opposed to float[2] x). +// +// From section 5.8 of the GLSL 1.20<br>
&gt; spec: +//     Variables that are built-in types, entire structures<br>
&gt; or arrays, +//     structure fields, l-values with the field<br>
&gt; selector ( . ) +//     applied to select components or swizzles<br>
&gt; without repeated +//     fields, l-values within parentheses, and<br>
&gt; l-values dereferenced +//     with the array subscript operator (<br>
&gt; [] ) are all l-values. + +#version 120 + +void f(out float x[2])<br>
&gt; +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..9351ba9 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
&gt; declared using GLSL-style array +// declaration syntax (float[2] x<br>
&gt; as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
&gt; 1.20 spec: +//     Variables that are built-in types, entire<br>
&gt; structures or arrays, +//     structure fields, l-values with the<br>
&gt; field selector ( . ) +//     applied to select components or<br>
&gt; swizzles without repeated +//     fields, l-values within<br>
&gt; parentheses, and l-values dereferenced +//     with the array<br>
&gt; subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
&gt; f(out float[2] x) +{ +} diff --git<br>
&gt; a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
&gt;<br>
&gt;<br>
new file mode 100644<br>
&gt; index 0000000..9351ba9 --- /dev/null +++<br>
&gt; b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
&gt;<br>
&gt;<br>
@@ -0,0 +1,23 @@<br>
&gt; +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
&gt; [end config] +// +// Check that an array can be used as a function<br>
&gt; out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
&gt; declared using GLSL-style array +// declaration syntax (float[2] x<br>
&gt; as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
&gt; 1.20 spec: +//     Variables that are built-in types, entire<br>
&gt; structures or arrays, +//     structure fields, l-values with the<br>
&gt; field selector ( . ) +//     applied to select components or<br>
&gt; swizzles without repeated +//     fields, l-values within<br>
&gt; parentheses, and l-values dereferenced +//     with the array<br>
&gt; subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
&gt; f(out float[2] x) +{ +}<br>
</div></div><div class="im">-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.11 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
</div>iEYEARECAAYFAk5vdVUACgkQX1gOwKyEAw87GgCfW6ad15EAq0IOmds7kBV5aHOR<br>
6poAoIcEvQmzabIjDKm32OzRLnvKlOkW<br>
=AmSj<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br>Thanks, Ian.  I&#39;ll submit a &quot;v2&quot; patch once I&#39;ve made all these corrections.<br>