[Piglit] [PATCH] glsl-es-1.00: add invariance tests for builtin variables
Ian Romanick
idr at freedesktop.org
Fri Nov 7 07:56:18 PST 2014
The tests look good, but it's a bit weird that non-execution tests are
in an execution directory. It looks like most test/spec/* directories
have a linker directory. With that change,
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
It's probably also worth moving the other linker tests from
tests/spec/glsl-es-1.00/execution to tests/spec/glsl-es-1.00/linker.
On 11/07/2014 03:21 AM, Tapani Pälli wrote:
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
> .../execution/glsl-fcoord-invariant.shader_test | 26 +++++++++++++++++++++
> .../execution/glsl-fface-invariant.shader_test | 23 ++++++++++++++++++
> .../execution/glsl-pcoord-invariant.shader_test | 27 ++++++++++++++++++++++
> 3 files changed, 76 insertions(+)
> create mode 100644 tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test
> create mode 100644 tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test
> create mode 100644 tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test
>
> diff --git a/tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test b/tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test
> new file mode 100644
> index 0000000..18037cd
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/execution/glsl-fcoord-invariant.shader_test
> @@ -0,0 +1,26 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +# "For the built-in special variables, gl_FragCoord can
> +# only be declared invariant if and only if gl_Position is
> +# declared invariant. Similarly gl_PointCoord can only be
> +# declared invariant if and only if gl_PointSize is declared
> +# invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +void main() {
> + gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_FragCoord;
> +void main() {
> + gl_FragColor = vec4(gl_FragCoord.x);
> +}
> +
> +[test]
> +link error
> diff --git a/tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test b/tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test
> new file mode 100644
> index 0000000..ee91098
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/execution/glsl-fface-invariant.shader_test
> @@ -0,0 +1,23 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +# "For the built-in special variables, gl_FragCoord can
> +# only be declared invariant if and only if gl_Position is
> +# declared invariant. Similarly gl_PointCoord can only be
> +# declared invariant if and only if gl_PointSize is declared
> +# invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +invariant gl_FrontFacing;
> +void main() {
> + gl_FragColor = vec4(gl_FrontFacing);
> +}
> +
> +[test]
> +link error
> diff --git a/tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test b/tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test
> new file mode 100644
> index 0000000..2dff8fb
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/execution/glsl-pcoord-invariant.shader_test
> @@ -0,0 +1,27 @@
> +#
> +# OpenGL ES 1.00 specification "Invariance and linkage":
> +#
> +# "For the built-in special variables, gl_FragCoord can
> +# only be declared invariant if and only if gl_Position is
> +# declared invariant. Similarly gl_PointCoord can only be
> +# declared invariant if and only if gl_PointSize is declared
> +# invariant. It is an error to declare gl_FrontFacing as invariant."
> +#
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +void main() {
> + gl_PointSize = 1.0;
> + gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_PointCoord;
> +void main() {
> + gl_FragColor = vec4(gl_PointCoord.x);
> +}
> +
> +[test]
> +link error
>
More information about the Piglit
mailing list