From: Ian Romanick <[email protected]>

This is a general step() test, but it is designed to tickle an
optimization path in the GEN4 and GEN5 code generation in the i965
driver.  This optimization tries to generate different code for
expressions like 'float(expr cmp 0)'.

Signed-off-by: Ian Romanick <[email protected]>
Cc: Tapani Palli <[email protected]>
---
 tests/spec/glsl-1.10/execution/fs-step.shader_test | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/execution/fs-step.shader_test

diff --git a/tests/spec/glsl-1.10/execution/fs-step.shader_test 
b/tests/spec/glsl-1.10/execution/fs-step.shader_test
new file mode 100644
index 0000000..2ea0725
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/fs-step.shader_test
@@ -0,0 +1,35 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader passthrough]
+
+[fragment shader]
+uniform float a;
+uniform float b;
+uniform vec4 color0;
+uniform vec4 color1;
+
+void main()
+{
+    /* This is a general step() test, but it is designed to tickle an
+     * optimization path in the GEN4 and GEN5 code generation in the i965
+     * driver.  This optimization tries to generate different code for
+     * expressions like 'float(expr cmp 0)'.
+     */
+    gl_FragColor = step(0.0, a * b) * color0 + color1;
+}
+
+[test]
+uniform float a -1
+uniform float b 1
+uniform vec4 color0 1.0 -1.0 0.0 0.0
+uniform vec4 color1 0.0 1.0 0.0 1.0
+draw rect -1 -1 1 2
+relative probe rgba (0.25, 0.5) (0.0, 1.0, 0.0, 1.0)
+
+uniform float a 1
+uniform float b 1
+uniform vec4 color0 -1.0 1.0 0.0 0.0
+uniform vec4 color1 1.0 0.0 0.0 1.0
+draw rect 0 -1 1 2
+relative probe rgba (0.75, 0.5) (0.0, 1.0, 0.0, 1.0)
-- 
2.1.0

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to