From ddb116d75517070876155bb5e050b66eaa96fa8f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 24 Feb 2023 11:03:57 -0500 Subject: [PATCH] zink: fix shader read access removal for barrier generation barrier access is based on total binds per gfx/compute, not per stage cc: mesa-stable Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 767abaeb0b1..9d097e49ade 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1506,8 +1506,9 @@ zink_set_constant_buffer(struct pipe_context *pctx, ALWAYS_INLINE static void unbind_descriptor_reads(struct zink_resource *res, gl_shader_stage pstage) { - if (!res->sampler_binds[pstage] && !res->image_binds[pstage]) - res->barrier_access[pstage == MESA_SHADER_COMPUTE] &= ~VK_ACCESS_SHADER_READ_BIT; + bool is_compute = pstage == MESA_SHADER_COMPUTE; + if (!res->sampler_bind_count[is_compute] && !res->image_bind_count[is_compute]) + res->barrier_access[is_compute] &= ~VK_ACCESS_SHADER_READ_BIT; } ALWAYS_INLINE static void