summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-10-15 12:25:28 +0100
committerEric Anholt <eric@anholt.net>2014-10-21 16:56:12 +0100
commita636a3610d7cd8d59986e547bde52cfcc3fb7dab (patch)
treefb086c88f0e1894792cca979c414c21a7d75be16
parent81481096dccb65b8b2601718123afe3e782849d2 (diff)
Add a variant of the glsl-fs-frontfacing test to show a gallium bug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--tests/shaders/glsl-fs-frontfacing-not.shader_test31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/shaders/glsl-fs-frontfacing-not.shader_test b/tests/shaders/glsl-fs-frontfacing-not.shader_test
new file mode 100644
index 000000000..6a85ef50b
--- /dev/null
+++ b/tests/shaders/glsl-fs-frontfacing-not.shader_test
@@ -0,0 +1,31 @@
+[require]
+GL >= 2.0
+GLSL >= 1.20
+
+[vertex shader]
+void main()
+{
+ gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+ /* st_glsl_to_tgsi.cpp would return a bool value of 0.0 or
+ * 1.0, instead of 0 or ~0 like it should with NativeIntegers
+ * set. Then the NOT operation would give a still-nonzero
+ * value.
+ */
+ if (!gl_FrontFacing)
+ gl_FragColor = vec4(0.0, 0.0, 1.0, 0.0);
+ else
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);
+}
+
+[test]
+draw rect -1 -1 2 1
+draw rect 1 0 -2 1
+relative probe rgba (0, 0) (0.0, 1.0, 0.0, 0.0)
+relative probe rgba (1, 0) (0.0, 1.0, 0.0, 0.0)
+relative probe rgba (0, 1) (0.0, 0.0, 1.0, 0.0)
+relative probe rgba (1, 1) (0.0, 0.0, 1.0, 0.0)