From 74dd6e69b44f3301131961af53348c8cb96d844a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 20 Jun 2022 11:08:52 -0400 Subject: [PATCH] zink: fix image bind counting these must only be incremented if the image descriptor has changed cc: mesa-stable Reviewed-by: Dave Airlie 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 d6247d50433..aa352af493b 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1487,12 +1487,12 @@ zink_set_shader_images(struct pipe_context *pctx, if (images[i].access & PIPE_IMAGE_ACCESS_READ) { access |= VK_ACCESS_SHADER_READ_BIT; } - res->image_bind_count[p_stage == PIPE_SHADER_COMPUTE]++; if (images[i].resource->target == PIPE_BUFFER) { struct zink_buffer_view *bv = create_image_bufferview(ctx, &images[i]); assert(bv); if (image_view->buffer_view != bv) { update_res_bind_count(ctx, res, p_stage == PIPE_SHADER_COMPUTE, false); + res->image_bind_count[p_stage == PIPE_SHADER_COMPUTE]++; unbind_shader_image(ctx, p_stage, start_slot + i); } image_view->buffer_view = bv; @@ -1503,6 +1503,7 @@ zink_set_shader_images(struct pipe_context *pctx, struct zink_surface *surface = create_image_surface(ctx, &images[i], p_stage == PIPE_SHADER_COMPUTE); assert(surface); if (image_view->surface != surface) { + res->image_bind_count[p_stage == PIPE_SHADER_COMPUTE]++; update_res_bind_count(ctx, res, p_stage == PIPE_SHADER_COMPUTE, false); unbind_shader_image(ctx, p_stage, start_slot + i); }