anv: fix descriptor pool leak in VMA object

Quoting the spec :

   "When a pool is destroyed, all descriptor sets allocated from the
    pool are implicitly freed and become invalid. Descriptor sets
    allocated from a given pool do not need to be freed before
    destroying that descriptor pool."

This implies we might leak nodes allocated in the vma object.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0a6d2593b8 ("anv: Allocate descriptor buffers from the BO cache")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7796>
This commit is contained in:
Lionel Landwerlin
2020-11-26 16:37:01 +02:00
committed by Marge Bot
parent df940760f9
commit 5d55ca9c30

View File

@@ -909,8 +909,10 @@ void anv_DestroyDescriptorPool(
anv_descriptor_set_layout_unref(device, set->layout);
}
if (pool->bo)
if (pool->bo) {
util_vma_heap_finish(&pool->bo_heap);
anv_device_release_bo(device, pool->bo);
}
anv_state_stream_finish(&pool->surface_state_stream);
vk_object_base_finish(&pool->base);