From f521a6270b8c2c95ec50a85bae5f73ded0ebc16d Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 12 Dec 2025 11:04:28 +0100 Subject: [PATCH] mesa: consider Attrib.MinLayer in do_blit_framebuffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise a blit from a fbo with a GL_COLOR_ATTACHMENT0 using a GL_TEXTURE_2D view of a GL_TEXTURE_2D_ARRAY will always read from layer 0. See https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/1060 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13527 Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/blit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c index e15ddfb718f..e8833d39e37 100644 --- a/src/mesa/main/blit.c +++ b/src/mesa/main/blit.c @@ -532,7 +532,8 @@ do_blit_framebuffer(struct gl_context *ctx, blit.src.resource = srcObj->pt; blit.src.level = srcAtt->TextureLevel; - blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace; + blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace + + srcAtt->Texture->Attrib.MinLayer; blit.src.format = srcObj->surface_based ? srcObj->surface_format : srcObj->pt->format; if (!ctx->Color.sRGBEnabled)