[Piglit] [PATCH] texturing: Add test unpack-teximage2d

Chad Versace chad.versace at linux.intel.com
Fri Oct 12 10:14:06 PDT 2012


On 10/12/2012 07:25 AM, Brian Paul wrote:
> On 10/11/2012 09:13 PM, Chad Versace wrote:
>> Add four tests for testing the unpacking state with glTexImage2D.
>>      unpack-teximage2d pbo=0 format=GL_RGBA
>>      unpack-teximage2d pbo=1 format=GL_RGBA
>>      unpack-teximage2d pbo=0 format=GL_BGRA
>>      unpack-teximage2d pbo=1 format=GL_BGRA
>>
>> The tests randomly explore, with a fixed seed, the correctness of
>> glTexImage2D over the combinatorial space of pixel unpacking state.
>>
>> On Intel gen6 with mesa-34c58ac, the RGBA tests pass and the BGRA tests
>> fail.
>>
>> CC: Rob Bradford<rob at linux.intel.com>
>> CC: Neil Roberts<neil at linux.intel.com>
>> Signed-off-by: Chad Versace<chad.versace at linux.intel.com>
>> ---
>>   tests/all.tests                     |   5 +
>>   tests/texturing/CMakeLists.gl.txt   |   1 +
>>   tests/texturing/unpack-teximage2d.c | 477 ++++++++++++++++++++++++++++++++++++
>>   3 files changed, 483 insertions(+)
>>   create mode 100644 tests/texturing/unpack-teximage2d.c


>> +/**
>> + * \file
>> + * \brief Tests pixel unpacking state with glTexImage2D.
>> + *
>> + * This test randomly explores, with a fixed seed, the correctness of
>> + * glTexImage2D over the combinatorial space of pixel unpacking state. In
>> + * addition to choosing random unpacking state, the test also chooses random
>> + * texture dimensions (the former is not very interesting without the latter).
> 
> This is good, but I think another common scenario would be using
> glTexSubImage2D() with non-default pixel unpacking state to update a subregion
> of a texture image from a subregion of a source image.

Good idea. I should add that scenario to the test in the future.



>> +static int
>> +randi(int min, int max)
>> +{
>> +    return (double) (max - min) * rand() / RAND_MAX + min;
> 
> Could you put a final cast to int in there?  Otherwise MSVC will complain about
> an implicit double->int conversion.

Sure, I'll do that.



> Looks good.  The comments are very helpful.
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>

Thanks for the review.


More information about the Piglit mailing list