[Piglit] [PATCH] Add tests of whole-array assignment and out/inout params.

Paul Berry stereotype441 at gmail.com
Tue Sep 13 09:54:11 PDT 2011


On 13 September 2011 08:23, Ian Romanick <idr at freedesktop.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 09/12/2011 06:12 PM, Paul Berry wrote:
> > In GLSL 1.10, whole arrays are not lvalues (even though their
> > elements are).  This means it is illegal to use an array on the
> > left hand side of an assigment, or to use it as an out or inout
> > parameter of a function.
> >
> > In GLSL 1.20 and later versions, an array is a proper lvalue, so
> > all of these uses are allowed.
> >
> > This patch adds tests to verify that all the above usages are
> > prohibited in GLSL 1.10 and allowed in GLSL 1.20.  In addition it
> > verifies that in GLSL 1.20, a built-in array may be used as an
> > lvalue (since this currently exercises a different code path in
> > Mesa).
>
> There are a few comments below.
>
> Since the GLSL ES 1.00 behavior is different from both GLSL 1.10 and
> GLSL 1.20, we should have tests for that as well.
>

Yes, good point.  I'll add some more tests.  Two quick questions before I
do:

- 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"?
- 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".


>
> > --- .../assign-array-prohibited.frag                   |   19
> > ++++++++++++++++ .../assign-array-prohibited.vert
> > |   19 ++++++++++++++++ .../fn-inout-array-prohibited-cstyle.frag
> > |   21 ++++++++++++++++++ .../fn-inout-array-prohibited-cstyle.vert
> > |   21 ++++++++++++++++++
> > .../qualifiers/fn-inout-array-prohibited.frag      |   21
> > ++++++++++++++++++ .../qualifiers/fn-inout-array-prohibited.vert
> > |   21 ++++++++++++++++++
> > .../qualifiers/fn-out-array-prohibited-cstyle.frag |   21
> > ++++++++++++++++++
> > .../qualifiers/fn-out-array-prohibited-cstyle.vert |   21
> > ++++++++++++++++++ .../qualifiers/fn-out-array-prohibited.frag
> > |   21 ++++++++++++++++++
> > .../qualifiers/fn-out-array-prohibited.vert        |   21
> > ++++++++++++++++++
> > .../assignment-operators/assign-array-allowed.frag |   21
> > ++++++++++++++++++
> > .../assignment-operators/assign-array-allowed.vert |   21
> > ++++++++++++++++++ .../assign-builtin-array-allowed.vert
> > |   21 ++++++++++++++++++
> > .../qualifiers/fn-inout-array-allowed-cstyle.frag  |   23
> > ++++++++++++++++++++
> > .../qualifiers/fn-inout-array-allowed-cstyle.vert  |   23
> > ++++++++++++++++++++ .../qualifiers/fn-inout-array-allowed.frag
> > |   23 ++++++++++++++++++++
> > .../qualifiers/fn-inout-array-allowed.vert         |   23
> > ++++++++++++++++++++
> > .../qualifiers/fn-out-array-allowed-cstyle.frag    |   23
> > ++++++++++++++++++++
> > .../qualifiers/fn-out-array-allowed-cstyle.vert    |   23
> > ++++++++++++++++++++
> > .../compiler/qualifiers/fn-out-array-allowed.frag  |   23
> > ++++++++++++++++++++
> > .../compiler/qualifiers/fn-out-array-allowed.vert  |   23
> > ++++++++++++++++++++ 21 files changed, 453 insertions(+), 0
> > deletions(-) create mode 100644
> >
> tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag
> >
> >
> create mode 100644
>
> tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert
> > create mode 100644
> >
> tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag
> >
> >
> create mode 100644
>
> tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert
> > create mode 100644
> > tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag
> >
> >
> create mode 100644
> tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert
> > create mode 100644
> >
> tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag
> >
> >
> create mode 100644
>
> tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert
> > create mode 100644
> > tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag
> >
> >
> create mode 100644
> tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert
> > create mode 100644
> >
> tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag
> >
> >
> create mode 100644
>
> tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert
> > create mode 100644
> >
> tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert
> >
> >
> create mode 100644
> tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
> > create mode 100644
> >
> tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
> >
> >
> create mode 100644
> tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag
> > create mode 100644
> > tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert
> >
> >
> create mode 100644
> tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
> > create mode 100644
> > tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
> >
> >
> create mode 100644
> tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag
> > create mode 100644
> > tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert
> >
> > diff --git
> >
> a/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag
> >
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag
> >
> >
> new file mode 100644
> > index 0000000..086b574 --- /dev/null +++
> >
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.frag
> >
> >
> @@ -0,0 +1,19 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that assignment to an array is illegal
> > in GLSL 1.10. +// +// From section 5.8 of the GLSL 1.10 spec: +//
> > Other binary or unary expressions, non-dereferenced arrays, +//
> > function names, swizzles with repeated fields, and constants +//
> > cannot be l-values. + +#version 110 + +void f(float[2] x)
>
> This array declaration syntax is not legal in GLSL 1.10.  It was added
> in GLSL 1.20.
>

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.


