[Piglit] [PATCH 0/2] Fixes for texture-integer test

Martin Andersson g02maran at gmail.com
Tue Aug 13 14:24:21 PDT 2013


Hi,

I started to look at why the spec/!OpenGL 3.0/gl-3.0-texture-integer test
sometimes failed. It failed with errors like this:

texture-integer: failure with format GL_RGB8I_EXT:
  texture color = 100, 9, 71, 0
  expected color = 0.25, 0.5, 0.75, 0
  result color = 0.25098, 0.501961, 0.74902, 1
PIGLIT: {'result': 'fail' }

When I ran the test a bunch of times I found that it only failed when
the last texture color was zero. So when I changed this code in the
pigilt test:

value[0] = rand() % max;
value[1] = rand() % max;
value[2] = rand() % max;
value[3] = rand() % max;

to this:

value[0] = rand() % max;
value[1] = rand() % max;
value[2] = rand() % max;
value[3] = 0;

The test always failed.

I have an AMD 6950, but I found this bug which I belive is hitting the same
issue but with an intel card.
https://bugs.freedesktop.org/show_bug.cgi?id=63664

Anyway, I think I found the issue and it should be fixed with the first patch.

This is an example of what could happen when alpha was zero, with
GL_RGB_INTEGER_EXT:

value = 121, 68, 32, 0
expected = 0.25, 0.5, 0.75, 0

// expected - value
bias = -120.75, -67.5, -31.25, 0

// ivec4 t = texture(tex, gl_TexCoord[0].xy);
t = 121, 68, 32, 1

// t + bias
result = 0.25, 0.5, 0.75, 1

Which fails the test, but with alpha one:

value = 121, 68, 32, 1
expected = 0.25, 0.5, 0.75, 0

// expected - value
bias = -120.75, -67.5, -31.25, -1

// ivec4 t = texture(tex, gl_TexCoord[0].xy);
t = 121, 68, 32, 1

// t + bias
result = 0.25, 0.5, 0.75, 0

Which passes the test.

I posted this patch in a thread in mesa-dev [1] and there Ian suggested that
the GL_ALPHA_INTEGER_EXT case had a similar problem. So that is addressed by
patch number two, but I'm not confident that patch is correct though, because
of my limited knowledge of all this. In that thread Marek also thought, for
GL_RGB_INTEGER_EXT, that value[3] should be one and not zero and expected[3]
should be limited to values between zero and one. Perhaps those changes could
be made in another patch. 

[1] http://lists.freedesktop.org/archives/mesa-dev/2013-August/042700.html

Martin Andersson (2):
  texture-integer: fix issue with GL_RGB_INTEGER_EXT swizzle
  texture-integer: fix issue with GL_ALPHA_INTEGER_EXT swizzle

 tests/spec/gl-3.0/texture-integer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
1.8.3.4



More information about the Piglit mailing list