Free memory for initial states, and our own command pool

This commit is contained in:
baldurk
2015-10-16 10:54:53 +02:00
parent a9bf0a2538
commit b1b6e29162
3 changed files with 20 additions and 1 deletions
+16
View File
@@ -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;
+2
View File
@@ -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; }
+2 -1
View File
@@ -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)