[Piglit] [PATCH 1/2] Test that varyings can't be bools or structs

Ian Romanick idr at freedesktop.org
Wed Dec 19 11:49:22 PST 2012


On 12/19/2012 08:30 AM, Paul Berry wrote:

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

Now for the bad news...

In GLSL ES 3.00 and GLSL 1.50 this language changes to:

     "They can only be float, floating-point vectors, matrices,
     signed or unsigned integers or integer vectors, or arrays
     or structures of any these"

We should add at least GLSL ES 3.00 tests for structures. :(  I know 
that Mesa will fail these tests currently.

> ---
>   .../qualifiers/varying-bool-prohibited.frag        | 20 +++++++++++++++++++
>   .../qualifiers/varying-bool-prohibited.vert        | 21 ++++++++++++++++++++
>   .../qualifiers/varying-bvec2-prohibited.frag       | 20 +++++++++++++++++++
>   .../qualifiers/varying-bvec2-prohibited.vert       | 21 ++++++++++++++++++++
>   .../qualifiers/varying-bvec3-prohibited.frag       | 20 +++++++++++++++++++
>   .../qualifiers/varying-bvec3-prohibited.vert       | 21 ++++++++++++++++++++
>   .../qualifiers/varying-bvec4-prohibited.frag       | 20 +++++++++++++++++++
>   .../qualifiers/varying-bvec4-prohibited.vert       | 21 ++++++++++++++++++++
>   .../qualifiers/varying-struct-prohibited.frag      | 21 ++++++++++++++++++++
>   .../qualifiers/varying-struct-prohibited.vert      | 22 +++++++++++++++++++++
>   .../compiler/qualifiers/in-bool-prohibited.frag    | 20 +++++++++++++++++++
>   .../compiler/qualifiers/in-bvec2-prohibited.frag   | 20 +++++++++++++++++++
>   .../compiler/qualifiers/in-bvec3-prohibited.frag   | 20 +++++++++++++++++++
>   .../compiler/qualifiers/in-bvec4-prohibited.frag   | 20 +++++++++++++++++++
>   .../compiler/qualifiers/in-struct-prohibited.frag  | 21 ++++++++++++++++++++
>   .../compiler/qualifiers/out-bool-prohibited.vert   | 22 +++++++++++++++++++++
>   .../compiler/qualifiers/out-bvec2-prohibited.vert  | 22 +++++++++++++++++++++
>   .../compiler/qualifiers/out-bvec3-prohibited.vert  | 22 +++++++++++++++++++++
>   .../compiler/qualifiers/out-bvec4-prohibited.vert  | 22 +++++++++++++++++++++
>   .../compiler/qualifiers/out-struct-prohibited.vert | 23 ++++++++++++++++++++++
>   20 files changed, 419 insertions(+)
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/in-bool-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/in-bvec2-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/in-bvec3-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/in-bvec4-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/in-struct-prohibited.frag
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/out-bool-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/out-bvec2-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/out-bvec3-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/out-bvec4-prohibited.vert
>   create mode 100644 tests/spec/glsl-1.30/compiler/qualifiers/out-struct-prohibited.vert
>
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.frag b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.frag
> new file mode 100644
> index 0000000..665c4a0
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bool can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bool foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo, 0.0, 0.0, 0.0);
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.vert b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.vert
> new file mode 100644
> index 0000000..34e5fde
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bool-prohibited.vert
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bool can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bool foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = true;
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.frag b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.frag
> new file mode 100644
> index 0000000..9833632
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bvec2 can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bvec2 foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo, 0.0, 0.0);
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.vert b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.vert
> new file mode 100644
> index 0000000..3560825
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec2-prohibited.vert
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bvec2 can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bvec2 foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = bvec2(true, false);
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.frag b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.frag
> new file mode 100644
> index 0000000..7835939
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bvec3 can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bvec3 foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo, 0.0);
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.vert b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.vert
> new file mode 100644
> index 0000000..de48f40
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec3-prohibited.vert
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bvec3 can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bvec3 foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = bvec3(true, false, true);
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.frag b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.frag
> new file mode 100644
> index 0000000..5ab3ad2
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bvec4 can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bvec4 foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo);
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.vert b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.vert
> new file mode 100644
> index 0000000..0306d38
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-bvec4-prohibited.vert
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a bvec4 can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +varying bvec4 foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = bvec4(true, false, true, false);
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.frag b/tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.frag
> new file mode 100644
> index 0000000..9724195
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.frag
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a struct can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +struct S { vec4 v; };
> +varying S foo;
> +
> +void main()
> +{
> +  gl_FragColor = foo.v;
> +}
> diff --git a/tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.vert b/tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.vert
> new file mode 100644
> index 0000000..822995d
> --- /dev/null
> +++ b/tests/spec/glsl-1.10/compiler/qualifiers/varying-struct-prohibited.vert
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.10
> +// [end config]
> +//
> +// Check that a struct can't be used as a varying in GLSL 1.10.
> +//
> +// From section 4.3.6 ("Varying") of the GLSL 1.10 spec:
> +//     The varying qualifier can be used only with the data types
> +//     float, vec2, vec3, vec4, mat2, mat3, and mat4, or arrays of
> +//     these. Structures cannot be varying.
> +
> +#version 110
> +
> +struct S { vec4 v; };
> +varying S foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo.v = vec4(0.0);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/in-bool-prohibited.frag b/tests/spec/glsl-1.30/compiler/qualifiers/in-bool-prohibited.frag
> new file mode 100644
> index 0000000..647b365
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/in-bool-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bool can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.4 ("Inputs") of the GLSL 1.30 spec:
> +//     Fragment inputs can only be signed and unsigned integers and
> +//     integer vectors, float, floating-point vectors, matrices, or
> +//     arrays of these.  Structures cannot be input.
> +
> +#version 130
> +
> +flat in bool foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo, 0.0, 0.0, 0.0);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec2-prohibited.frag b/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec2-prohibited.frag
> new file mode 100644
> index 0000000..622c025
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec2-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bvec2 can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.4 ("Inputs") of the GLSL 1.30 spec:
> +//     Fragment inputs can only be signed and unsigned integers and
> +//     integer vectors, float, floating-point vectors, matrices, or
> +//     arrays of these.  Structures cannot be input.
> +
> +#version 130
> +
> +flat in bvec2 foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo, 0.0, 0.0);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec3-prohibited.frag b/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec3-prohibited.frag
> new file mode 100644
> index 0000000..2cd8534
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec3-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bvec3 can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.4 ("Inputs") of the GLSL 1.30 spec:
> +//     Fragment inputs can only be signed and unsigned integers and
> +//     integer vectors, float, floating-point vectors, matrices, or
> +//     arrays of these.  Structures cannot be input.
> +
> +#version 130
> +
> +flat in bvec3 foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo, 0.0);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec4-prohibited.frag b/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec4-prohibited.frag
> new file mode 100644
> index 0000000..d9d8bd6
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/in-bvec4-prohibited.frag
> @@ -0,0 +1,20 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bvec4 can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.4 ("Inputs") of the GLSL 1.30 spec:
> +//     Fragment inputs can only be signed and unsigned integers and
> +//     integer vectors, float, floating-point vectors, matrices, or
> +//     arrays of these.  Structures cannot be input.
> +
> +#version 130
> +
> +flat in bvec4 foo;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(foo);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/in-struct-prohibited.frag b/tests/spec/glsl-1.30/compiler/qualifiers/in-struct-prohibited.frag
> new file mode 100644
> index 0000000..6a41fdf
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/in-struct-prohibited.frag
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a struct can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.4 ("Inputs") of the GLSL 1.30 spec:
> +//     Fragment inputs can only be signed and unsigned integers and
> +//     integer vectors, float, floating-point vectors, matrices, or
> +//     arrays of these.  Structures cannot be input.
> +
> +#version 130
> +
> +struct S { vec4 v; };
> +in S foo;
> +
> +void main()
> +{
> +  gl_FragColor = foo.v;
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/out-bool-prohibited.vert b/tests/spec/glsl-1.30/compiler/qualifiers/out-bool-prohibited.vert
> new file mode 100644
> index 0000000..605de9f
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/out-bool-prohibited.vert
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bool can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.6 ("Outputs") of the GLSL 1.30 spec:
> +//     Vertex output variables ... can only be float, floating-point
> +//     vectors, matrices, signed or unsigned integers or integer
> +//     vectors, or arrays of any these. ... Structures cannot be
> +//     output.
> +
> +#version 130
> +
> +flat out bool foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = true;
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec2-prohibited.vert b/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec2-prohibited.vert
> new file mode 100644
> index 0000000..4b03107
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec2-prohibited.vert
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bvec2 can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.6 ("Outputs") of the GLSL 1.30 spec:
> +//     Vertex output variables ... can only be float, floating-point
> +//     vectors, matrices, signed or unsigned integers or integer
> +//     vectors, or arrays of any these. ... Structures cannot be
> +//     output.
> +
> +#version 130
> +
> +flat out bvec2 foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = bvec2(true, false);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec3-prohibited.vert b/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec3-prohibited.vert
> new file mode 100644
> index 0000000..9618aca
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec3-prohibited.vert
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bvec3 can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.6 ("Outputs") of the GLSL 1.30 spec:
> +//     Vertex output variables ... can only be float, floating-point
> +//     vectors, matrices, signed or unsigned integers or integer
> +//     vectors, or arrays of any these. ... Structures cannot be
> +//     output.
> +
> +#version 130
> +
> +flat out bvec3 foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = bvec3(true, false, true);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec4-prohibited.vert b/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec4-prohibited.vert
> new file mode 100644
> index 0000000..a1f6ffa
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/out-bvec4-prohibited.vert
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a bvec4 can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.6 ("Outputs") of the GLSL 1.30 spec:
> +//     Vertex output variables ... can only be float, floating-point
> +//     vectors, matrices, signed or unsigned integers or integer
> +//     vectors, or arrays of any these. ... Structures cannot be
> +//     output.
> +
> +#version 130
> +
> +flat out bvec4 foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo = bvec4(true, false, true, false);
> +}
> diff --git a/tests/spec/glsl-1.30/compiler/qualifiers/out-struct-prohibited.vert b/tests/spec/glsl-1.30/compiler/qualifiers/out-struct-prohibited.vert
> new file mode 100644
> index 0000000..ced9024
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/compiler/qualifiers/out-struct-prohibited.vert
> @@ -0,0 +1,23 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.30
> +// [end config]
> +//
> +// Check that a struct can't be used as a varying in GLSL 1.30.
> +//
> +// From section 4.3.6 ("Outputs") of the GLSL 1.30 spec:
> +//     Vertex output variables ... can only be float, floating-point
> +//     vectors, matrices, signed or unsigned integers or integer
> +//     vectors, or arrays of any these. ... Structures cannot be
> +//     output.
> +
> +#version 130
> +
> +struct S { vec4 v; };
> +out S foo;
> +
> +void main()
> +{
> +  gl_Position = vec4(0.0);
> +  foo.v = vec4(0.0);
> +}
>



More information about the Piglit mailing list