zink: skip attachment barrier for redundant layout-setting if !valid

an invalidated image doesn't need synchronization, so this can be skipped

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
This commit is contained in:
Mike Blumenkrantz 2023-02-27 11:05:06 -05:00 committed by Marge Bot
parent 1694678294
commit 5b64d7267b

View file

@ -2868,7 +2868,8 @@ zink_prep_fb_attachment(struct zink_context *ctx, struct zink_surface *surf, uns
else if (!zink_screen(ctx->base.screen)->info.have_EXT_attachment_feedback_loop_layout &&
layout == VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT)
layout = VK_IMAGE_LAYOUT_GENERAL;
zink_screen(ctx->base.screen)->image_barrier(ctx, res, layout, access, pipeline);
if (res->valid || res->layout != layout)
zink_screen(ctx->base.screen)->image_barrier(ctx, res, layout, access, pipeline);
res->obj->unordered_read = res->obj->unordered_write = false;
if (i == ctx->fb_state.nr_cbufs && res->sampler_bind_count[0])
update_res_sampler_layouts(ctx, res);