<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Dec 18, 2018 at 3:56 PM Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com" target="_blank">ian.d.romanick@intel.com</a>><br>
<br>
This reproduces bug #109075. In that bug, '-int(XYZ) & anything' was<br>
optimized as though it were '-int(XYZ) & floatBitsToInt(1.0)'.<br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com" target="_blank">ian.d.romanick@intel.com</a>><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=109075" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=109075</a><br>
---<br>
...glsl-fs-bitwise-and-Boolean-and-1.0.shader_test | 32 ++++++++++++++++++++++<br>
1 file changed, 32 insertions(+)<br>
create mode 100644 tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test<br>
<br>
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<br>
new file mode 100644<br>
index 000000000..e59656326<br>
--- /dev/null<br>
+++ b/tests/shaders/glsl-fs-bitwise-and-Boolean-and-1.0.shader_test<br>
@@ -0,0 +1,32 @@<br>
+[require]<br>
+GLSL >= 1.30<br>
+GL_ARB_shader_bit_encoding<br>
+<br>
+[vertex shader passthrough]<br>
+<br>
+[fragment shader]<br>
+#extension GL_ARB_shader_bit_encoding: enable<br>
+<br>
+out vec4 piglit_fragcolor;<br>
+<br>
+uniform int x = 37;<br>
+uniform int y = 46;<br></blockquote><div><br></div><div>Wow. I think this may be the best use I've ever seen of uniform initializers. :-)</div><div><br></div><div>Seems to do the thing in the bug.</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+void main()<br>
+{<br>
+ bool a = x == 37; // Must be true.<br>
+ bool b = y == 46; // Must be true.<br>
+<br>
+ /* This reproduces bug #109075. In that bug, '-int(XYZ) & anything' was<br>
+ * optimized as though it were '-int(XYZ) & floatBitsToInt(1.0)'.<br>
+ */<br>
+ piglit_fragcolor = vec4(intBitsToFloat(-int(a) & floatBitsToInt(0.5)),<br>
+ intBitsToFloat(-int(b) & floatBitsToInt(0.5)),<br>
+ 0.0,<br>
+ 1.0);<br>
+}<br>
+<br>
+[test]<br>
+draw rect -1 -1 2 2<br>
+probe all rgba 0.5 0.5 0.0 1.0<br>
+<br>
-- <br>
2.14.5<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org" target="_blank">Piglit@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</blockquote></div></div>