diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index e20fa6196..bbcbb59fe 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -2394,6 +2394,9 @@ ReplayStatus WrappedVulkan::ReadLogInitialisation(RDCFile *rdc, bool storeStruct m_FrameReader = new StreamReader(reader, frameDataSize); + for(auto it = m_CreationInfo.m_Memory.begin(); it != m_CreationInfo.m_Memory.end(); ++it) + it->second.SimplifyBindings(); + ReplayStatus status = ContextReplayLog(m_State, 0, 0, false); if(status != ReplayStatus::Succeeded) @@ -2464,9 +2467,6 @@ ReplayStatus WrappedVulkan::ReadLogInitialisation(RDCFile *rdc, bool storeStruct FreeAllMemory(MemoryScope::IndirectReadback); - for(auto it = m_CreationInfo.m_Memory.begin(); it != m_CreationInfo.m_Memory.end(); ++it) - it->second.SimplifyBindings(); - return ReplayStatus::Succeeded; } diff --git a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp index f4c7d9cd1..2753dc966 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_resource_funcs.cpp @@ -765,7 +765,7 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(SerialiserType &ser, VkDevice device // iterate the bindings that this map region overlaps, if we overlap with any tiled memory we // need to take the slow path - while(it->finish() < finish) + while(it != bindings.end() && it->start() < finish) { if(it->value() == VulkanCreationInfo::Memory::Tiled) { @@ -806,7 +806,7 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(SerialiserType &ser, VkDevice device // iterate the bindings that this map region overlaps, and only memcpy the bits that we overlap // which are linear - while(it->finish() < finish) + while(it != bindings.end() && it->start() < finish) { if(it->value() != VulkanCreationInfo::Memory::Tiled) { @@ -968,7 +968,7 @@ bool WrappedVulkan::Serialise_vkFlushMappedMemoryRanges(SerialiserType &ser, VkD // iterate the bindings that this map region overlaps, if we overlap with any tiled memory we // need to take the slow path - while(it->finish() < finish) + while(it != bindings.end() && it->start() < finish) { if(it->value() == VulkanCreationInfo::Memory::Tiled) { @@ -1009,7 +1009,7 @@ bool WrappedVulkan::Serialise_vkFlushMappedMemoryRanges(SerialiserType &ser, VkD // iterate the bindings that this map region overlaps, and only memcpy the bits that we overlap // which are linear - while(it->finish() < finish) + while(it != bindings.end() && it->start() < finish) { if(it->value() != VulkanCreationInfo::Memory::Tiled) {