Fixes for coherent persistent maps and multiple frame capture

This commit is contained in:
baldurk
2016-02-07 18:44:46 +01:00
parent 0d66a78105
commit da447ba5d9
2 changed files with 14 additions and 0 deletions
+6
View File
@@ -619,6 +619,12 @@ void WrappedVulkan::FinishCapture()
//m_SuccessfulCapture = false;
ObjDisp(GetDev())->DeviceWaitIdle(Unwrap(GetDev()));
{
SCOPED_LOCK(m_CurrentMapsLock);
for(auto it = m_CurrentMaps.begin(); it != m_CurrentMaps.end(); ++it)
SAFE_DELETE_ARRAY(it->second.refData);
}
}
void WrappedVulkan::StartFrameCapture(void *dev, void *wnd)
@@ -457,10 +457,18 @@ VkResult WrappedVulkan::vkQueueSubmit(
vkFlushMappedMemoryRanges(it->second.device, 1, &range);
}
GetResourceManager()->MarkPendingDirty(it->first);
// allocate ref data so we can compare next time to minimise serialised data
if(it->second.refData == NULL)
it->second.refData = new byte[(size_t)it->second.mapSize];
memcpy(it->second.refData, it->second.mappedPtr, (size_t)it->second.mapSize);
{
SCOPED_LOCK(m_CurrentMapsLock);
m_CurrentMaps[it->first].mapFlushed = false;
m_CurrentMaps[it->first].refData = it->second.refData;
}
}
}
}