From 566aaed09424e349491c65a7762b83153a63f8c3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sat, 18 Jun 2022 09:41:43 -0400 Subject: [PATCH] zink: track image binds track all the things Acked-by: Dave Airlie Reviewed-By: Tatsuyuki Ishi Part-of: --- src/gallium/drivers/zink/zink_context.c | 2 ++ src/gallium/drivers/zink/zink_resource.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 252654243db..db7441de53e 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1371,6 +1371,7 @@ unbind_shader_image(struct zink_context *ctx, enum pipe_shader_type stage, unsig return; struct zink_resource *res = zink_resource(image_view->base.resource); + res->image_binds[stage] &= ~BITFIELD_BIT(slot); unbind_shader_image_counts(ctx, res, is_compute, image_view->base.access & PIPE_IMAGE_ACCESS_WRITE); if (image_view->base.resource->target == PIPE_BUFFER) { @@ -1505,6 +1506,7 @@ zink_set_shader_images(struct pipe_context *pctx, zink_resource_access_is_write(access)); update = true; update_descriptor_state_image(ctx, p_stage, start_slot + i, res); + res->image_binds[p_stage] |= BITFIELD_BIT(start_slot + i); } else if (image_view->base.resource) { update = true; diff --git a/src/gallium/drivers/zink/zink_resource.h b/src/gallium/drivers/zink/zink_resource.h index 228edbf5a8d..ff24426ddfd 100644 --- a/src/gallium/drivers/zink/zink_resource.h +++ b/src/gallium/drivers/zink/zink_resource.h @@ -136,6 +136,7 @@ struct zink_resource { }; }; uint32_t sampler_binds[PIPE_SHADER_TYPES]; + uint32_t image_binds[PIPE_SHADER_TYPES]; uint16_t image_bind_count[2]; //gfx, compute uint16_t write_bind_count[2]; //gfx, compute uint16_t bindless[2]; //tex, img