mesa/st: do not use memcpy when using compressed fallback

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

This isn't a problem yet, because none of the current compressed formats
with fallback are copyable as per the OpenGL 4.6 Core spec, table 8.14.
However, this is about to change, when we introduce fallback for BPTC
formats.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>
This commit is contained in:
Erik Faye-Lund
2022-08-11 16:12:00 +02:00
committed by Marge Bot
parent 673d241f36
commit 8f446322e1

View File

@@ -2015,7 +2015,8 @@ 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)) {
mesa_src_format, format, type, unpack) ||
st_compressed_format_fallback(st, texImage->TexFormat)) {
goto fallback;
}