[Piglit] [PATCH] spec/glsl-es-1.00/linker: test pass cases for invariant conditions
Dylan Baker
dylan at pnwbakers.com
Tue May 17 18:24:38 UTC 2016
Quoting Lars Hamre (2016-05-06 13:23:48)
> These test the cases where gl_FragCoord and gl_PointCoord are
> allowed to be declared invariant.
>
> Signed-off-by: Lars Hamre <chemecse at gmail.com>
>
> ---
>
> NOTE: someone with access will need to commit this after the
> review process
>
> .../linker/glsl-fcoord-invariant-pass.shader_test | 27 +++++++++++++++++++++
> .../linker/glsl-pcoord-invariant-pass.shader_test | 28 ++++++++++++++++++++++
> 2 files changed, 55 insertions(+)
> create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> create mode 100644 tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
>
> diff --git a/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.shader_test
> new file mode 100644
> index 0000000..76348a6
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-fcoord-invariant-pass.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]
> +invariant gl_Position;
> +void main() {
> + gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +invariant gl_FragCoord;
> +void main() {
> + gl_FragColor = vec4(gl_FragCoord.x);
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> new file mode 100644
> index 0000000..c0e9673
> --- /dev/null
> +++ b/tests/spec/glsl-es-1.00/linker/glsl-pcoord-invariant-pass.shader_test
> @@ -0,0 +1,28 @@
> +#
> +# 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]
> +invariant gl_PointSize;
> +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 success
> --
> 2.5.5
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
I'll go ahead and push this too.
Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160517/7462d4dd/attachment-0001.sig>
More information about the Piglit
mailing list