[Piglit] [PATCH 1/2] glsl-1.10: Add a test for a regression introduced in the i965 driver.

Eric Anholt eric at anholt.net
Tue Apr 24 10:23:39 PDT 2012


---
 .../fs-bool-less-compare-false.shader_test         |   29 ++++++++++++++++++++
 .../fs-bool-less-compare-true.shader_test          |   29 ++++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/execution/fs-bool-less-compare-false.shader_test
 create mode 100644 tests/spec/glsl-1.10/execution/fs-bool-less-compare-true.shader_test

diff --git a/tests/spec/glsl-1.10/execution/fs-bool-less-compare-false.shader_test b/tests/spec/glsl-1.10/execution/fs-bool-less-compare-false.shader_test
new file mode 100644
index 0000000..11c572c
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-bool-less-compare-false.shader_test
@@ -0,0 +1,29 @@
+# This test exercises a bug introduced in i965: Comparison of comparison
+# results to boolean values gave incorrect results.
+
+[vertex shader]
+void main()
+{
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform float one;
+uniform float zero;
+uniform bool f;
+
+void main()
+{
+	if (one < zero == f)
+		gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
+	else
+		gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0);
+}
+
+[test]
+uniform float one 1.0
+uniform float zero 0.0
+uniform int f 0
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
diff --git a/tests/spec/glsl-1.10/execution/fs-bool-less-compare-true.shader_test b/tests/spec/glsl-1.10/execution/fs-bool-less-compare-true.shader_test
new file mode 100644
index 0000000..bc9148c
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-bool-less-compare-true.shader_test
@@ -0,0 +1,29 @@
+# This test exercises a bug introduced in i965: Comparison of comparison
+# results to boolean values gave incorrect results.
+
+[vertex shader]
+void main()
+{
+  gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform float one;
+uniform float zero;
+uniform bool t;
+
+void main()
+{
+	if (zero < one == t)
+		gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
+	else
+		gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0);
+}
+
+[test]
+uniform float one 1.0
+uniform float zero 0.0
+uniform int t 1
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
1.7.10



More information about the Piglit mailing list