>
> > +{ +  float[2] y; +  y = x; +} diff --git
> >
> a/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert
> >
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert
> >
> >
> new file mode 100644
> > index 0000000..086b574 --- /dev/null +++
> >
> b/tests/spec/glsl-1.10/compiler/assignment-operators/assign-array-prohibited.vert
> >
> >
> @@ -0,0 +1,19 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that assignment to an array is illegal
> > in GLSL 1.10. +// +// From section 5.8 of the GLSL 1.10 spec: +//
> > Other binary or unary expressions, non-dereferenced arrays, +//
> > function names, swizzles with repeated fields, and constants +//
> > cannot be l-values. + +#version 110 + +void f(float[2] x) +{ +
> > float[2] y; +  y = x; +} diff --git
> >
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag
> >
> >
> new file mode 100644
> > index 0000000..a56d197 --- /dev/null +++
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.frag
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function inout parameter in +// GLSL 1.10. +// +// In this test,
> > the array is declared using C-style array +// declaration syntax
> > (float x[2] as opposed to float[2] x). +// +// From section 5.8 of
> > the GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(inout float x[2]) +{ +} diff --git
> >
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert
> >
> >
> new file mode 100644
> > index 0000000..a56d197 --- /dev/null +++
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited-cstyle.vert
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function inout parameter in +// GLSL 1.10. +// +// In this test,
> > the array is declared using C-style array +// declaration syntax
> > (float x[2] as opposed to float[2] x). +// +// From section 5.8 of
> > the GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(inout float x[2]) +{ +} diff --git
> > a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag
> >
> >
> new file mode 100644
> > index 0000000..a2836e2 --- /dev/null +++
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.frag
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function inout parameter in +// GLSL 1.10. +// +// In this test,
> > the array is declared using GLSL-style array +// declaration syntax
> > (float[2] x as opposed to float x[2]). +// +// From section 5.8 of
> > the GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(inout float[2] x) +{ +} diff --git
> > a/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert
> >
> >
> new file mode 100644
> > index 0000000..a2836e2 --- /dev/null +++
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-inout-array-prohibited.vert
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function inout parameter in +// GLSL 1.10. +// +// In this test,
> > the array is declared using GLSL-style array +// declaration syntax
> > (float[2] x as opposed to float x[2]). +// +// From section 5.8 of
> > the GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(inout float[2] x) +{ +} diff --git
> >
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag
> >
> >
> new file mode 100644
> > index 0000000..d9a8f8a --- /dev/null +++
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.frag
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function out parameter in +// GLSL 1.10. +// +// In this test, the
> > array is declared using C-style array +// declaration syntax (float
> > x[2] as opposed to float[2] x). +// +// From section 5.8 of the
> > GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(out float x[2]) +{ +} diff --git
> >
> a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert
> >
> >
> new file mode 100644
> > index 0000000..d9a8f8a --- /dev/null +++
> >
> b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited-cstyle.vert
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function out parameter in +// GLSL 1.10. +// +// In this test, the
> > array is declared using C-style array +// declaration syntax (float
> > x[2] as opposed to float[2] x). +// +// From section 5.8 of the
> > GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(out float x[2]) +{ +} diff --git
> > a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag
> >
> >
> new file mode 100644
> > index 0000000..43cb43e --- /dev/null +++
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.frag
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function out parameter in +// GLSL 1.10. +// +// In this test, the
> > array is declared using GLSL-style array +// declaration syntax
> > (float[2] x as opposed to float x[2]). +// +// From section 5.8 of
> > the GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(out float[2] x) +{ +} diff --git
> > a/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert
> >
> >
> new file mode 100644
> > index 0000000..43cb43e --- /dev/null +++
> > b/tests/spec/glsl-1.10/compiler/qualifiers/fn-out-array-prohibited.vert
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: fail +// glsl_version: 1.10 +//
> > [end config] +// +// Check that an array can't be used as a
> > function out parameter in +// GLSL 1.10. +// +// In this test, the
> > array is declared using GLSL-style array +// declaration syntax
> > (float[2] x as opposed to float x[2]). +// +// From section 5.8 of
> > the GLSL 1.10 spec: +//     Other binary or unary expressions,
> > non-dereferenced arrays, +//     function names, swizzles with
> > repeated fields, and constants +//     cannot be l-values. +
> > +#version 110 + +void f(out float[2] x) +{ +} diff --git
> >
> a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag
> >
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag
> >
> >
> new file mode 100644
> > index 0000000..7b65d4b --- /dev/null +++
> >
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.frag
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that assignment to an array is allowed
> > in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20 spec: +//
> > Variables that are built-in types, entire structures or arrays, +//
> > structure fields, l-values with the field selector ( . ) +//
> > applied to select components or swizzles without repeated +//
> > fields, l-values within parentheses, and l-values dereferenced +//
> > with the array subscript operator ( [] ) are all l-values. +
> > +#version 120 + +void f(float[2] x) +{ +  float[2] y; +  y = x; +}
> > diff --git
> >
> a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert
> >
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert
> >
> >
> new file mode 100644
> > index 0000000..7b65d4b --- /dev/null +++
> >
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-array-allowed.vert
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that assignment to an array is allowed
> > in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20 spec: +//
> > Variables that are built-in types, entire structures or arrays, +//
> > structure fields, l-values with the field selector ( . ) +//
> > applied to select components or swizzles without repeated +//
> > fields, l-values within parentheses, and l-values dereferenced +//
> > with the array subscript operator ( [] ) are all l-values. +
> > +#version 120 + +void f(float[2] x) +{ +  float[2] y; +  y = x; +}
> > diff --git
> >
> a/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert
> >
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert
> >
> >
> new file mode 100644
> > index 0000000..0daf6e0 --- /dev/null +++
> >
> b/tests/spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert
> >
> >
> @@ -0,0 +1,21 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that bulk assignment to a built-in array
> > is allowed in GLSL 1.20. +// +// From section 5.8 of the GLSL 1.20
> > spec: +//     Variables that are built-in types, entire structures
> > or arrays, +//     structure fields, l-values with the field
> > selector ( . ) +//     applied to select components or swizzles
> > without repeated +//     fields, l-values within parentheses, and
> > l-values dereferenced +//     with the array subscript operator (
> > [] ) are all l-values. + +#version 120 +varying vec4
> > gl_TexCoord[gl_MaxTextureCoords]; + +void
> > f(vec4[gl_MaxTextureCoords] x) +{ +  gl_TexCoord = x; +}
>
> glslparsertest tests that are expected to pass should also be
> linkable.  That means they should have a main function and should
> write  gl_Position in the vertex shader.
>

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.


