mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 21:40:41 +00:00
Free memory for initial states, and our own command pool
This commit is contained in:
@@ -411,8 +411,24 @@ WrappedVulkan::~WrappedVulkan()
|
||||
|
||||
// VKTODOLOW shutdown order is really up in the air
|
||||
for(size_t i=0; i < m_PhysicalReplayData.size(); i++)
|
||||
{
|
||||
SAFE_DELETE(m_PhysicalReplayData[i].debugMan);
|
||||
|
||||
if(m_PhysicalReplayData[i].cmdpool != VK_NULL_HANDLE)
|
||||
{
|
||||
ObjDisp(m_PhysicalReplayData[i].dev)->DestroyCommandPool(Unwrap(m_PhysicalReplayData[i].dev), Unwrap(m_PhysicalReplayData[i].cmdpool));
|
||||
GetResourceManager()->ReleaseWrappedResource(m_PhysicalReplayData[i].cmdpool);
|
||||
}
|
||||
}
|
||||
|
||||
VkDevice dev = GetDev();
|
||||
for(size_t i=0; i < m_FreeMems.size(); i++)
|
||||
{
|
||||
ObjDisp(dev)->FreeMemory(Unwrap(dev), Unwrap(m_FreeMems[i]));
|
||||
GetResourceManager()->ReleaseWrappedResource(m_FreeMems[i]);
|
||||
}
|
||||
m_FreeMems.clear();
|
||||
|
||||
m_ResourceManager->Shutdown();
|
||||
delete m_ResourceManager;
|
||||
|
||||
|
||||
@@ -190,6 +190,8 @@ private:
|
||||
};
|
||||
vector<ReplayData> m_PhysicalReplayData;
|
||||
int m_SwapPhysDevice;
|
||||
|
||||
vector<VkDeviceMemory> m_FreeMems;
|
||||
|
||||
VulkanDebugManager *GetDebugManager()
|
||||
{ RDCASSERT(m_SwapPhysDevice >= 0); return m_PhysicalReplayData[m_SwapPhysDevice].debugMan; }
|
||||
|
||||
@@ -368,7 +368,8 @@ bool WrappedVulkan::Serialise_InitialState(WrappedVkRes *res)
|
||||
|
||||
SAFE_DELETE_ARRAY(data);
|
||||
|
||||
// VKTODOMED leaking the memory here! needs to be cleaned up with the buffer
|
||||
m_FreeMems.push_back(mem);
|
||||
|
||||
GetResourceManager()->SetInitialContents(id, VulkanResourceManager::InitialContentData(GetWrapped(buf), eInitialContents_Copy, NULL));
|
||||
}
|
||||
else if(type == eResImage)
|
||||
|
||||
Reference in New Issue
Block a user