[Piglit] [PATCH] Add meaner swizzle-swizzle-lhs tests.

Timothy Arceri t_arceri at yahoo.com.au
Thu Jul 23 05:31:33 PDT 2015


On Wed, 2015-07-22 at 21:39 -0700, Kenneth Graunke wrote:
> Mesa's compiler happened to handle .xzy.z correctly, while .xy.x and
> other combinations were broken.  Try that and a triply-nested one.
> 
> Cc: idr at freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  .../glsl-vs-swizzle-swizzle-lhs-2.shader_test       | 21 
> +++++++++++++++++++++
>  .../glsl-vs-swizzle-swizzle-lhs-3.shader_test       | 21 
> +++++++++++++++++++++
>  2 files changed, 42 insertions(+)
>  create mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
>  create mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
> 
> diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test 
> b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
> new file mode 100644
> index 0000000..98b682b
> --- /dev/null
> +++ b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
> @@ -0,0 +1,21 @@
> +[require]
> +GLSL >= 1.10
> +
> +[vertex shader]
> +void main()
> +{
> +	vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
> +	color.xy.x = 1.0;
> +	gl_FrontColor = color;
> +	gl_Position = gl_Vertex;
> +}
> +
> +[fragment shader]
> +void main()
> +{
> +	gl_FragColor = gl_Color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe rgba 1 1 1.0 0.2 0.3 0.4
> diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test 
> b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
> new file mode 100644
> index 0000000..3213c25
> --- /dev/null
> +++ b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
> @@ -0,0 +1,21 @@
> +[require]
> +GLSL >= 1.10
> +
> +[vertex shader]
> +void main()
> +{
> +	vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
> +	color.wxz.yx.y = 1.0;
> +	gl_FrontColor = color;
> +	gl_Position = gl_Vertex;
> +}
> +
> +[fragment shader]
> +void main()
> +{
> +	gl_FragColor = gl_Color;
> +}
> +
> +[test]
> +draw rect -1 -1 2 2
> +probe rgba 1 1 0.1 0.2 0.3 1.0

Maybe put these in the glsl-1.10 folder?

Other than that Reviewed-by: Timothy Arceri <t_arceri at yahoo.com.au>


More information about the Piglit mailing list