Mesa (main): zink: don't clear descriptor pool cache on context destroy

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 19 18:21:04 UTC 2021


Module: Mesa
Branch: main
Commit: 7fb8e0b9fb4707c473079f832c5bc2e9eacf6dba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fb8e0b9fb4707c473079f832c5bc2e9eacf6dba

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Oct 19 10:19:48 2021 -0400

zink: don't clear descriptor pool cache on context destroy

the final ref on pools is owned by their program struct(s), and liveshader
cache can trigger shader deletion after a context is destroyed, so
attempting to prune pools here may end up deleting them before the
last ref is actually removed

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13430>

---

 src/gallium/drivers/zink/zink_descriptors.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c
index 7bd25aaa3fb..e814d1c89b4 100644
--- a/src/gallium/drivers/zink/zink_descriptors.c
+++ b/src/gallium/drivers/zink/zink_descriptors.c
@@ -1111,10 +1111,7 @@ static void
 zink_descriptor_pool_deinit(struct zink_context *ctx)
 {
    for (unsigned i = 0; i < ZINK_DESCRIPTOR_TYPES; i++) {
-      hash_table_foreach(ctx->dd->descriptor_pools[i], entry) {
-         struct zink_descriptor_pool *pool = (void*)entry->data;
-         zink_descriptor_pool_reference(ctx, &pool, NULL);
-      }
+      /* do not free: programs own these pools */
       _mesa_hash_table_destroy(ctx->dd->descriptor_pools[i], NULL);
    }
 }



More information about the mesa-commit mailing list