mesa/st: do not blit when using compressed fallback

If we're using the blit-path, we don't update the compressed image, which
will be needed if an application try to download the texture-image again
afterwards.

I previously fixed this for the memcpy-codepath, but we actually need to
fall back for the blit code-path as well. So let's move this early-out
earlier to catch both.

Fixes: 8f446322e1 ("mesa/st: do not use memcpy when using compressed fallback")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18342>
This commit is contained in:
Erik Faye-Lund
2022-08-31 15:13:28 +02:00
committed by Marge Bot
parent 802fa57274
commit d01cbced85

View File

@@ -1991,6 +1991,11 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
goto fallback;
}
/* We need both the compressed and non-compressed textures updated,
* which neither the PBO nor memcpy code-paths does */
if (st_compressed_format_fallback(st, texImage->TexFormat)) {
goto fallback;
}
/* See if the destination format is supported. */
if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL)
@@ -2040,8 +2045,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
* etc. */
if (!_mesa_texstore_can_use_memcpy(ctx,
_mesa_get_format_base_format(mesa_src_format),
mesa_src_format, format, type, unpack) ||
st_compressed_format_fallback(st, texImage->TexFormat)) {
mesa_src_format, format, type, unpack)) {
goto fallback;
}