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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27859>
This commit is contained in:
Mike Blumenkrantz 2024-02-28 15:01:13 -05:00 committed by Marge Bot
parent f0430b095b
commit f55ed175eb

View file

@ -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",