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 <igor.torrente@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25423>
This commit is contained in:
Igor Torrente 2023-09-28 12:26:25 -04:00 committed by Marge Bot
parent 59ea386065
commit f0762f003d

View file

@ -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;
}