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.
This commit is contained in:
baldurk
2022-06-07 21:05:06 +01:00
parent c81a522360
commit dc7d79a50a
@@ -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);
}