From 4d0650d18809865f50fbc591fa3eeee3ff58221e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 13 Aug 2025 10:47:56 -0400 Subject: [PATCH] zink: fix image sync deferral each of these cases wasn't actually checking what the comment claimed it was checking, which would add unnecessary deferred sync Part-of: --- src/gallium/drivers/zink/zink_synchronization.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_synchronization.cpp b/src/gallium/drivers/zink/zink_synchronization.cpp index 107b5320e7c..9714b82d442 100644 --- a/src/gallium/drivers/zink/zink_synchronization.cpp +++ b/src/gallium/drivers/zink/zink_synchronization.cpp @@ -199,7 +199,7 @@ resource_defer_image_barrier(struct zink_context *ctx, struct zink_resource *res if (res->bind_count[!is_compute]) _mesa_set_add(ctx->need_barriers[!is_compute], res); /* also queue a layout change if this is a non-shader layout */ - if (res->bind_count[is_compute] && !is_shader) + if (res->bind_count[is_compute] && !is_shader && !is_compute) _mesa_set_add(ctx->need_barriers[is_compute], res); } @@ -215,7 +215,7 @@ resource_check_defer_image_barrier(struct zink_context *ctx, struct zink_resourc !res->bind_count[!is_compute] && (!is_compute || !res->fb_bind_count)) return; - if (res->bind_count[!is_compute] && is_shader) { + if ((res->bind_count[1] && is_shader) || (res->bind_count[0] && is_compute)) { /* if the layout is the same between gfx and compute, do nothing */ if (layout == zink_descriptor_util_image_layout_eval(ctx, res, !is_compute)) return;