Index: sdl-game.cpp
===================================================================
--- sdl-game.cpp	(revision 1abebc104018213f499c401642d6470cdfa7af9a)
+++ sdl-game.cpp	(revision c163d8158510ee4d7f382dca6d405e0fbecdf4f3)
@@ -111,8 +111,8 @@
    createBufferSet(sizeof(UBO_VP_mats),
       VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
-      uniformBuffers_modelPipeline, uniformBuffersMemory_modelPipeline, uniformBufferInfoList_modelPipeline);
+      uniformBuffers_modelPipeline);
 
    modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
-      VK_SHADER_STAGE_VERTEX_BIT, &uniformBufferInfoList_modelPipeline);
+      VK_SHADER_STAGE_VERTEX_BIT, &uniformBuffers_modelPipeline.infoSet);
    modelPipeline.addDescriptorInfo(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
       VK_SHADER_STAGE_VERTEX_BIT, &storageBuffers_modelPipeline.infoSet);
@@ -275,6 +275,5 @@
       VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
       VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
-      storageBuffers_modelPipeline.buffers, storageBuffers_modelPipeline.memory,
-      storageBuffers_modelPipeline.infoSet);
+      storageBuffers_modelPipeline);
 }
 
@@ -473,9 +472,8 @@
          updateObject(modelObjects[i]);
          updateBufferSet(storageBuffers_modelPipeline, i, modelObjects[i].ssbo);
-
-      }
-   }
-
-   VulkanUtils::copyDataToMemory(device, object_VP_mats, uniformBuffersMemory_modelPipeline[imageIndex], 0);
+      }
+   }
+
+   VulkanUtils::copyDataToMemory(device, object_VP_mats, uniformBuffers_modelPipeline.memory[imageIndex], 0);
 }
 
@@ -1117,16 +1115,15 @@
 
 void VulkanGame::createBufferSet(VkDeviceSize bufferSize, VkBufferUsageFlags flags, VkMemoryPropertyFlags properties,
-                                 vector<VkBuffer>& buffers, vector<VkDeviceMemory>& buffersMemory,
-                                 vector<VkDescriptorBufferInfo>& bufferInfoList) {
-   buffers.resize(swapChainImageCount);
-   buffersMemory.resize(swapChainImageCount);
-   bufferInfoList.resize(swapChainImageCount);
+                                 BufferSet& set) {
+   set.buffers.resize(swapChainImageCount);
+   set.memory.resize(swapChainImageCount);
+   set.infoSet.resize(swapChainImageCount);
 
    for (size_t i = 0; i < swapChainImageCount; i++) {
-      VulkanUtils::createBuffer(device, physicalDevice, bufferSize, flags, properties, buffers[i], buffersMemory[i]);
-
-      bufferInfoList[i].buffer = buffers[i];
-      bufferInfoList[i].offset = 0; // This is the offset from the start of the buffer, so always 0 for now
-      bufferInfoList[i].range = bufferSize; // Size of the update starting from offset, or VK_WHOLE_SIZE
+      VulkanUtils::createBuffer(device, physicalDevice, bufferSize, flags, properties, set.buffers[i], set.memory[i]);
+
+      set.infoSet[i].buffer = set.buffers[i];
+      set.infoSet[i].offset = 0; // This is the offset from the start of the buffer, so always 0 for now
+      set.infoSet[i].range = bufferSize; // Size of the update starting from offset, or VK_WHOLE_SIZE
    }
 }
@@ -1265,5 +1262,5 @@
    createBufferSet(sizeof(UBO_VP_mats),
       VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
-      uniformBuffers_modelPipeline, uniformBuffersMemory_modelPipeline, uniformBufferInfoList_modelPipeline);
+      uniformBuffers_modelPipeline);
 
    modelPipeline.updateRenderPass(renderPass);
@@ -1289,7 +1286,7 @@
    modelPipeline.cleanup();
 
-   for (size_t i = 0; i < uniformBuffers_modelPipeline.size(); i++) {
-      vkDestroyBuffer(device, uniformBuffers_modelPipeline[i], nullptr);
-      vkFreeMemory(device, uniformBuffersMemory_modelPipeline[i], nullptr);
+   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);
    }
 
