From 8f446322e1bdd7d4350138e5bd7fcd3a3ff05ab6 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 11 Aug 2022 16:12:00 +0200 Subject: [PATCH] mesa/st: do not use memcpy when using compressed fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Soroush Kashani Part-of: --- src/mesa/state_tracker/st_cb_texture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index b753db0c192..f05a9788302 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -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; }