From f0a3a4d2f1080b073d0340be97b79d53d059cf94 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 8 Apr 2022 09:28:52 -0400 Subject: [PATCH] zink: only trigger deferred present barrier if swapchain has acquired otherwise this was just pointlessly flushed by the frontend and can be ignored Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 36b3a3cf8bf..30f461c146f 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3247,7 +3247,8 @@ zink_flush(struct pipe_context *pctx, zink_begin_render_pass(ctx); if (ctx->needs_present && (flags & PIPE_FLUSH_END_OF_FRAME)) { - zink_resource_image_barrier(ctx, ctx->needs_present, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, 0, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT); + if (ctx->needs_present->obj->image) + zink_resource_image_barrier(ctx, ctx->needs_present, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, 0, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT); } if (!batch->has_work) {