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

Ian Romanick idr at freedesktop.org
Tue Sep 13 08:15:40 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/12/2011 06:23 PM, Brian Paul wrote:
> On Mon, Sep 12, 2011 at 5:12 PM, Paul Berry
> <stereotype441 at gmail.com> 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.
> 
> So you're saying this is illegal:
> 
> #version 110 void zero_array(out float array[5]) { int i; for
> (i=0;i<5;i++) array[i] = 0.0; }
> 
> It compiles with NVIDIA's driver, FWIW.

NVIDIA's driver is notorious for compiling lots of invalid code.
Based on our reading of the GLSL 1.10 spec, this should be illegal.
What do Apple of AMD do?  The new GLSL compiler has never allowed
this.  However, what we used to do is generate an error when you call
the function (because the array is not an l-value) instead of when you
declare the (uncallable) function.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5vc5wACgkQX1gOwKyEAw8/MQCgjM50z+j2vHHLmfwrJpoDruz2
QrAAoISt8MRgbqCYwJ3CexdGX6KoHRjt
=eF0i
-----END PGP SIGNATURE-----


More information about the Piglit mailing list