[Piglit] [PATCH] Test "double negative" corner case in copy propagation.

Ian Romanick idr at freedesktop.org
Mon Sep 19 10:37:16 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/15/2011 09:16 AM, Paul Berry wrote:
> This patch adds two tests that exercise a subtle corner case bug
> found in Mesa with i965: If a value is negated, and then negated
> again, then copy propagation would fail to un-do the negation.
> 
> The bug only exists on i965 vertex shaders, but I went ahead and 
> added the equivalent fragment shader test for completeness.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> --- .../execution/fs-double-negative.shader_test       |   31
> +++++++++++++++++++ .../execution/vs-double-negative.shader_test
> |   32 ++++++++++++++++++++ 2 files changed, 63 insertions(+), 0
> deletions(-) create mode 100644
> tests/spec/glsl-1.10/execution/fs-double-negative.shader_test 
> create mode 100644
> tests/spec/glsl-1.10/execution/vs-double-negative.shader_test
> 
> diff --git
> a/tests/spec/glsl-1.10/execution/fs-double-negative.shader_test
> b/tests/spec/glsl-1.10/execution/fs-double-negative.shader_test new
> file mode 100644 index 0000000..c73be7b --- /dev/null +++
> b/tests/spec/glsl-1.10/execution/fs-double-negative.shader_test @@
> -0,0 +1,31 @@ +# [description] +# This test exercises a corner case
> of copy propagation found in Mesa: +# double negation of a value
> should restore the original value. + +[require] +GLSL >= 1.10 + 
> +[vertex shader] +#version 110 + +void main(void) +{ +	gl_Position
> = gl_Vertex; +} + +[fragment shader] +#version 110 + +uniform float
> x; + +void main(void) +{ +	float y = -x; +	float z = -y; +
> gl_FragColor = vec4(0.5 + x, 0.5 + y, 0.5 + z, 1.0); +} + +[test] 
> +uniform float x 0.25 +draw rect -1 -1 2 2 +probe all rgba 0.75
> 0.25 0.75 1.0 diff --git
> a/tests/spec/glsl-1.10/execution/vs-double-negative.shader_test
> b/tests/spec/glsl-1.10/execution/vs-double-negative.shader_test new
> file mode 100644 index 0000000..da99fc2 --- /dev/null +++
> b/tests/spec/glsl-1.10/execution/vs-double-negative.shader_test @@
> -0,0 +1,32 @@ +# [description] +# This test exercises a corner case
> of copy propagation found in Mesa: +# double negation of a value
> should restore the original value. + +[require] +GLSL >= 1.10 + 
> +[vertex shader] +#version 110 + +uniform float x; + +void
> main(void) +{ +	gl_Position = gl_Vertex; + +	float y = -x; +	float
> z = -y; +	gl_FrontColor = vec4(0.5 + x, 0.5 + y, 0.5 + z, 1.0); +} 
> + +[fragment shader] +#version 110 +void main(void) +{ +
> gl_FragColor = gl_Color; +} + +[test] +uniform float x 0.25 +draw
> rect -1 -1 2 2 +probe all rgba 0.75 0.25 0.75 1.0

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk53fcwACgkQX1gOwKyEAw+fvgCffCqhCg6cQ5dB3u/Cq/43MoOA
4kIAniMxdFIvp3HopXJajP0/BB0DHyhL
=EeKg
-----END PGP SIGNATURE-----


More information about the Piglit mailing list