[Piglit] [PATCH] Fix the draw-pixel-with-texture expected value to match what is written

Ilia Mirkin imirkin at alum.mit.edu
Thu Mar 19 21:00:44 PDT 2015


On Thu, Mar 19, 2015 at 11:40 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Thu, Mar 19, 2015 at 11:25 PM, Matthew Dawson <matthew at mjdsystems.ca> wrote:
>> The expected value for draw-pixel-with-texture does not match what is
>> actually written using the glDrawPixels function, causing the test to
>> always fail.  Change the expected value to what is wanted instead.
>>
>> This test fails regardless on my AMD cards, but if texturing is disabled
>> in the test, it can now pass with this patch.  The piglit results at
>> http://people.freedesktop.org/~imirkin/nv10-comparison/nv17-2014-10-03-imirkin/spec/!OpenGL%201.1/draw-pixel-with-texture.html
>> suggest that this is a problem even with drivers that would pass with
>> texturing enabled.
>
> Not sure that nouveau_vieux is quite the definition of perfection...
> nv40, nv50 and nvc0 all fail with
>
> Observed: 0.039216 1.000000 0.000000 1.000000
>
> so they'd keep on failing even with your change. No idea what's going
> on with this test, but is that result reasonable?

OK, I looked at the test... it does

GLfloat tex_data[2 * 2 * 4] = {
1, 0, 0, 1, 1, 0, 0, 1,
1, 0, 0, 1, 1, 0, 0, 1,
};

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

for (i = 0; i < SCREEN_SIZE_IN_PIXELS; i += 4) {
pixels[i + 0] = 0.2;
pixels[i + 1] = 1;
pixels[i + 2] = 0;
pixels[i + 3] = 1;
}

glClear(GL_COLOR_BUFFER_BIT);
glDrawPixels(piglit_width, piglit_height, GL_RGBA, GL_FLOAT, pixels);

Looking up the docs for GL_MODULATE, I guess it's supplied to multiply
the two things, hence the expected result. This is the first I'm
hearing of this though, so I might have misread/misunderstood the
spec.

Cheers,

  -ilia


>
>   -ilia
>
>> ---
>>  tests/general/draw-pixel-with-texture.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Note: I'm new to piglit, and thus don't have commit rights.
>>
>> diff --git a/tests/general/draw-pixel-with-texture.c b/tests/general/draw-
>> pixel-with-texture.c
>> index c03131e..24e4f58 100644
>> --- a/tests/general/draw-pixel-with-texture.c
>> +++ b/tests/general/draw-pixel-with-texture.c
>> @@ -43,7 +43,7 @@ piglit_display(void)
>>                 1, 0, 0, 1,     1, 0, 0, 1,
>>         };
>>         GLfloat *pixels;
>> -       GLfloat expected[4] = {0.2, 0, 0, 1};
>> +       GLfloat expected[4] = {0.2, 1, 0, 1};
>>         int i;
>>
>>         pixels = (GLfloat *) malloc(SCREEN_SIZE_IN_PIXELS * sizeof(GLfloat));
>> --
>> 2.0.5
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
>>


More information about the Piglit mailing list