mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
mesa: don't use format chooser code for glCompressedTexImage
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
_mesa_glenum_to_compressed_format() function. This change is also
needed for the next patch.
Note: This is a candidate for the stable branches.
(cherry picked from commit 478056b81a)
This commit is contained in:
parent
30ae2f97c5
commit
4ec3843a54
1 changed files with 12 additions and 2 deletions
|
|
@ -2996,8 +2996,18 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
|
|||
texObj = _mesa_get_current_tex_object(ctx, target);
|
||||
assert(texObj);
|
||||
|
||||
texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
|
||||
internalFormat, format, type);
|
||||
if (compressed) {
|
||||
/* For glCompressedTexImage() the driver has no choice about the
|
||||
* texture format since we'll never transcode the user's compressed
|
||||
* image data. The internalFormat was error checked earlier.
|
||||
*/
|
||||
texFormat = _mesa_glenum_to_compressed_format(internalFormat);
|
||||
}
|
||||
else {
|
||||
texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
|
||||
internalFormat, format, type);
|
||||
}
|
||||
|
||||
assert(texFormat != MESA_FORMAT_NONE);
|
||||
|
||||
/* check that width, height, depth are legal for the mipmap level */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue