Module: Mesa Branch: staging/23.1 Commit: d55b6ae40d8678cb03accb6b2ee6797417e2f5f7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d55b6ae40d8678cb03accb6b2ee6797417e2f5f7
Author: Mike Blumenkrantz <[email protected]> Date: Thu Jul 13 10:33:58 2023 -0400 zink: be even dumber about buffer refs when replacing storage these extra checks can cause issues when multiple contexts and transfer ops are involved cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24141> (cherry picked from commit d744bb5bfc4b347adeb9afb1a806e5d4ea7e634f) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 5e19e48cbdf..ad92b02e61b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -337,7 +337,7 @@ "description": "zink: be even dumber about buffer refs when replacing storage", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index de1a93f3523..d928a9bf555 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -4706,9 +4706,7 @@ zink_context_replace_buffer_storage(struct pipe_context *pctx, struct pipe_resou assert(d->obj); assert(s->obj); util_idalloc_mt_free(&screen->buffer_ids, delete_buffer_id); - /* add a ref just like check_resource_for_batch_ref() would've */ - if (zink_resource_has_binds(d) && zink_resource_has_usage(d)) - zink_batch_reference_resource(&ctx->batch, d); + zink_batch_reference_resource(&ctx->batch, d); /* don't be too creative */ zink_resource_object_reference(screen, &d->obj, s->obj); d->valid_buffer_range = s->valid_buffer_range;
