From 5b64d7267b30175b7490b759e50edb77a146f10c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 27 Feb 2023 11:05:06 -0500 Subject: [PATCH] zink: skip attachment barrier for redundant layout-setting if !valid an invalidated image doesn't need synchronization, so this can be skipped Part-of: --- 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 1f3be4d..a677714 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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); -- 2.7.4