From 317ec8b5011d7d610cc0b8c05f5be28a7d818d42 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 8 Jan 2021 09:50:02 +0100 Subject: [PATCH] zink: disable render_condition_enable during blit We don't support stencil-exports yet, and even when we will, we might not support it on all hardware. So we really need an alternative plan here, even when render_condition_enable is true. Fixing this properly is much more involved, and depends on reworking render-condition along the lines that we do in !7746 to support pausing and resuming properly first. So let's do the minimal thing, which is to allow this to work in cases where no render-condition is active. Fixes: 767f70dfe13 ("gallium/util: fix util_can_blit_via_copy_region for conditional rendering") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4056 Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_blit.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_blit.c b/src/gallium/drivers/zink/zink_blit.c index 71b36d0992d..fa195d21b6a 100644 --- a/src/gallium/drivers/zink/zink_blit.c +++ b/src/gallium/drivers/zink/zink_blit.c @@ -184,8 +184,17 @@ zink_blit(struct pipe_context *pctx, struct zink_resource *src = zink_resource(info->src.resource); struct zink_resource *dst = zink_resource(info->dst.resource); /* if we're copying between resources with matching aspects then we can probably just copy_region */ - if (src->aspect == dst->aspect && util_try_blit_via_copy_region(pctx, info)) - return; + if (src->aspect == dst->aspect) { + struct pipe_blit_info new_info = *info; + + if (src->aspect & VK_IMAGE_ASPECT_STENCIL_BIT && + new_info.render_condition_enable && + !ctx->render_condition_active) + new_info.render_condition_enable = false; + + if (util_try_blit_via_copy_region(pctx, &new_info)) + return; + } if (!util_blitter_is_blit_supported(ctx->blitter, info)) { debug_printf("blit unsupported %s -> %s\n",