[Piglit] [PATCH] glsl-es-1.00: Verify that arrays use the default precision qualifier
Tapani Pälli
tapani.palli at intel.com
Wed Jun 15 05:12:15 UTC 2016
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
On 06/14/2016 08:21 PM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> no-default-float-array-precision.frag currently fails on Mesa.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> .../no-default-float-array-precision.frag | 23 +++++++++++++++
> ...ay-of-float-using-default-precision.shader_test | 34 ++++++++++++++++++++++
> 2 files changed, 57 insertions(+)
> create mode 100644 tests/spec/glsl-es-1.00/compiler/precision-qualifiers/no-default-float-array-precision.frag
> create mode 100644 tests/spec/glsl-es-1.00/execution/array-of-float-using-default-precision.shader_test
>
> diff --git a/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/no-default-float-array-precision.frag b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/no-default-float-array-precision.frag
> new file mode 100644
> index 0000000..b9c2d99
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/compiler/precision-qualifiers/no-default-float-array-precision.frag
> @@ -0,0 +1,23 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.00
> +// check_link: true
> +// [end config]
> +//
> +// From section 4.5.3 ("Default Precision Qualifiers") of the GLSL ES
> +// 1.00 spec:
> +//
> +// "The fragment language has no default precision qualifier for
> +// floating point types. Hence for float, floating point vector
> +// and matrix variable declarations, either the declaration must
> +// include a precision qualifier or the default float precision
> +// must have been previously declared."
> +
> +#version 100
> +
> +varying float f[4];
> +
> +void main()
> +{
> + gl_FragColor = vec4(f[0], f[1], f[2], f[3]);
> +}
> diff --git a/tests/spec/glsl-es-1.00/execution/array-of-float-using-default-precision.shader_test b/tests/spec/glsl-es-1.00/execution/array-of-float-using-default-precision.shader_test
> new file mode 100644
> index 0000000..767f89e
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/execution/array-of-float-using-default-precision.shader_test
> @@ -0,0 +1,34 @@
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +#version 100
> +
> +attribute vec4 piglit_vertex;
> +varying mediump float f[4];
> +
> +void main()
> +{
> + gl_Position = piglit_vertex;
> + f[0] = 0.0;
> + f[1] = 1.0;
> + f[2] = 0.0;
> + f[3] = 1.0;
> +}
> +
> +[fragment shader]
> +#version 100
> +
> +precision mediump float;
> +
> +varying float f[4];
> +
> +void main()
> +{
> + gl_FragColor = vec4(f[0], f[1], f[2], f[3]);
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe all rgba 0.0 1.0 0.0 1.0
>
More information about the Piglit
mailing list