Serialise vkMap offset before replaying MapMemory, so it includes offset

This commit is contained in:
baldurk
2017-11-09 15:11:04 +00:00
parent 35801dcd72
commit 92ec567e9e
@@ -593,6 +593,8 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(SerialiserType &ser, VkDevice device
MapData = (byte *)state->mappedPtr + MapOffset;
}
SERIALISE_ELEMENT(MapOffset);
if(IsReplayingAndReading())
{
VkResult vkr = ObjDisp(device)->MapMemory(Unwrap(device), Unwrap(memory), MapOffset, MapSize, 0,
@@ -601,8 +603,6 @@ bool WrappedVulkan::Serialise_vkUnmapMemory(SerialiserType &ser, VkDevice device
RDCERR("Error mapping memory on replay: %s", ToStr(vkr).c_str());
}
SERIALISE_ELEMENT(MapOffset);
// not using SERIALISE_ELEMENT_ARRAY so we can deliberately avoid allocation - we serialise
// directly into upload memory
ser.Serialise("MapData", MapData, MapSize, SerialiserFlags::NoFlags);