From 7fb8e0b9fb4707c473079f832c5bc2e9eacf6dba Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 19 Oct 2021 10:19:48 -0400 Subject: [PATCH] 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 Part-of: --- 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 7bd25aa..e814d1c 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); } } -- 2.7.4