From 9bc3494a831cb7a0b26670baac86c81d46b65e30 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 30 Jul 2025 13:40:57 -0400 Subject: [PATCH] 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: (cherry picked from commit f1ba8f44d99e29409cad96243eaf1fe3ad5e0f10) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 3dcc02160c0..f1c0e19e70f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3944,7 +3944,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 diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 2a553ec918b..08a636a02d8 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -5220,7 +5220,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); }