[Piglit] [PULL] Test many types of non-constant indexing in GLSL

Chad Versace chad at chad-versace.us
Fri Jul 22 16:31:34 PDT 2011

On 07/18/2011 01:55 PM, Ian Romanick wrote:
> I have just posted a branch in my personal piglit repo that adds 648 new
> shader_runner tests.  These add tests for a number of cases for
> non-constant indexing of matrices and arrays of matrices.  All types of
> square matrices are hit.  Almost all types of storage (temporary,
> uniform, and varying) are hit.  Every (?) combination of single and
> multiple indirection are hit.
>     git://people.freedesktop.org/~idr/piglit.git variable-indexing
> There are separate paths for GLSL 1.10 and 1.20.  The paths differ
> because the 1.20 paths:
>   - Use the 'matNxN' names.
>   - Initialize uniforms in the shaders.
>   - Use array constructors to initialize arrays
> Somewhat to my surprise, this has triggered a different set of bugs.
> Currently the i965 driver (7.11 branch) passes 492/648.  A number of
> tests assert (1.10 path) or segfault (1.20 path).  I have a separate
> patch bomb that I am going to drop on mesa-dev later today that fixes
> all of these test cases for swrast and most of them in the i965 driver.
> For reference I have posted the piglit results for swrast (with and
> without my fixes), i965 (with and without my fixes), fglrx, and NVIDIA.
>     http://people.freedesktop.org/~idr/variable-indexing-results/
> Even with all of these tests, there are a lot of things that are not
> tested but should be:
>   - Non-square matrices.
>   - Multiple non-constant accesses to the same array / matrix with
> different indices as r-values.
>   - Non-constant accesses to the same array in the LHS and RHS using
> different indices.
>   - Non-constant accesses to different arrays in the LHS and RHS using
> the same index variable (but perhaps different values a[i] = b[i+1]).
>   - Non-constant accesses to arrays as function parameters.
>   - Function parameter as an additional type of storage.
>   - Vertex shader input as an additional type of storage.  Shader_runner
> cannot currently handle this.  Arrays of matrices as vertex shader
> inputs also require GLSL 1.30.
>   - Fragment shader output as an additional type of storage.  Arrays of
> matrices as fragment shader outputs are not supported in GLSL, but
> arrays of other types are.
>   - Arrays of vectors.
>   - Arrays of scalars.
>   - Arrays of structures.
>   - Structures containing arrays.
>   - Structures containing matrices.
>   - Structures containing arrays of matrices.
>   - Arrays of structures containing arrays.
>   - Arrays of structures containing matrices.
>   - Arrays of structures containing arrays of matrices.
>   - Arrays of structures containing structures containing arrays...
>   - moar!

So many tests! I can't review them all, but I did review a subset:

I've verified that the *-rd tests are correct. As for the vs-*-wr test, I've verified that the logic is sound, and have faith that your calculator is correct.

A review-by is difficult to give, since variable-index-rd.sh is so opaque. But, I assume that the unreviewed tests are well represented by the sample set I chose and this is
Reviewed-by: Chad Versace <chad at chad-versace.us>

Arrays of structs of structs of arrays! Before embarking on creating moar! tests, we should probably design a python library that generates GLSL.

Chad Versace
chad at chad-versace.us

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20110722/8dc74819/attachment.pgp>

More information about the Piglit mailing list