[Piglit] [PATCH 2/2] glsl-1.50: Add more tests for various 'invariant' scenarios

Anuj Phogat anuj.phogat at gmail.com
Fri Apr 25 15:03:31 PDT 2014


On Sun, Apr 20, 2014 at 9:05 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
> These highlight a few cases where we were doing the wrong thing.
>
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  .../glsl-1.50/compiler/invariant-qualifier-01.geom     | 10 ++++++++++
>  .../glsl-1.50/compiler/invariant-qualifier-02.geom     | 10 ++++++++++
>  .../glsl-1.50/compiler/invariant-qualifier-03.geom     | 11 +++++++++++
>  .../glsl-1.50/compiler/invariant-qualifier-04.geom     | 11 +++++++++++
>  .../compiler/invariant-qualifier-in-out-block-01.vert  | 16 ++++++++++++++++
>  .../compiler/invariant-qualifier-in-out-block-02.vert  | 18 ++++++++++++++++++
>  6 files changed, 76 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/compiler/invariant-qualifier-01.geom
>  create mode 100644 tests/spec/glsl-1.50/compiler/invariant-qualifier-02.geom
>  create mode 100644 tests/spec/glsl-1.50/compiler/invariant-qualifier-03.geom
>  create mode 100644 tests/spec/glsl-1.50/compiler/invariant-qualifier-04.geom
>  create mode 100644 tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-01.vert
>  create mode 100644 tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-02.vert
>
> diff --git a/tests/spec/glsl-1.50/compiler/invariant-qualifier-01.geom b/tests/spec/glsl-1.50/compiler/invariant-qualifier-01.geom
> new file mode 100644
> index 0000000..aa631dc
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/invariant-qualifier-01.geom
> @@ -0,0 +1,10 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// [end config]
> +//
> +// Verify that the invariant-qualifier cannot be used on uniforms in the GS.
> +
> +#version 150
> +
> +invariant uniform vec4 junk;   /* not allowed */
> diff --git a/tests/spec/glsl-1.50/compiler/invariant-qualifier-02.geom b/tests/spec/glsl-1.50/compiler/invariant-qualifier-02.geom
> new file mode 100644
> index 0000000..f9fdcbb
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/invariant-qualifier-02.geom
> @@ -0,0 +1,10 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// [end config]
> +//
> +// Verify that the invariant-qualifier cannot be used on temps in the GS.
> +
> +#version 150
> +
> +invariant vec4 junk;   /* not allowed */
> diff --git a/tests/spec/glsl-1.50/compiler/invariant-qualifier-03.geom b/tests/spec/glsl-1.50/compiler/invariant-qualifier-03.geom
> new file mode 100644
> index 0000000..029b7fd
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/invariant-qualifier-03.geom
> @@ -0,0 +1,11 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// [end config]
> +//
> +// Verify that the invariant redeclarations cannot be used on uniforms in the GS.
> +
> +#version 150
> +
> +uniform vec4 junk;
> +invariant junk;        /* not allowed */
> diff --git a/tests/spec/glsl-1.50/compiler/invariant-qualifier-04.geom b/tests/spec/glsl-1.50/compiler/invariant-qualifier-04.geom
> new file mode 100644
> index 0000000..3601360
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/invariant-qualifier-04.geom
> @@ -0,0 +1,11 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// [end config]
> +//
> +// Verify that the invariant redeclarations cannot be used on temps in the GS.
> +
> +#version 150
> +
> +vec4 junk;
> +invariant junk;        /* not allowed */
> diff --git a/tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-01.vert b/tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-01.vert
> new file mode 100644
> index 0000000..5eb50d0
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-01.vert
> @@ -0,0 +1,16 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// [end config]
> +//
> +// Tests that the invariant qualifier can be applied to a member of an out block.
> +
> +#version 150
> +
> +out block {
> +    invariant vec4 x;
> +};
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-02.vert b/tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-02.vert
> new file mode 100644
> index 0000000..b6c7b91
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/invariant-qualifier-in-out-block-02.vert
> @@ -0,0 +1,18 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// [end config]
> +//
> +// Tests that the invariant qualifier can be applied to a member of an out block.
> +
> +#version 150
> +
> +out block {
> +    vec4 x;
> +};
> +
> +invariant x;
> +
> +void main()
> +{
> +}
> --

Looks good to me.
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

> 1.9.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list