Mesa (main): zink: only trigger deferred present barrier if swapchain has acquired

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 8 20:04:09 UTC 2022


Module: Mesa
Branch: main
Commit: f0a3a4d2f1080b073d0340be97b79d53d059cf94
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0a3a4d2f1080b073d0340be97b79d53d059cf94

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Apr  8 09:28:52 2022 -0400

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 <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15820>

---

 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) {



More information about the mesa-commit mailing list