mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
mesa: Don't override S3TC internalFormat if data is pre-compressed.
Commit42723d88dintended to override an S3TC internalFormat to a generic compressed format when the application requested online compression of uncompressed data. Unfortunately, it also broke pre-compressed textures when libtxc_dxtn isn't installed but the extensions are forced on. Both glCompressedTexImage2D() and glTexImage2D() call teximage(), which calls _mesa_choose_texture_format(), hitting this override code. If we have actual S3TC source data, we can't treat it as any other format, and need to avoid the override. Since glCompressedTexImage2D() passes in a format of GL_NONE (which is illegal for glTexImage), we can use that to detect the pre-compressed case and avoid the overrides. Fixes a regression since42723d88d3. NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com> (cherry picked from commit328961d955)
This commit is contained in:
parent
0231c54ebb
commit
3dd84a58bb
1 changed files with 1 additions and 1 deletions
|
|
@ -2808,7 +2808,7 @@ _mesa_choose_texture_format(struct gl_context *ctx,
|
|||
/* If the application requested compression to an S3TC format but we don't
|
||||
* have the DTXn library, force a generic compressed format instead.
|
||||
*/
|
||||
if (internalFormat != format) {
|
||||
if (internalFormat != format && format != GL_NONE) {
|
||||
const GLenum before = internalFormat;
|
||||
|
||||
switch (internalFormat) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue