mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 16:28:08 +02:00
zink: always invalidate descriptor sets on pool free
this used to be bad and only for debugging, but now it's good and useful for saving memory Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13430>
This commit is contained in:
parent
94fc6b0875
commit
6a852e4e06
1 changed files with 4 additions and 5 deletions
|
|
@ -252,13 +252,14 @@ descriptor_set_invalidate(struct zink_descriptor_set *zds)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
static void
|
||||
descriptor_pool_clear(struct hash_table *ht)
|
||||
{
|
||||
_mesa_hash_table_clear(ht, NULL);
|
||||
hash_table_foreach(ht, entry) {
|
||||
struct zink_descriptor_set *zds = entry->data;
|
||||
descriptor_set_invalidate(zds);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
descriptor_pool_free(struct zink_screen *screen, struct zink_descriptor_pool *pool)
|
||||
|
|
@ -269,12 +270,10 @@ descriptor_pool_free(struct zink_screen *screen, struct zink_descriptor_pool *po
|
|||
VKSCR(DestroyDescriptorPool)(screen->dev, pool->descpool, NULL);
|
||||
|
||||
simple_mtx_lock(&pool->mtx);
|
||||
#ifndef NDEBUG
|
||||
if (pool->desc_sets)
|
||||
descriptor_pool_clear(pool->desc_sets);
|
||||
if (pool->free_desc_sets)
|
||||
descriptor_pool_clear(pool->free_desc_sets);
|
||||
#endif
|
||||
if (pool->desc_sets)
|
||||
_mesa_hash_table_destroy(pool->desc_sets, NULL);
|
||||
if (pool->free_desc_sets)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue