mesa/st: use _mesa_generate_mipmap for fallback-formats

For fallback formats, we need to update both the compressed and
uncompressed images. Let's fall back to _mesa_generate_mipmap that
already handles this.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Fixes: e4ff42684b ("mesa/st: enable bptc extension with fallback")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18180>
This commit is contained in:
Erik Faye-Lund 2022-09-02 13:27:28 +02:00 committed by Marge Bot
parent e51c5a18ad
commit b6f6b43c76

View file

@ -129,6 +129,14 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
if (texObj->Sampler.Attrib.sRGBDecode == GL_SKIP_DECODE_EXT)
format = util_format_linear(format);
/* For fallback formats, we need to update both the compressed and
* uncompressed images.
*/
if (st_compressed_format_fallback(st, _mesa_base_tex_image(texObj)->TexFormat)) {
_mesa_generate_mipmap(ctx, target, texObj);
return;
}
/* First see if the driver supports hardware mipmap generation,
* if not then generate the mipmap by rendering/texturing.
* If that fails, use the software fallback.