[Piglit] [PATCH] glsl: test a switch statement where default is last
Chris Forbes
chrisf at ijw.co.nz
Fri Jul 25 21:45:05 PDT 2014
Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>
On Fri, Jul 25, 2014 at 7:15 PM, Tapani Pälli <tapani.palli at intel.com> wrote:
> This test is copy paste of fs-default_notlast.shader_test with
> the cases rearranged.
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
> .../execution/switch/fs-default_last.shader_test | 43 ++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
> create mode 100644 tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test
>
> diff --git a/tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test b/tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test
> new file mode 100644
> index 0000000..17db675
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/execution/switch/fs-default_last.shader_test
> @@ -0,0 +1,43 @@
> +[require]
> +GLSL >= 1.30
> +
> +[vertex shader]
> +#version 130
> +void main()
> +{
> + gl_Position = gl_Vertex;
> +}
> +
> +[fragment shader]
> +#version 130
> +
> +uniform int i;
> +
> +void main()
> +{
> + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
> + vec4 tmp = vec4(0.0, 0.0, 0.0, 0.0);
> + switch (i) {
> + case 0:
> + gl_FragColor.x = 1.0;
> + break;
> + case 1:
> + gl_FragColor.y = 1.0;
> + break;
> + default:
> + gl_FragColor.z = 1.0;
> + break;
> + }
> +}
> +
> +[test]
> +uniform int i 0
> +draw rect -1 -1 1 1
> +uniform int i 1
> +draw rect 0 -1 1 1
> +uniform int i 2
> +draw rect -1 0 1 1
> +
> +relative probe rgba (0, 0) (1, 0, 0, 0)
> +relative probe rgba (1, 0) (0, 1, 0, 0)
> +relative probe rgba (0, 1) (0, 0, 1, 0)
> --
> 1.8.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list