On 13 September 2011 08:23, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>></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>
> In GLSL 1.10, whole arrays are not lvalues (even though their<br>
> elements are). This means it is illegal to use an array on the<br>
> left hand side of an assigment, or to use it as an out or inout<br>
> parameter of a function.<br>
><br>
> In GLSL 1.20 and later versions, an array is a proper lvalue, so<br>
> all of these uses are allowed.<br>
><br>
> This patch adds tests to verify that all the above usages are<br>
> prohibited in GLSL 1.10 and allowed in GLSL 1.20. In addition it<br>
> verifies that in GLSL 1.20, a built-in array may be used as an<br>
> lvalue (since this currently exercises a different code path in<br>
> 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'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 "1.00"?<br>
- Where would be a good place in the directory tree to put these tests? I'm thinking of creating a new directory "tests/spec/glsl-es-1.00".<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>
> --- .../assign-array-prohibited.frag | 19<br>
<div><div></div><div class="h5">> ++++++++++++++++ .../assign-array-prohibited.vert<br>
> | 19 ++++++++++++++++ .../fn-inout-array-prohibited-cstyle.frag<br>
> | 21 ++++++++++++++++++ .../fn-inout-array-prohibited-cstyle.vert<br>
> | 21 ++++++++++++++++++<br>
> .../qualifiers/fn-inout-array-prohibited.frag | 21<br>
> ++++++++++++++++++ .../qualifiers/fn-inout-array-prohibited.vert<br>
> | 21 ++++++++++++++++++<br>
> .../qualifiers/fn-out-array-prohibited-cstyle.frag | 21<br>
> ++++++++++++++++++<br>
> .../qualifiers/fn-out-array-prohibited-cstyle.vert | 21<br>
> ++++++++++++++++++ .../qualifiers/fn-out-array-prohibited.frag<br>
> | 21 ++++++++++++++++++<br>
> .../qualifiers/fn-out-array-prohibited.vert | 21<br>
> ++++++++++++++++++<br>
> .../assignment-operators/assign-array-allowed.frag | 21<br>
> ++++++++++++++++++<br>
> .../assignment-operators/assign-array-allowed.vert | 21<br>
> ++++++++++++++++++ .../assign-builtin-array-allowed.vert<br>
> | 21 ++++++++++++++++++<br>
> .../qualifiers/fn-inout-array-allowed-cstyle.frag | 23<br>
> ++++++++++++++++++++<br>
> .../qualifiers/fn-inout-array-allowed-cstyle.vert | 23<br>
> ++++++++++++++++++++ .../qualifiers/fn-inout-array-allowed.frag<br>
> | 23 ++++++++++++++++++++<br>
> .../qualifiers/fn-inout-array-allowed.vert | 23<br>
> ++++++++++++++++++++<br>
> .../qualifiers/fn-out-array-allowed-cstyle.frag | 23<br>
> ++++++++++++++++++++<br>
> .../qualifiers/fn-out-array-allowed-cstyle.vert | 23<br>
> ++++++++++++++++++++<br>
> .../compiler/qualifiers/fn-out-array-allowed.frag | 23<br>
> ++++++++++++++++++++<br>
> .../compiler/qualifiers/fn-out-array-allowed.vert | 23<br>
> ++++++++++++++++++++ 21 files changed, 453 insertions(+), 0<br>
> deletions(-) create mode 100644<br>
> tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
> create mode 100644<br>
> tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
> create mode 100644<br>
> tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
> create mode 100644<br>
> tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
> create mode 100644<br>
> tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
> create mode 100644<br>
> tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
> create mode 100644<br>
> tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
> create mode 100644<br>
> tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
> create mode 100644<br>
> tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
> create mode 100644<br>
> tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
><br>
><br>
create mode 100644<br>
tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
> create mode 100644<br>
> tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
><br>
> diff --git<br>
> a/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..086b574 --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag<br>
><br>
><br>
@@ -0,0 +1,19 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that assignment to an array is illegal<br>
> in GLSL 1.10. +// +// From section 5.8 of the GLSL 1.10 spec: +//<br>
> Other binary or unary expressions, non-dereferenced arrays, +//<br>
> function names, swizzles with repeated fields, and constants +//<br>
> 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't realize that. (...checks spec...) You're right. I'll remove the bogus tests glsl-1.10/compiler/qualifiers/fn-{inout,out}-array-prohibited.{frag,vert}, and I'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>
> +{ + float[2] y; + y = x; +} diff --git<br>
<div><div></div><div class="h5">> a/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..086b574 --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert<br>
><br>
><br>
@@ -0,0 +1,19 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that assignment to an array is illegal<br>
> in GLSL 1.10. +// +// From section 5.8 of the GLSL 1.10 spec: +//<br>
> Other binary or unary expressions, non-dereferenced arrays, +//<br>
> function names, swizzles with repeated fields, and constants +//<br>
> cannot be l-values. + +#version 110 + +void f(float[2] x) +{ +<br>
> float[2] y; + y = x; +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..a56d197 --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
> the array is declared using C-style array +// declaration syntax<br>
> (float x[2] as opposed to float[2] x). +// +// From section 5.8 of<br>
> the GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(inout float x[2]) +{ +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..a56d197 --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
> the array is declared using C-style array +// declaration syntax<br>
> (float x[2] as opposed to float[2] x). +// +// From section 5.8 of<br>
> the GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(inout float x[2]) +{ +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..a2836e2 --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
> the array is declared using GLSL-style array +// declaration syntax<br>
> (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
> the GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(inout float[2] x) +{ +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..a2836e2 --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function inout parameter in +// GLSL 1.10. +// +// In this test,<br>
> the array is declared using GLSL-style array +// declaration syntax<br>
> (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
> the GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(inout float[2] x) +{ +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..d9a8f8a --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
> array is declared using C-style array +// declaration syntax (float<br>
> x[2] as opposed to float[2] x). +// +// From section 5.8 of the<br>
> GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(out float x[2]) +{ +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..d9a8f8a --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
> array is declared using C-style array +// declaration syntax (float<br>
> x[2] as opposed to float[2] x). +// +// From section 5.8 of the<br>
> GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(out float x[2]) +{ +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..43cb43e --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
> array is declared using GLSL-style array +// declaration syntax<br>
> (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
> the GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(out float[2] x) +{ +} diff --git<br>
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..43cb43e --- /dev/null +++<br>
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: fail +// glsl_version: 1.10 +//<br>
> [end config] +// +// Check that an array can't be used as a<br>
> function out parameter in +// GLSL 1.10. +// +// In this test, the<br>
> array is declared using GLSL-style array +// declaration syntax<br>
> (float[2] x as opposed to float x[2]). +// +// From section 5.8 of<br>
> the GLSL 1.10 spec: +// Other binary or unary expressions,<br>
> non-dereferenced arrays, +// function names, swizzles with<br>
> repeated fields, and constants +// cannot be l-values. +<br>
> +#version 110 + +void f(out float[2] x) +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..7b65d4b --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that assignment to an array is allowed<br>
> in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20 spec: +//<br>
> Variables that are built-in types, entire structures or arrays, +//<br>
> structure fields, l-values with the field selector ( . ) +//<br>
> applied to select components or swizzles without repeated +//<br>
> fields, l-values within parentheses, and l-values dereferenced +//<br>
> with the array subscript operator ( [] ) are all l-values. +<br>
> +#version 120 + +void f(float[2] x) +{ + float[2] y; + y = x; +}<br>
> diff --git<br>
> a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..7b65d4b --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that assignment to an array is allowed<br>
> in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20 spec: +//<br>
> Variables that are built-in types, entire structures or arrays, +//<br>
> structure fields, l-values with the field selector ( . ) +//<br>
> applied to select components or swizzles without repeated +//<br>
> fields, l-values within parentheses, and l-values dereferenced +//<br>
> with the array subscript operator ( [] ) are all l-values. +<br>
> +#version 120 + +void f(float[2] x) +{ + float[2] y; + y = x; +}<br>
> diff --git<br>
> a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..0daf6e0 --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert<br>
><br>
><br>
@@ -0,0 +1,21 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that bulk assignment to a built-in array<br>
> is allowed in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20<br>
> spec: +// Variables that are built-in types, entire structures<br>
> or arrays, +// structure fields, l-values with the field<br>
> selector ( . ) +// applied to select components or swizzles<br>
> without repeated +// fields, l-values within parentheses, and<br>
> l-values dereferenced +// with the array subscript operator (<br>
> [] ) are all l-values. + +#version 120 +varying vec4<br>
> gl_TexCoord[gl_MaxTextureCoords]; + +void<br>
> 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'll also add "check_link: true" to these tests so that if they don'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>
> diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..aebc81a --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
> is declared using C-style array +// declaration syntax (float x[2]<br>
> as opposed to float[2] x). +// +// From section 5.8 of the GLSL<br>
> 1.20 spec: +// Variables that are built-in types, entire<br>
> structures or arrays, +// structure fields, l-values with the<br>
> field selector ( . ) +// applied to select components or<br>
> swizzles without repeated +// fields, l-values within<br>
> parentheses, and l-values dereferenced +// with the array<br>
> subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
> f(inout float x[2]) +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..aebc81a --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
> is declared using C-style array +// declaration syntax (float x[2]<br>
> as opposed to float[2] x). +// +// From section 5.8 of the GLSL<br>
> 1.20 spec: +// Variables that are built-in types, entire<br>
> structures or arrays, +// structure fields, l-values with the<br>
> field selector ( . ) +// applied to select components or<br>
> swizzles without repeated +// fields, l-values within<br>
> parentheses, and l-values dereferenced +// with the array<br>
> subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
> f(inout float x[2]) +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..0d4b8c0 --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
> is declared using GLSL-style array +// declaration syntax (float[2]<br>
> x as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
> 1.20 spec: +// Variables that are built-in types, entire<br>
> structures or arrays, +// structure fields, l-values with the<br>
> field selector ( . ) +// applied to select components or<br>
> swizzles without repeated +// fields, l-values within<br>
> parentheses, and l-values dereferenced +// with the array<br>
> subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
> f(inout float[2] x) +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..0d4b8c0 --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> inout parameter in +// GLSL 1.20. +// +// In this test, the array<br>
> is declared using GLSL-style array +// declaration syntax (float[2]<br>
> x as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
> 1.20 spec: +// Variables that are built-in types, entire<br>
> structures or arrays, +// structure fields, l-values with the<br>
> field selector ( . ) +// applied to select components or<br>
> swizzles without repeated +// fields, l-values within<br>
> parentheses, and l-values dereferenced +// with the array<br>
> subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
> f(inout float[2] x) +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..d3792a4 --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
> declared using C-style array +// declaration syntax (float x[2] as<br>
> opposed to float[2] x). +// +// From section 5.8 of the GLSL 1.20<br>
> spec: +// Variables that are built-in types, entire structures<br>
> or arrays, +// structure fields, l-values with the field<br>
> selector ( . ) +// applied to select components or swizzles<br>
> without repeated +// fields, l-values within parentheses, and<br>
> l-values dereferenced +// with the array subscript operator (<br>
> [] ) are all l-values. + +#version 120 + +void f(out float x[2])<br>
> +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..d3792a4 --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
> declared using C-style array +// declaration syntax (float x[2] as<br>
> opposed to float[2] x). +// +// From section 5.8 of the GLSL 1.20<br>
> spec: +// Variables that are built-in types, entire structures<br>
> or arrays, +// structure fields, l-values with the field<br>
> selector ( . ) +// applied to select components or swizzles<br>
> without repeated +// fields, l-values within parentheses, and<br>
> l-values dereferenced +// with the array subscript operator (<br>
> [] ) are all l-values. + +#version 120 + +void f(out float x[2])<br>
> +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..9351ba9 --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
> declared using GLSL-style array +// declaration syntax (float[2] x<br>
> as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
> 1.20 spec: +// Variables that are built-in types, entire<br>
> structures or arrays, +// structure fields, l-values with the<br>
> field selector ( . ) +// applied to select components or<br>
> swizzles without repeated +// fields, l-values within<br>
> parentheses, and l-values dereferenced +// with the array<br>
> subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
> f(out float[2] x) +{ +} diff --git<br>
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
><br>
><br>
new file mode 100644<br>
> index 0000000..9351ba9 --- /dev/null +++<br>
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert<br>
><br>
><br>
@@ -0,0 +1,23 @@<br>
> +// [config] +// expect_result: pass +// glsl_version: 1.20 +//<br>
> [end config] +// +// Check that an array can be used as a function<br>
> out parameter in +// GLSL 1.20. +// +// In this test, the array is<br>
> declared using GLSL-style array +// declaration syntax (float[2] x<br>
> as opposed to float x[2]). +// +// From section 5.8 of the GLSL<br>
> 1.20 spec: +// Variables that are built-in types, entire<br>
> structures or arrays, +// structure fields, l-values with the<br>
> field selector ( . ) +// applied to select components or<br>
> swizzles without repeated +// fields, l-values within<br>
> parentheses, and l-values dereferenced +// with the array<br>
> subscript operator ( [] ) are all l-values. + +#version 120 + +void<br>
> 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'll submit a "v2" patch once I've made all these corrections.<br>