From 58ed06ad68d5b8cc46dc8b022fa0c35065b1e462 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 13 Aug 2025 11:23:51 -0400 Subject: [PATCH] zink: only remove buffer deferred sync on release this is otherwise just a huge amount of overhead whenever descriptors are unbound Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index acb302d09b6..1f02ca042b2 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1337,6 +1337,8 @@ resource_release(struct zink_context *ctx, struct zink_resource *res) { if (zink_resource_has_usage(res) && !zink_resource_usage_check_completion_fast(zink_screen(ctx->base.screen), res, ZINK_RESOURCE_ACCESS_RW)) zink_batch_reference_resource(ctx, res); + _mesa_set_remove_key(ctx->need_barriers[0], res); + _mesa_set_remove_key(ctx->need_barriers[1], res); zink_resource_reference(&res, NULL); } @@ -1359,8 +1361,7 @@ update_buf_bind_count(struct zink_context *ctx, struct zink_resource *res, bool assert(res->obj->is_buffer); if (decrement) { assert(res->bind_count[is_compute]); - if (!--res->bind_count[is_compute]) - _mesa_set_remove_key(ctx->need_barriers[is_compute], res); + --res->bind_count[is_compute]; /* if hit while blitting, this will be triggered again after blitting */ if (res->deleted && !res->all_binds && !ctx->blitting) resource_release(ctx, res);