From f55ed175ebfd931c0ade98bee30f3880f896bc6b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 28 Feb 2024 15:01:13 -0500 Subject: [PATCH] zink: fix stencil-only blitting with stencil fallback these shouldn't do extra depth blits fixes (nvidia): dEQP-GLES3.functional.fbo.blit.depth_stencil.depth24_stencil8_stencil_only,Fail dEQP-GLES3.functional.fbo.blit.depth_stencil.depth32f_stencil8_stencil_only,Fail spec@arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit stencil gl_depth24_stencil8,Fail cc: mesa-stable Part-of: --- src/gallium/drivers/zink/zink_blit.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/zink/zink_blit.c b/src/gallium/drivers/zink/zink_blit.c index f82fe1d954e..f74921a2a1a 100644 --- a/src/gallium/drivers/zink/zink_blit.c +++ b/src/gallium/drivers/zink/zink_blit.c @@ -362,13 +362,20 @@ zink_blit(struct pipe_context *pctx, bool stencil_blit = false; if (!util_blitter_is_blit_supported(ctx->blitter, info)) { if (util_format_is_depth_or_stencil(info->src.resource->format)) { - struct pipe_blit_info depth_blit = *info; - depth_blit.mask = PIPE_MASK_Z; - stencil_blit = util_blitter_is_blit_supported(ctx->blitter, &depth_blit); - if (stencil_blit) { - zink_blit_begin(ctx, ZINK_BLIT_SAVE_FB | ZINK_BLIT_SAVE_FS | ZINK_BLIT_SAVE_TEXTURES); - util_blitter_blit(ctx->blitter, &depth_blit); + if (info->mask & PIPE_MASK_Z) { + struct pipe_blit_info depth_blit = *info; + depth_blit.mask = PIPE_MASK_Z; + if (util_blitter_is_blit_supported(ctx->blitter, &depth_blit)) { + zink_blit_begin(ctx, ZINK_BLIT_SAVE_FB | ZINK_BLIT_SAVE_FS | ZINK_BLIT_SAVE_TEXTURES); + util_blitter_blit(ctx->blitter, &depth_blit); + } else { + mesa_loge("ZINK: depth blit unsupported %s -> %s", + util_format_short_name(info->src.resource->format), + util_format_short_name(info->dst.resource->format)); + } } + if (info->mask & PIPE_MASK_S) + stencil_blit = true; } if (!stencil_blit) { mesa_loge("ZINK: blit unsupported %s -> %s",