Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

glGetTexLevelParameter returns generic compressed format


We have been using texture compression with simple caching for quite a while according to the following procedure:

a. if cache file doesn't exist

1. upload the uncompressed image with glTexImage2D, specifying a generic compressed format (e.g. GL_COMPRESSED_RGB) as the internal format

2. query the actual internal format with glGetTexLevelParameter

3. get compressed image data with glGetCompressedTexImage

4. store internal format and image data to a file

b. if cache file exists

1. upload the image with glCompressedTexImage2D using the format and data from the cache file

Now we've updated the drivers (to version 14.4) on two of our development machines with a Radeon HD 5770 and a 7770 respectively, and we found the caching mechanism to no longer work as before. The problem is that the format returned by glGetTexLevelParameter is a generic compressed format (e.g. GL_COMPRESSED_RGB) in contrast to a specific format like GL_COMPRESSED_RGB_S3TC_DXT1_EXT. As a consequence, the call to glCompressedTexImage2D generates an error.

Is this a bug in the current driver, or are we doing something wrong here?



1 Reply
Journeyman III

The query is supposed to give you the actual internal format used, not a generic one. That said, I would not rely on the driver to do your texture compression for you.