mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Create an implicit vkUnmapMemory() in vkFreeMemory() (Refs #179)
* It's legal to free memory while still mapped and this should be handled, so here we clean up any mapped state that's present when destroying a memory resource record.
This commit is contained in:
@@ -288,6 +288,18 @@ void WrappedVulkan::vkFreeMemory(
|
||||
|
||||
VkDeviceMemory unwrappedMem = wrapped->real.As<VkDeviceMemory>();
|
||||
|
||||
// there is an implicit unmap on free, so make sure to tidy up
|
||||
if(wrapped->record->memMapState && wrapped->record->memMapState->refData)
|
||||
Serialiser::FreeAlignedBuffer(wrapped->record->memMapState->refData);
|
||||
|
||||
{
|
||||
SCOPED_LOCK(m_CoherentMapsLock);
|
||||
|
||||
auto it = std::find(m_CoherentMaps.begin(), m_CoherentMaps.end(), wrapped->record);
|
||||
if(it != m_CoherentMaps.end())
|
||||
m_CoherentMaps.erase(it);
|
||||
}
|
||||
|
||||
GetResourceManager()->ReleaseWrappedResource(memory);
|
||||
|
||||
ObjDisp(device)->FreeMemory(Unwrap(device), unwrappedMem, pAllocator);
|
||||
|
||||
Reference in New Issue
Block a user