On Fri, Apr 26, 2013 at 1:19 PM, Fabian Bieler <[email protected]> wrote:
> The GLSL 1.2 spec says: "Arrays can also [be] accessed with the method 
> operator
> ( . ) and the length method to query the size of the array:".
>
> It doesn't say that members of arrays of structs can be accessed with the 
> method
> operator even if the dereference is only used to access the length method of a
> nested array.
> ---
>  .../structure-and-array-operations/array-of-struct-of-array.vert        | 2 
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git 
> a/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-struct-of-array.vert
>  
> b/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-struct-of-array.vert
> index fe11271..a8a714a 100644
> --- 
> a/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-struct-of-array.vert
> +++ 
> b/tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-struct-of-array.vert
> @@ -23,5 +23,5 @@ struct s {
>  void main()
>  {
>    s a[2];
> -  gl_Position = vec4(a.length() + a.x.length());
> +  gl_Position = vec4(a.length() + a[0].x.length());
>  }
> --
> 1.8.1.2

Presumably this test passed in the past, but a.x looks clearly wrong.
The compiler generates this message now:

0:26(37): error: Cannot access field `x' of non-structure / non-vector."

Reviewed-by: Matt Turner <[email protected]>
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to