[Piglit] [PATCH] shaders: Verify that -int(some_bool) & value is handled correctly
Ian Romanick
idr at freedesktop.org
Tue Dec 18 21:56:50 UTC 2018
From: Ian Romanick <ian.d.romanick at intel.com>
This reproduces bug #109075. In that bug, '-int(XYZ) & anything' was
optimized as though it were '-int(XYZ) & floatBitsToInt(1.0)'.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109075
---
...glsl-fs-bitwise-and-Boolean-and-1.0.shader_test | 32 ++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test
diff --git a/tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test b/tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test
new file mode 100644
index 000000000..e59656326
--- /dev/null
+++ b/tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.30
+GL_ARB_shader_bit_encoding
+
+[vertex shader passthrough]
+
+[fragment shader]
+#extension GL_ARB_shader_bit_encoding: enable
+
+out vec4 piglit_fragcolor;
+
+uniform int x = 37;
+uniform int y = 46;
+
+void main()
+{
+ bool a = x == 37; // Must be true.
+ bool b = y == 46; // Must be true.
+
+ /* This reproduces bug #109075. In that bug, '-int(XYZ) & anything' was
+ * optimized as though it were '-int(XYZ) & floatBitsToInt(1.0)'.
+ */
+ piglit_fragcolor = vec4(intBitsToFloat(-int(a) & floatBitsToInt(0.5)),
+ intBitsToFloat(-int(b) & floatBitsToInt(0.5)),
+ 0.0,
+ 1.0);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.5 0.0 1.0
+
--
2.14.5
More information about the Piglit
mailing list