From 5149b2a938658e715a3609bd5416ce966f5d28ee Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 8 May 2023 16:31:58 -0400 Subject: [PATCH] zink: unbind the ssbo slot being iterated, not the index of the buffer this otherwise breaks ssbo binding cc: mesa-stable Part-of: --- src/gallium/drivers/zink/zink_context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index ff6e9e75e83..feb28990d2f 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1549,8 +1549,8 @@ zink_set_shader_buffers(struct pipe_context *pctx, if (buffers && buffers[i].buffer) { struct zink_resource *new_res = zink_resource(buffers[i].buffer); if (new_res != res) { - unbind_ssbo(ctx, res, p_stage, i, was_writable); - new_res->ssbo_bind_mask[p_stage] |= BITFIELD_BIT(i); + unbind_ssbo(ctx, res, p_stage, slot, was_writable); + new_res->ssbo_bind_mask[p_stage] |= BITFIELD_BIT(slot); new_res->ssbo_bind_count[p_stage == MESA_SHADER_COMPUTE]++; new_res->gfx_barrier |= zink_pipeline_flags_from_pipe_stage(p_stage); update_res_bind_count(ctx, new_res, p_stage == MESA_SHADER_COMPUTE, false); @@ -1581,7 +1581,7 @@ zink_set_shader_buffers(struct pipe_context *pctx, ssbo->buffer_offset = 0; ssbo->buffer_size = 0; if (res) { - unbind_ssbo(ctx, res, p_stage, i, was_writable); + unbind_ssbo(ctx, res, p_stage, slot, was_writable); update_descriptor_state_ssbo(ctx, p_stage, slot, NULL); } pipe_resource_reference(&ssbo->buffer, NULL);