zink: unbind the ssbo slot being iterated, not the index of the buffer

this otherwise breaks ssbo binding

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>
(cherry picked from commit 5149b2a938)
This commit is contained in:
Mike Blumenkrantz 2023-05-08 16:31:58 -04:00 committed by Dylan Baker
parent 818dffc733
commit c7ceec871f
2 changed files with 4 additions and 4 deletions

View file

@ -4544,7 +4544,7 @@
"description": "zink: unbind the ssbo slot being iterated, not the index of the buffer",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -1542,8 +1542,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);
@ -1575,7 +1575,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);