Mesa (staging/21.3): zink: clear descriptor refs on buffer replacement

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 21 22:06:02 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: 2260fc29e6bf1147399c8a2fe5723ae4382c2877
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2260fc29e6bf1147399c8a2fe5723ae4382c2877

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Oct 12 14:03:51 2021 -0400

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 at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13429>

---

 src/gallium/drivers/zink/zink_context.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 56211a4d0ee..02edb2574f1 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -3978,6 +3978,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);



More information about the mesa-commit mailing list