zink: clear descriptor refs on buffer replacement

the bo here can only ever be destroyed before it gets reused, so prune
it from the descriptor cache immediately

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13350>
This commit is contained in:
Mike Blumenkrantz 2021-10-12 14:03:51 -04:00 committed by Marge Bot
parent e66558985a
commit 497ce3c38a
1 changed files with 1 additions and 0 deletions

View File

@ -3973,6 +3973,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);
zink_descriptor_set_refs_clear(&d->obj->desc_set_refs, d->obj);
/* 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);