[Piglit] [PATCH 1/2] GLES3: test that non-flat varying structs cannot contain ints.

Anuj Phogat anuj.phogat at gmail.com
Tue Feb 12 12:34:25 PST 2013


On Mon, Feb 11, 2013 at 4:16 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> ---
>  .../varying-struct-nonflat-int.frag                | 29 ++++++++++++++++++++++
>  .../varying-struct-nonflat-int.vert                | 29 ++++++++++++++++++++++
>  .../varying-struct-nonflat-uint.frag               | 29 ++++++++++++++++++++++
>  .../varying-struct-nonflat-uint.vert               | 29 ++++++++++++++++++++++
>  4 files changed, 116 insertions(+)
>  create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.frag
>  create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.vert
>  create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.frag
>  create mode 100644 tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.vert
>
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.frag b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.frag
> new file mode 100644
> index 0000000..42360c2
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.frag
> @@ -0,0 +1,29 @@
> +/* [config]
> + * expect_result: fail
> + * glsl_version: 3.00
> + * check_link: true
> + * [end config]
> + *
> + * From the GLSL ES 3.00 spec, Section 4.3.4 ("Input Variables"):
> + *
> + *     "Fragment shader inputs that are, or contain, signed or
> + *     unsigned integers or integer vectors must be qualified with the
> + *     interpolation qualifier flat."
> + *
> + * This test verifies that a non-flat varying struct containing
> + * signed integral data is properly flagged as an error.
> + */
> +
> +#version 300 es
> +
> +struct S {
> +       int i;
> +};
> +
> +in S foo;
> +out highp vec4 color;
> +
> +void main()
> +{
> +       color = vec4(foo.i);
> +}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.vert b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.vert
> new file mode 100644
> index 0000000..66af6c7
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.vert
> @@ -0,0 +1,29 @@
> +/* [config]
> + * expect_result: fail
> + * glsl_version: 3.00
> + * check_link: true
> + * [end config]
> + *
> + * From the GLSL ES 3.00 spec, Section 4.3.6 ("Output Variables"):
> + *
> + *     "Vertex shader outputs that are, or contain, signed or unsigned
> + *     integers or integer vectors must be qualified with the
> + *     interpolation qualifier flat."
> + *
> + * This test verifies that a non-flat varying struct containing
> + * signed integral data is properly flagged as an error.
> + */
> +
> +#version 300 es
> +
> +struct S {
> +       int i;
> +};
> +
> +out S foo;
> +
> +void main()
> +{
> +       gl_Position = vec4(0.0);
> +       foo.i = 1;
> +}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.frag b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.frag
> new file mode 100644
> index 0000000..525aaa1
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.frag
> @@ -0,0 +1,29 @@
> +/* [config]
> + * expect_result: fail
> + * glsl_version: 3.00
> + * check_link: true
> + * [end config]
> + *
> + * From the GLSL ES 3.00 spec, Section 4.3.4 ("Input Variables"):
> + *
> + *     "Fragment shader inputs that are, or contain, signed or
> + *     unsigned integers or integer vectors must be qualified with the
> + *     interpolation qualifier flat."
> + *
> + * This test verifies that a non-flat varying struct containing
> + * unsigned integral data is properly flagged as an error.
> + */
> +
> +#version 300 es
> +
> +struct S {
> +       uint u;
> +};
> +
> +in S foo;
> +out highp vec4 color;
> +
> +void main()
> +{
> +       color = vec4(foo.u);
> +}
> diff --git a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.vert b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.vert
> new file mode 100644
> index 0000000..3a1ab3f
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.vert
> @@ -0,0 +1,29 @@
> +/* [config]
> + * expect_result: fail
> + * glsl_version: 3.00
> + * check_link: true
> + * [end config]
> + *
> + * From the GLSL ES 3.00 spec, Section 4.3.6 ("Output Variables"):
> + *
> + *     "Vertex shader outputs that are, or contain, signed or unsigned
> + *     integers or integer vectors must be qualified with the
> + *     interpolation qualifier flat."
> + *
> + * This test verifies that a non-flat varying struct containing
> + * unsigned integral data is properly flagged as an error.
> + */
> +
> +#version 300 es
> +
> +struct S {
> +       uint u;
> +};
> +
> +out S foo;
> +
> +void main()
> +{
> +       gl_Position = vec4(0.0);
> +       foo.u = 1u;
> +}
> --
> 1.8.1.3
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

Thanks for the detailed explanation. It makes sense to me.
Both patches are Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the Piglit mailing list