In Device.cpp, MapBuffer completely ignores offset creating issues if you are mapping a region of a buffer.
Replace with something more like this:
VkResult Device::MapBuffer(Buffer* pBuffer, VkDeviceSize offset, VkDeviceSize size, void** ppData)
{
uint8_t* mem = nullptr;
VkResult result = vmaMapMemory(m_memAllocator, pBuffer->GetAllocation(), (void**)&mem);
if ( mem && ppData )
{
*ppData = ( mem + offset );
}
return result;
}
In Device.cpp, MapBuffer completely ignores offset creating issues if you are mapping a region of a buffer.
Replace with something more like this: