zink: fix tc buffer replacement rebind condition

this check is to detect multi-context rebinds, not to determine whether
all rebinds on the same context were successful

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36473>
(cherry picked from commit f1ba8f44d9)
This commit is contained in:
Mike Blumenkrantz 2025-07-30 13:40:57 -04:00 committed by Eric Engestrom
parent a94410a1c6
commit 73e06731df
2 changed files with 3 additions and 2 deletions

View file

@ -7824,7 +7824,7 @@
"description": "zink: fix tc buffer replacement rebind condition",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -5299,7 +5299,8 @@ zink_context_replace_buffer_storage(struct pipe_context *pctx, struct pipe_resou
num_rebinds = d->bind_count[0] + d->bind_count[1];
rebind_mask = 0;
}
if (num_rebinds && rebind_buffer(ctx, d, rebind_mask, num_rebinds) < num_rebinds)
unsigned rebind_count = num_rebinds ? rebind_buffer(ctx, d, rebind_mask, num_rebinds) : 0;
if (rebind_count != d->bind_count[0] + d->bind_count[1])
ctx->buffer_rebind_counter = p_atomic_inc_return(&screen->buffer_rebind_counter);
}