On Tue, Dec 18, 2018 at 3:56 PM Ian Romanick <[email protected]> wrote:
> From: Ian Romanick <[email protected]> > > 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 <[email protected]> > 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; > Wow. I think this may be the best use I've ever seen of uniform initializers. :-) Seems to do the thing in the bug. Reviewed-by: Jason Ekstrand <[email protected]> > + > +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 > > _______________________________________________ > Piglit mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/piglit >
_______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
