diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2024-03-20 10:36:36 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-03-20 21:55:55 +0000 |
commit | 6ec1e322f0a9bb211fe0b9b6703f94bc35513cb9 (patch) | |
tree | 0366e827e44fbf66f6e90c408ab5fe0bf83f0881 | |
parent | 5ee8fd6b497ce0cbabac199e6e922085b547857a (diff) |
anv: don't leak device->vma_samplers
The vma_samplers vma heap is initialized unconditionally. Don't use
device->physical->indirect_descriptors as a condition on whether to
free it or not.
From my TGL machine:
==373617== 32 bytes in 1 blocks are definitely lost in loss record 1 of 1
==373617== at 0x48459F3: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==373617== by 0x6926DC0: util_vma_heap_free (vma.c:339)
==373617== by 0x6925ED3: util_vma_heap_init (vma.c:53)
==373617== by 0x5334EDA: anv_CreateDevice (anv_device.c:3404)
==373617== by 0x685593A: vk_tramp_CreateDevice (vk_dispatch_trampolines.c:78)
==373617== by 0x48A6D56: terminator_CreateDevice (loader.c:5833)
==373617== by 0x9C2293F: vulkan_layer_chassis::CreateDevice(VkPhysicalDevice_T*, VkDeviceCreateInfo const*, VkAllocationCallbacks const*, VkDevice_T**) (chassis.cpp:497)
==373617== by 0x48B0690: loader_create_device_chain (loader.c:4937)
==373617== by 0x48B1327: loader_layer_create_device (loader.c:4317)
==373617== by 0x48B8D79: vkCreateDevice (trampoline.c:1004)
==373617== by 0x10CC7A: MyApp::MyApp(int, bool) (sparse.cpp:608)
==373617== by 0x1201E8: main (sparse.cpp:6025)
Fixes: 7c76125db25d ("anv: use 2 different buffers for surfaces/samplers in descriptor sets")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28303>
-rw-r--r-- | src/intel/vulkan/anv_device.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index fd4bfba08aa..be178d58ac0 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3954,8 +3954,7 @@ VkResult anv_CreateDevice( pthread_mutex_destroy(&device->mutex); fail_vmas: util_vma_heap_finish(&device->vma_trtt); - if (!device->physical->indirect_descriptors) - util_vma_heap_finish(&device->vma_samplers); + util_vma_heap_finish(&device->vma_samplers); util_vma_heap_finish(&device->vma_desc_buf); util_vma_heap_finish(&device->vma_desc); util_vma_heap_finish(&device->vma_hi); @@ -4085,8 +4084,7 @@ void anv_DestroyDevice( anv_bo_cache_finish(&device->bo_cache); util_vma_heap_finish(&device->vma_trtt); - if (!device->physical->indirect_descriptors) - util_vma_heap_finish(&device->vma_samplers); + util_vma_heap_finish(&device->vma_samplers); util_vma_heap_finish(&device->vma_desc_buf); util_vma_heap_finish(&device->vma_desc); util_vma_heap_finish(&device->vma_hi); |