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: 7c76125db2 ("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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user