>
> > diff --git
> >
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
> >
> >
> new file mode 100644
> > index 0000000..aebc81a --- /dev/null +++
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.frag
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > inout parameter in +// GLSL 1.20. +// +// In this test, the array
> > is declared using C-style array +// declaration syntax (float x[2]
> > as opposed to float[2] x). +// +// From section 5.8 of the GLSL
> > 1.20 spec: +//     Variables that are built-in types, entire
> > structures or arrays, +//     structure fields, l-values with the
> > field selector ( . ) +//     applied to select components or
> > swizzles without repeated +//     fields, l-values within
> > parentheses, and l-values dereferenced +//     with the array
> > subscript operator ( [] ) are all l-values. + +#version 120 + +void
> > f(inout float x[2]) +{ +} diff --git
> >
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
> >
> >
> new file mode 100644
> > index 0000000..aebc81a --- /dev/null +++
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed-cstyle.vert
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > inout parameter in +// GLSL 1.20. +// +// In this test, the array
> > is declared using C-style array +// declaration syntax (float x[2]
> > as opposed to float[2] x). +// +// From section 5.8 of the GLSL
> > 1.20 spec: +//     Variables that are built-in types, entire
> > structures or arrays, +//     structure fields, l-values with the
> > field selector ( . ) +//     applied to select components or
> > swizzles without repeated +//     fields, l-values within
> > parentheses, and l-values dereferenced +//     with the array
> > subscript operator ( [] ) are all l-values. + +#version 120 + +void
> > f(inout float x[2]) +{ +} diff --git
> > a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag
> >
> >
> new file mode 100644
> > index 0000000..0d4b8c0 --- /dev/null +++
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.frag
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > inout parameter in +// GLSL 1.20. +// +// In this test, the array
> > is declared using GLSL-style array +// declaration syntax (float[2]
> > x as opposed to float x[2]). +// +// From section 5.8 of the GLSL
> > 1.20 spec: +//     Variables that are built-in types, entire
> > structures or arrays, +//     structure fields, l-values with the
> > field selector ( . ) +//     applied to select components or
> > swizzles without repeated +//     fields, l-values within
> > parentheses, and l-values dereferenced +//     with the array
> > subscript operator ( [] ) are all l-values. + +#version 120 + +void
> > f(inout float[2] x) +{ +} diff --git
> > a/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert
> >
> >
> new file mode 100644
> > index 0000000..0d4b8c0 --- /dev/null +++
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-inout-array-allowed.vert
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > inout parameter in +// GLSL 1.20. +// +// In this test, the array
> > is declared using GLSL-style array +// declaration syntax (float[2]
> > x as opposed to float x[2]). +// +// From section 5.8 of the GLSL
> > 1.20 spec: +//     Variables that are built-in types, entire
> > structures or arrays, +//     structure fields, l-values with the
> > field selector ( . ) +//     applied to select components or
> > swizzles without repeated +//     fields, l-values within
> > parentheses, and l-values dereferenced +//     with the array
> > subscript operator ( [] ) are all l-values. + +#version 120 + +void
> > f(inout float[2] x) +{ +} diff --git
> >
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
> >
> >
> new file mode 100644
> > index 0000000..d3792a4 --- /dev/null +++
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.frag
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > out parameter in +// GLSL 1.20. +// +// In this test, the array is
> > declared using C-style array +// declaration syntax (float x[2] as
> > opposed to float[2] x). +// +// From section 5.8 of the GLSL 1.20
> > spec: +//     Variables that are built-in types, entire structures
> > or arrays, +//     structure fields, l-values with the field
> > selector ( . ) +//     applied to select components or swizzles
> > without repeated +//     fields, l-values within parentheses, and
> > l-values dereferenced +//     with the array subscript operator (
> > [] ) are all l-values. + +#version 120 + +void f(out float x[2])
> > +{ +} diff --git
> >
> a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
> >
> >
> new file mode 100644
> > index 0000000..d3792a4 --- /dev/null +++
> >
> b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed-cstyle.vert
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > out parameter in +// GLSL 1.20. +// +// In this test, the array is
> > declared using C-style array +// declaration syntax (float x[2] as
> > opposed to float[2] x). +// +// From section 5.8 of the GLSL 1.20
> > spec: +//     Variables that are built-in types, entire structures
> > or arrays, +//     structure fields, l-values with the field
> > selector ( . ) +//     applied to select components or swizzles
> > without repeated +//     fields, l-values within parentheses, and
> > l-values dereferenced +//     with the array subscript operator (
> > [] ) are all l-values. + +#version 120 + +void f(out float x[2])
> > +{ +} diff --git
> > a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag
> >
> >
> new file mode 100644
> > index 0000000..9351ba9 --- /dev/null +++
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.frag
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > out parameter in +// GLSL 1.20. +// +// In this test, the array is
> > declared using GLSL-style array +// declaration syntax (float[2] x
> > as opposed to float x[2]). +// +// From section 5.8 of the GLSL
> > 1.20 spec: +//     Variables that are built-in types, entire
> > structures or arrays, +//     structure fields, l-values with the
> > field selector ( . ) +//     applied to select components or
> > swizzles without repeated +//     fields, l-values within
> > parentheses, and l-values dereferenced +//     with the array
> > subscript operator ( [] ) are all l-values. + +#version 120 + +void
> > f(out float[2] x) +{ +} diff --git
> > a/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert
> >
> >
> new file mode 100644
> > index 0000000..9351ba9 --- /dev/null +++
> > b/tests/spec/glsl-1.20/compiler/qualifiers/fn-out-array-allowed.vert
> >
> >
> @@ -0,0 +1,23 @@
> > +// [config] +// expect_result: pass +// glsl_version: 1.20 +//
> > [end config] +// +// Check that an array can be used as a function
> > out parameter in +// GLSL 1.20. +// +// In this test, the array is
> > declared using GLSL-style array +// declaration syntax (float[2] x
> > as opposed to float x[2]). +// +// From section 5.8 of the GLSL
> > 1.20 spec: +//     Variables that are built-in types, entire
> > structures or arrays, +//     structure fields, l-values with the
> > field selector ( . ) +//     applied to select components or
> > swizzles without repeated +//     fields, l-values within
> > parentheses, and l-values dereferenced +//     with the array
> > subscript operator ( [] ) are all l-values. + +#version 120 + +void
> > f(out float[2] x) +{ +}
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk5vdVUACgkQX1gOwKyEAw87GgCfW6ad15EAq0IOmds7kBV5aHOR
> 6poAoIcEvQmzabIjDKm32OzRLnvKlOkW
> =AmSj
> -----END PGP SIGNATURE-----
>

Thanks, Ian.  I'll submit a "v2" patch once I've made all these corrections.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20110913/87aa6f46/attachment-0001.htm>


More information about the Piglit mailing list