Re: [Piglit] [PATCH] shaders: add test for bool casting of large integers.
On Wed, Oct 9, 2013 at 2:30 AM, Ian Romanick wrote: > On 10/07/2013 04:22 PM, Dave Airlie wrote: >> From: Dave Airlie >> >> I noticed the TGSI convertor just does INEG then AND 0x3f80, which works >> for small values, but fails for larger ints. >> >> This seems to fail on nvidia (4.3.0 NVIDIA 325.15) and on ironlake with mesa >> 9.2. > > If you repost the patch, could you CC Wen Su ? > > Also, is there a bugzilla for this issue? No there is only this lonely piglit test, >> +[test] >> +uniform int arg0 0x0ff1 > > This value seems magic. Why did you pick that? Are there other large > values that should also be tested. I don't think so my assumption was that everyone is doing -val & 0x3f80 (at least thats what gallium does) so I wanted a value with some bits sets in the same range and some other bits set outside it, but really its as valid as any other magic value. Dave. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] shaders: add test for bool casting of large integers.
On 10/07/2013 04:22 PM, Dave Airlie wrote: > From: Dave Airlie > > I noticed the TGSI convertor just does INEG then AND 0x3f80, which works > for small values, but fails for larger ints. > > This seems to fail on nvidia (4.3.0 NVIDIA 325.15) and on ironlake with mesa > 9.2. If you repost the patch, could you CC Wen Su ? Also, is there a bugzilla for this issue? > Signed-off-by: Dave Airlie > --- > tests/shaders/glsl-fs-i2b-large-int.shader_test | 32 > + > 1 file changed, 32 insertions(+) > create mode 100644 tests/shaders/glsl-fs-i2b-large-int.shader_test > > diff --git a/tests/shaders/glsl-fs-i2b-large-int.shader_test > b/tests/shaders/glsl-fs-i2b-large-int.shader_test > new file mode 100644 > index 000..96369da > --- /dev/null > +++ b/tests/shaders/glsl-fs-i2b-large-int.shader_test > @@ -0,0 +1,32 @@ > +# validate a bug in the TGSI conversion where it just did AND (float)1.0 > +# but for large integers this would fail, we should clamp to 1 first > +# looks like nobody passes this from my first pass testing. > + > +[require] > +GLSL >= 1.30 > + > +[vertex shader] Use [vertex shader passthrough]. > +void main() > +{ > + gl_Position = gl_Vertex; > +} > + > +[fragment shader] > +#version 130 > + > +uniform int arg0; > +uniform int arg1; > + > +void main() > +{ > + bool t = bool(arg0); > + bool f = bool(arg1); > + > + gl_FragColor = vec4(1.0 - float(t), float(t) / 2.0, float(f), 1.0 - > float(f)); > +} > + > +[test] > +uniform int arg0 0x0ff1 This value seems magic. Why did you pick that? Are there other large values that should also be tested. > +uniform int arg1 0 > +draw rect -1 -1 2 2 > +probe all rgba 0.0 0.5 0.0 1.0 > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] shaders: add test for bool casting of large integers.
From: Dave Airlie I noticed the TGSI convertor just does INEG then AND 0x3f80, which works for small values, but fails for larger ints. This seems to fail on nvidia (4.3.0 NVIDIA 325.15) and on ironlake with mesa 9.2. Signed-off-by: Dave Airlie --- tests/shaders/glsl-fs-i2b-large-int.shader_test | 32 + 1 file changed, 32 insertions(+) create mode 100644 tests/shaders/glsl-fs-i2b-large-int.shader_test diff --git a/tests/shaders/glsl-fs-i2b-large-int.shader_test b/tests/shaders/glsl-fs-i2b-large-int.shader_test new file mode 100644 index 000..96369da --- /dev/null +++ b/tests/shaders/glsl-fs-i2b-large-int.shader_test @@ -0,0 +1,32 @@ +# validate a bug in the TGSI conversion where it just did AND (float)1.0 +# but for large integers this would fail, we should clamp to 1 first +# looks like nobody passes this from my first pass testing. + +[require] +GLSL >= 1.30 + +[vertex shader] +void main() +{ + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 130 + +uniform int arg0; +uniform int arg1; + +void main() +{ + bool t = bool(arg0); + bool f = bool(arg1); + + gl_FragColor = vec4(1.0 - float(t), float(t) / 2.0, float(f), 1.0 - float(f)); +} + +[test] +uniform int arg0 0x0ff1 +uniform int arg1 0 +draw rect -1 -1 2 2 +probe all rgba 0.0 0.5 0.0 1.0 -- 1.8.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit