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

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 22 07:05:00 UTC 2021


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

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/13350>
(cherry picked from commit 497ce3c38a498d0f0aada7303d258bee4c0fd05b)

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/zink/zink_context.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index b180f0ee69c..3ac2f454a42 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1237,7 +1237,7 @@
         "description": "zink: clear descriptor refs on buffer replacement",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "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 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