From f0762f003d9e091a8da65406f21a631f9e98e8c4 Mon Sep 17 00:00:00 2001 From: Igor Torrente Date: Thu, 28 Sep 2023 12:26:25 -0400 Subject: [PATCH] zink: fix for startup crash of weston running on top of zink + venus Venus asserts if we are transitioning to/from `VK_IMAGE_LAYOUT_PRESENT_SRC_KHR` if we are not dealing with a wsi image. Now we detects this case and avoid transition the layout in this case. Signed-off-by: Igor Torrente Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 7f3efca517c..37ccf447ed6 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3718,8 +3718,9 @@ zink_flush(struct pipe_context *pctx, #ifdef HAVE_RENDERDOC_APP_H p_atomic_inc(&screen->renderdoc_frame); #endif - if (ctx->needs_present && ctx->needs_present->obj->image) - zink_screen(ctx->base.screen)->image_barrier(ctx, ctx->needs_present, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, 0, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT); + if (ctx->needs_present && ctx->needs_present->obj->image && + zink_is_swapchain(ctx->needs_present)) + screen->image_barrier(ctx, ctx->needs_present, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, 0, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT); ctx->needs_present = NULL; }