mesa: consider Attrib.MinLayer in do_blit_framebuffer

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 <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38925>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2025-12-12 11:04:28 +01:00 committed by Marge Bot
parent 13783fe2ef
commit f521a6270b

View file

@ -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)