[Piglit] [PATCH] piglit-util-gl-common: fix ES1 / ES2 build error
Brian Paul
brianp at vmware.com
Wed Oct 10 12:00:35 PDT 2012
On 10/10/2012 12:27 PM, Chad Versace wrote:
> 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.
That's fine but I think I'm missing something.
Aren't all the GL_(s3tc)_EXT tokens coming from the
generated_dispatch.h file? It looks like that header also has a whole
mess of "#define GL_EXT_foo_bar" lines. Shouldn't there be one for
GL_EXT_texture_compression_s3tc also?
Wouldn't everyone have the s3tc-related tokens defined in
generated_dispatch.h like I do?
AFAICT, generated_dispatch.[ch] are generated from the glapi.json
file. And glapi.json is generated from enumext.spec and that file
defines the extension tokens above. So I don't see where the
variation in #defined tokens is coming from.
-Brian
More information about the Piglit
mailing list