[Piglit] [PATCH] glsl-algebraic-logic*: Fix two tests in case the optimizer is more successful.

Eric Anholt eric at anholt.net
Wed Feb 8 14:11:17 PST 2012


These were failing due to the uniforms being unavailable after a new
optimization in Mesa.
---
 .../glsl-algebraic-logicand-false-2.shader_test    |    5 ++---
 .../glsl-algebraic-logicor-true.shader_test        |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/tests/shaders/glsl-algebraic-logicand-false-2.shader_test b/tests/shaders/glsl-algebraic-logicand-false-2.shader_test
index e0d2fbb..1477ec3 100644
--- a/tests/shaders/glsl-algebraic-logicand-false-2.shader_test
+++ b/tests/shaders/glsl-algebraic-logicand-false-2.shader_test
@@ -8,19 +8,18 @@ void main()
 }
 
 [fragment shader]
-uniform vec4 color;
+uniform bool some_bool; /* defaults to false */
 void main()
 {
 	const vec4 red = vec4(1.0, 0.0, 0.0, 0.0);
 	const vec4 green = vec4(0.0, 1.0, 0.0, 0.0);
 
-	if (color.b != 0.0 && false)
+	if (!some_bool && false)
 		gl_FragColor = red;
 	else
 		gl_FragColor = green;
 }
 
 [test]
-uniform vec4 color 0.0 0.0 1.0 0.0
 draw rect -1 -1 2 2
 probe rgb 1 1 0.0 1.0 0.0
diff --git a/tests/shaders/glsl-algebraic-logicor-true.shader_test b/tests/shaders/glsl-algebraic-logicor-true.shader_test
index c219c22..172c269 100644
--- a/tests/shaders/glsl-algebraic-logicor-true.shader_test
+++ b/tests/shaders/glsl-algebraic-logicor-true.shader_test
@@ -8,19 +8,18 @@ void main()
 }
 
 [fragment shader]
-uniform vec4 color;
+uniform bool some_bool; /* defaults to false */
 void main()
 {
 	const vec4 red = vec4(1.0, 0.0, 0.0, 0.0);
 	const vec4 green = vec4(0.0, 1.0, 0.0, 0.0);
 
-	if (color.b == 0.0 || true)
+	if (some_bool || true)
 		gl_FragColor = green;
 	else
 		gl_FragColor = red;
 }
 
 [test]
-uniform vec4 color 0.0 0.0 1.0 0.0
 draw rect -1 -1 2 2
 probe rgb 1 1 0.0 1.0 0.0
-- 
1.7.9



More information about the Piglit mailing list