Mesa (20.3): anv: fix descriptor pool leak in VMA object
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Dec 1 17:45:02 UTC 2020
Module: Mesa
Branch: 20.3
Commit: bf76f2b21c18c1e4a5caf9d5b3ed760da696c436
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf76f2b21c18c1e4a5caf9d5b3ed760da696c436
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Thu Nov 26 16:37:01 2020 +0200
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 at intel.com>
Fixes: 0a6d2593b8b63d ("anv: Allocate descriptor buffers from the BO cache")
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7796>
(cherry picked from commit 5d55ca9c300a6e240cf9216bba203321b7b44c90)
---
.pick_status.json | 2 +-
src/intel/vulkan/anv_descriptor_set.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 82e4bdcd4e4..b10cdf3ba7a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1912,7 +1912,7 @@
"description": "anv: fix descriptor pool leak in VMA object",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "0a6d2593b8b63d2429e79eed900848c5c9a522c9"
},
diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index a0a45405d6b..e3895a77234 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -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);
More information about the mesa-commit
mailing list