st/mesa: consider texture view format for fbo blits
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 7 Jan 2021 14:50:03 +0000 (15:50 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 13 Jan 2021 08:33:49 +0000 (09:33 +0100)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4034
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8387>

src/mesa/state_tracker/st_cb_blit.c

index fd82a7f..526fb7e 100644 (file)
@@ -196,7 +196,7 @@ st_BlitFramebuffer(struct gl_context *ctx,
          blit.src.resource = srcObj->pt;
          blit.src.level = srcAtt->TextureLevel;
          blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace;
-         blit.src.format = srcObj->pt->format;
+         blit.src.format = srcObj->surface_based ? srcObj->surface_format : srcObj->pt->format;
 
          if (!ctx->Color.sRGBEnabled)
             blit.src.format = util_format_linear(blit.src.format);