zink: don't clear descriptor pool cache on context destroy
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 19 Oct 2021 14:19:48 +0000 (10:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 Oct 2021 18:07:00 +0000 (18:07 +0000)
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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13430>

src/gallium/drivers/zink/zink_descriptors.c

index 7bd25aa..e814d1c 100644 (file)
@@ -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);
    }
 }