[Mesa-dev] [PATCH 1/2] mesa: don't use format chooser code for glCompressedTexImage

Brian Paul brianp at vmware.com
Fri Feb 8 09:35:02 PST 2013


On 02/07/2013 10:25 PM, Ian Romanick wrote:
> On 01/31/2013 06:02 PM, Brian Paul wrote:
>> When glCompressedTexImage is called the internalFormat is a specific
>> format for the incoming image and the the hardware format should be
> ^^^^^^^
>> the same (since we never do format transcoding). So use the simpler
>
> Not necessarily true. We convert ETC textures to other formats. Eric
> even sent patches to the list to transcode ETC to S3TC or FXT1.

AFAICT, my patch won't effect the current code.  The intel driver 
seems to use the general _mesa_choose_tex_format() function which 
translates specific compressed format GLenums to MESA_FORMATs just 
like the _mesa_glenum_to_compressed_format() function.

In fact, it looks like the big switch at texformat.c:306 could be 
replaced by a call to _mesa_glenum_to_compressed_format().

If you're going to do transcoding, I guess you'd have to do extra 
checks in the driver's compressed teximage/store code to look 
gl_texture_image::TexFormat, change it if needed, then do the transcode.

-Brian


More information about the mesa-dev mailing list