From dc7d79a50a09026f121fc8590f46e2416bb2a7ad Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 7 Jun 2022 21:05:06 +0100 Subject: [PATCH] Resetting command pools should free in-flight recording pages * Command buffers that have grabbed pages in their allocators should have those pages freed if the pool is reset and the command buffer is never ended. --- renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index 9947f25f1..d74d7c691 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -782,6 +782,16 @@ VkResult WrappedVulkan::vkResetCommandPool(VkDevice device, VkCommandPool cmdPoo if(Atomic::CmpExch32(&m_ReuseEnabled, 1, 1) == 1) GetRecord(cmdPool)->cmdPoolInfo->pool.Reset(); + { + VkResourceRecord *poolRecord = GetRecord(cmdPool); + poolRecord->LockChunks(); + for(auto it = poolRecord->pooledChildren.begin(); it != poolRecord->pooledChildren.end(); ++it) + { + (*it)->cmdInfo->alloc.Reset(); + } + poolRecord->UnlockChunks(); + } + return ObjDisp(device)->ResetCommandPool(Unwrap(device), Unwrap(cmdPool), flags); }