zink: defer present barrier to flush if a clear is pending

this otherwise submits the swapchain with the wrong layout

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28214>
This commit is contained in:
Mike Blumenkrantz 2024-03-15 15:16:14 -04:00 committed by Marge Bot
parent 7e686fa417
commit 1670c40557

View file

@ -4163,7 +4163,7 @@ zink_flush_resource(struct pipe_context *pctx,
struct zink_context *ctx = zink_context(pctx);
struct zink_resource *res = zink_resource(pres);
if (res->obj->dt) {
if (zink_kopper_acquired(res->obj->dt, res->obj->dt_idx)) {
if (zink_kopper_acquired(res->obj->dt, res->obj->dt_idx) && (!ctx->clears_enabled || !res->fb_bind_count)) {
zink_batch_no_rp_safe(ctx);
zink_kopper_readback_update(ctx, res);
zink_screen(ctx->base.screen)->image_barrier(ctx, res, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, 0, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT);