[Piglit] [PATCH] piglit-util-gl-common: fix ES1 / ES2 build error

Chad Versace chad.versace at linux.intel.com
Wed Oct 10 11:27:18 PDT 2012


On 10/08/2012 06:23 PM, Brian Paul wrote:
> On Mon, Oct 8, 2012 at 6:17 PM, Jordan Justen <jordan.l.justen at intel.com> wrote:
>> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
>> Cc: Brian Paul <brianp at vmware.com>
>> Cc: Chad Versace <chad.versace at linux.intel.com>
>> ---
>>  tests/util/piglit-util-gl-common.c |    7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
>> index 62b5312..4f9fe5f 100644
>> --- a/tests/util/piglit-util-gl-common.c
>> +++ b/tests/util/piglit-util-gl-common.c
>> @@ -447,8 +447,14 @@ piglit_get_compressed_block_size(GLenum format,
>>                                  unsigned *bw, unsigned *bh, unsigned *bytes)
>>  {
>>         switch (format) {
>> +#if defined(USE_OPENGL) || defined(USE_OPENGL_ES2)
>>         case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
>>         case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
>> +               *bw = *bh = 4;
>> +               *bytes = 8;
>> +               return true;
>> +#endif
>> +#if defined(USE_OPENGL)
>>         case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
>>         case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
>>         case GL_COMPRESSED_RED_RGTC1:
>> @@ -475,6 +481,7 @@ piglit_get_compressed_block_size(GLenum format,
>>                 *bh = 4;
>>                 *bytes = 16;
>>                 return true;
>> +#endif
>>         default:
>>                 /* return something rather than uninitialized values */
>>                 *bw = *bh = *bytes = 1;
> 
> Actually, it would probably be better to test the extension #define,
> such as GL_EXT_texture_compression_s3tc because off-hand I don't know
> which compressed formats are supported by which APIs.


Brian,

The GL headers on my system don't define the GL_EXT_texture_compression_s3tc
feature macro.

Since the Piglit build is currently broken, this patch fixes it, and the
suggested alternative doesn't work on my system, I've gone ahead and committed
the patch. If we later find a better method to filter the enums in this switch,
we can apply the better method then.

-Chad


More information about the Piglit mailing list