Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tu: Fix memory leaks on VK_PIPELINE_COMPILE_REQUIRED
For a TU_PIPELINE_GRAPHICS_LIB we were taking a ref to the descriptor set layout but never releasing on VK_PIPELINE_COMPILE_REQUIRED. Since VK_PIPELINE_COMPILE_REQUIRED is technically an error, the user doesn't call vkDestroyPipeline() for it so the descriptor sets referenced were never getting freed. Addresses: ``` Direct leak of 304 byte(s) in 1 object(s) allocated from: #0 0x7fa5a93ee0 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 waydroid#1 0x7fa44bac84 in vk_default_alloc ../src/vulkan/util/vk_alloc.c:26 waydroid#2 0x7fa32ea5d8 in vk_alloc ../src/vulkan/util/vk_alloc.h:48 waydroid#3 0x7fa32ea60c in vk_zalloc ../src/vulkan/util/vk_alloc.h:56 waydroid#4 0x7fa32ea750 in vk_descriptor_set_layout_zalloc ../src/vulkan/runtime/vk_descriptor_set_layout.c:49 waydroid#5 0x7fa306fc98 in tu_CreateDescriptorSetLayout(VkDevice_T*, VkDescriptorSetLayoutCreateInfo const*, VkAllocationCallbacks const*, VkDescriptorSetLayout_T**) ../src/freedreno/vulkan/tu_descriptor_set.cc:161 ``` and ``` Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f9b4b3ee0 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 waydroid#1 0x7f9925e900 in ralloc_size ../src/util/ralloc.c:118 waydroid#2 0x7f9925e8d4 in ralloc_context ../src/util/ralloc.c:105 waydroid#3 0x7f98b4b214 in tu_pipeline_builder_build<(chip)7> ../src/freedreno/vulkan/tu_pipeline.cc:3898 waydroid#4 0x7f98b46bd8 in tu_graphics_pipeline_create<(chip)7> ../src/freedreno/vulkan/tu_pipeline.cc:4203 waydroid#5 0x7f98b22588 in VkResult tu_CreateGraphicsPipelines<(chip)7>(VkDevice_T*, VkPipelineCache_T*, unsigned int, VkGraphicsPipelineCreateInfo const*, VkAllocationCallbacks const*, VkPipeline_T**) ../src/freedreno/vulkan/tu_pipeline.cc:4234 ``` seen in: dEQP-VK.pipeline.pipeline_library.shader_module_identifier.pipeline_from_id.graphics.4_variants.no_spec_constants.no_pipeline_cache.all_zeros_id.no_exec_properties.vert_tesc_tese_frag Cc: mesa-stable Signed-off-by: Karmjit Mahil <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32188> (cherry picked from commit 21baf2f6c1f829f7d09162d123fa726f52e800f1)
- Loading branch information