Index: sdl-game.cpp
===================================================================
--- sdl-game.cpp	(revision 90880fb20c607160a5a48bacee6fd39c33e88e18)
+++ sdl-game.cpp	(revision 2f4ff8c378d4f7cbab4858c6a7dca849b7f57882)
@@ -70,5 +70,5 @@
                      , gui(nullptr)
                      , window(nullptr)
-                     , vp_mats_modelPipeline()
+                     , uniforms_modelPipeline()
                      , objects_modelPipeline()
                      , score(0)
@@ -93,6 +93,6 @@
    vkGetPhysicalDeviceProperties(physicalDevice, &deviceProperties);
 
-   vp_mats_modelPipeline = VulkanBuffer<UBO_VP_mats>(1, deviceProperties.limits.maxUniformBufferRange,
-                                                     deviceProperties.limits.minUniformBufferOffsetAlignment);
+   uniforms_modelPipeline = VulkanBuffer<UBO_VP_mats>(1, deviceProperties.limits.maxUniformBufferRange,
+                                                      deviceProperties.limits.minUniformBufferOffsetAlignment);
 
    objects_modelPipeline = VulkanBuffer<SSBO_ModelObject>(10, deviceProperties.limits.maxStorageBufferRange,
@@ -114,14 +114,18 @@
    modelPipeline.addAttribute(VK_FORMAT_R32_UINT, offset_of(&ModelVertex::objIndex));
 
-   createBufferSet(vp_mats_modelPipeline.memorySize(),
+   createBufferSet(uniforms_modelPipeline.memorySize(),
                    VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
-                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
+                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
                    uniformBuffers_modelPipeline);
+
+   uniforms_modelPipeline.map(uniformBuffers_modelPipeline.memory, device);
 
    createBufferSet(objects_modelPipeline.memorySize(),
                    VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT
                    | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
-                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
+                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
                    storageBuffers_modelPipeline);
+
+   objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
 
    modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
@@ -445,6 +449,6 @@
 
 void VulkanGame::updateScene() {
-   vp_mats_modelPipeline.data()->view = viewMat;
-   vp_mats_modelPipeline.data()->proj = projMat;
+   uniforms_modelPipeline.data()->view = viewMat;
+   uniforms_modelPipeline.data()->proj = projMat;
 
    // TODO: Probably move the resizing to the VulkanBuffer class's add() method
@@ -453,6 +457,10 @@
 
    if (objects_modelPipeline.resized) {
+      objects_modelPipeline.unmap(storageBuffers_modelPipeline.memory, device);
+
       resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline.memorySize(), resourceCommandPool,
                       graphicsQueue, true);
+
+      objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
 
       objects_modelPipeline.resize();
@@ -474,9 +482,11 @@
    }
 
-   VulkanUtils::copyDataToMemory(device, vp_mats_modelPipeline.data(), uniformBuffers_modelPipeline.memory[imageIndex],
-                                 0, vp_mats_modelPipeline.memorySize(), false);
-
-   VulkanUtils::copyDataToMemory(device, objects_modelPipeline.data(), storageBuffers_modelPipeline.memory[imageIndex],
-                                 0, objects_modelPipeline.memorySize(), false);
+   VulkanUtils::copyDataToMappedMemory(device, uniforms_modelPipeline.data(), uniforms_modelPipeline.mapped(imageIndex),
+                                       uniformBuffers_modelPipeline.memory[imageIndex],
+                                       uniforms_modelPipeline.memorySize(), true);
+
+   VulkanUtils::copyDataToMappedMemory(device, objects_modelPipeline.data(), objects_modelPipeline.mapped(imageIndex),
+                                       storageBuffers_modelPipeline.memory[imageIndex],
+                                       objects_modelPipeline.memorySize(), true);
 }
 
@@ -1282,14 +1292,18 @@
    createSyncObjects();
 
-   createBufferSet(vp_mats_modelPipeline.memorySize(),
+   createBufferSet(uniforms_modelPipeline.memorySize(),
                    VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
-                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
+                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
                    uniformBuffers_modelPipeline);
+
+   uniforms_modelPipeline.map(uniformBuffers_modelPipeline.memory, device);
 
    createBufferSet(objects_modelPipeline.memorySize(),
                    VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT
                    | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
-                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
+                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
                    storageBuffers_modelPipeline);
+
+   objects_modelPipeline.map(storageBuffers_modelPipeline.memory, device);
 
    modelPipeline.updateRenderPass(renderPass);
@@ -1315,8 +1329,12 @@
    modelPipeline.cleanup();
 
+   uniforms_modelPipeline.unmap(uniformBuffers_modelPipeline.memory, device);
+
    for (size_t i = 0; i < uniformBuffers_modelPipeline.buffers.size(); i++) {
       vkDestroyBuffer(device, uniformBuffers_modelPipeline.buffers[i], nullptr);
       vkFreeMemory(device, uniformBuffers_modelPipeline.memory[i], nullptr);
    }
+
+   objects_modelPipeline.unmap(storageBuffers_modelPipeline.memory, device);
 
    for (size_t i = 0; i < storageBuffers_modelPipeline.buffers.size(); i++) {
