[Piglit] [PATCH v2] glsl-es-3.00: test for 'invariant(all)' usage in a fragment shader

Ian Romanick idr at freedesktop.org
Fri Nov 7 07:56:23 PST 2014


Thanks. :)

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

Also... if this test currently fails on Mesa, could you add a note to
the commit message?  That way QA won't waste time submitting a bug report.

On 11/07/2014 03:21 AM, Tapani Pälli wrote:
> v2: add spec citation (Ian Romanick)
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  .../spec/glsl-es-3.00/compiler/invariant_all.frag  | 24 ++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 tests/spec/glsl-es-3.00/compiler/invariant_all.frag
> 
> diff --git a/tests/spec/glsl-es-3.00/compiler/invariant_all.frag b/tests/spec/glsl-es-3.00/compiler/invariant_all.frag
> new file mode 100644
> index 0000000..77b744b
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/compiler/invariant_all.frag
> @@ -0,0 +1,24 @@
> +#version 300 es
> +// [config]
> +// expect_result: fail
> +// glsl_version: 3.00
> +// [end config]
> +//
> +// Check that 'invariant(all)' cannot be used in fragment shader.
> +//
> +// From the GLSL ES 3.00 specification, section 4.6.1 ("The
> +// Invariant Qualifier"):
> +//
> +//     "To force all output variables to be invariant, use the pragma
> +//
> +//         #pragma STDGL invariant(all)
> +//
> +//     before all declarations in a shader. If this pragma is used
> +//     after the declaration of any variables or functions, then the
> +//     set of outputs that behave as invariant is undefined. It is an
> +//     error to use this pragma in a fragment shader."
> +//
> +#pragma STDGL invariant(all)
> +void main()
> +{
> +}
> 



More information about the Piglit mailing list