v3d: fix stencil blit layer selection

The stencil blit path used PIPE_TEXTURE_3D directly as a ternary
condition when computing the last layer. This tests the enum constant
itself rather than the resource target, so the 3D branch is always
selected.

Check src->base.target instead so non-3D stencil resources use their
array size when selecting the layer range.

Fixes: ac207acb97 ("broadcom/vc5: Implement stencil blits using RGBA.")
Signed-off-by: yserrr <dlwognsdc610@naver.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42054>
This commit is contained in:
yserrr 2026-06-06 00:57:00 +00:00 committed by Marge Bot
parent d24599ee21
commit 3bf366f349

View file

@ -204,7 +204,7 @@ v3d_stencil_blit(struct pipe_context *ctx, struct pipe_blit_info *info)
.first_level = info->src.level,
.last_level = info->src.level,
.first_layer = 0,
.last_layer = (PIPE_TEXTURE_3D ?
.last_layer = ((src->base.target == PIPE_TEXTURE_3D) ?
u_minify(src->base.depth0,
info->src.level) - 1 :
src->base.array_size - 1),