Index: vulkan-utils.hpp
===================================================================
--- vulkan-utils.hpp	(revision 50493543600832add4f0aa3a97afc5328a07ba2e)
+++ vulkan-utils.hpp	(revision e8445f0578a1239a58166837998c25fe3ab0ecc3)
@@ -39,66 +39,74 @@
 
       static VkResult createDebugUtilsMessengerEXT(VkInstance instance,
-            const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
-            const VkAllocationCallbacks* pAllocator,
-            VkDebugUtilsMessengerEXT* pDebugMessenger);
+                                                   const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
+                                                   const VkAllocationCallbacks* pAllocator,
+                                                   VkDebugUtilsMessengerEXT* pDebugMessenger);
 
       static void destroyDebugUtilsMessengerEXT(VkInstance instance,
-            VkDebugUtilsMessengerEXT debugMessenger,
-            const VkAllocationCallbacks* pAllocator);
+                                                VkDebugUtilsMessengerEXT debugMessenger,
+                                                const VkAllocationCallbacks* pAllocator);
 
       static QueueFamilyIndices findQueueFamilies(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface);
       static bool checkDeviceExtensionSupport(VkPhysicalDevice physicalDevice,
-            const vector<const char*>& deviceExtensions);
+                                              const vector<const char*>& deviceExtensions);
       static VkSurfaceCapabilitiesKHR querySwapChainCapabilities(VkPhysicalDevice physicalDevice,
-         VkSurfaceKHR surface);
+                                                                 VkSurfaceKHR surface);
       static vector<VkSurfaceFormatKHR> querySwapChainFormats(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface);
       static vector<VkPresentModeKHR> querySwapChainPresentModes(VkPhysicalDevice physicalDevice,
-         VkSurfaceKHR surface);
+                                                                 VkSurfaceKHR surface);
       static VkSurfaceFormatKHR chooseSwapSurfaceFormat(const vector<VkSurfaceFormatKHR>& availableFormats,
-         const vector<VkFormat>& requestedFormats, VkColorSpaceKHR requestedColorSpace);
+                                                        const vector<VkFormat>& requestedFormats, VkColorSpaceKHR requestedColorSpace);
       static VkPresentModeKHR chooseSwapPresentMode(const vector<VkPresentModeKHR>& availablePresentModes,
-         const vector<VkPresentModeKHR>& requestedPresentModes);
+                                                    const vector<VkPresentModeKHR>& requestedPresentModes);
       static VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, int width, int height);
       static VkImageView createImageView(VkDevice device, VkImage image, VkFormat format,
-            VkImageAspectFlags aspectFlags);
+                                         VkImageAspectFlags aspectFlags);
       static VkFormat findSupportedFormat(VkPhysicalDevice physicalDevice, const vector<VkFormat>& candidates,
-            VkImageTiling tiling, VkFormatFeatureFlags features);
+                                          VkImageTiling tiling, VkFormatFeatureFlags features);
       static void createBuffer(VkDevice device, VkPhysicalDevice physicalDevice, VkDeviceSize size,
-            VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer& buffer,
-            VkDeviceMemory& bufferMemory);
+                               VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer& buffer,
+                               VkDeviceMemory& bufferMemory);
       static uint32_t findMemoryType(VkPhysicalDevice physicalDevice, uint32_t typeFilter,
-            VkMemoryPropertyFlags properties);
+                                     VkMemoryPropertyFlags properties);
 
       static void createVulkanImageFromFile(VkDevice device, VkPhysicalDevice physicalDevice,
-            VkCommandPool commandPool, string filename, VulkanImage& image, VkQueue graphicsQueue);
+                                            VkCommandPool commandPool, string filename, VulkanImage& image,
+                                            VkQueue graphicsQueue);
       static void createVulkanImageFromSDLTexture(VkDevice device, VkPhysicalDevice physicalDevice,
-            SDL_Texture* texture, VulkanImage& image);
+                                                  SDL_Texture* texture, VulkanImage& image);
       static void populateVulkanImageFromSDLTexture(VkDevice device, VkPhysicalDevice physicalDevice,
-            VkCommandPool commandPool, SDL_Texture* texture, SDL_Renderer* renderer, VulkanImage& image,
-            VkQueue graphicsQueue);
+                                                    VkCommandPool commandPool, SDL_Texture* texture,
+                                                    SDL_Renderer* renderer, VulkanImage& image, VkQueue graphicsQueue);
       static void createDepthImage(VkDevice device, VkPhysicalDevice physicalDevice, VkCommandPool commandPool,
-            VkFormat depthFormat, VkExtent2D extent, VulkanImage& image, VkQueue graphicsQueue);
+                                   VkFormat depthFormat, VkExtent2D extent, VulkanImage& image, VkQueue graphicsQueue);
       static void createImage(VkDevice device, VkPhysicalDevice physicalDevice, uint32_t width, uint32_t height,
-            VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties,
-            VulkanImage& image);
+                              VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage,
+                              VkMemoryPropertyFlags properties, VulkanImage& image);
 
       static void transitionImageLayout(VkDevice device, VkCommandPool commandPool, VkImage image,
-            VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout, VkQueue graphicsQueue);
+                                        VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout,
+                                        VkQueue graphicsQueue);
       static VkCommandBuffer beginSingleTimeCommands(VkDevice device, VkCommandPool commandPool);
       static void endSingleTimeCommands(VkDevice device, VkCommandPool commandPool,
-            VkCommandBuffer commandBuffer, VkQueue graphicsQueue);
+                                        VkCommandBuffer commandBuffer, VkQueue graphicsQueue);
       static void copyBufferToImage(VkDevice device, VkCommandPool commandPool, VkBuffer buffer, VkImage image,
-            uint32_t width, uint32_t height, VkQueue graphicsQueue);
+                                    uint32_t width, uint32_t height, VkQueue graphicsQueue);
 
       template<class DataType>
       static void copyDataToBuffer(VkDevice device, VkPhysicalDevice physicalDevice, VkCommandPool commandPool,
-            const vector<DataType>& srcData, VkBuffer dstBuffer, size_t dstVertexOffset, VkQueue graphicsQueue);
+                                   const vector<DataType>& srcData, VkBuffer dstBuffer, size_t dstVertexOffset,
+                                   VkQueue graphicsQueue);
 
       static void copyBuffer(VkDevice device, VkCommandPool commandPool, VkBuffer srcBuffer, VkBuffer dstBuffer,
-            VkDeviceSize srcOffset, VkDeviceSize dstOffset, VkDeviceSize size, VkQueue graphicsQueue);
+                             VkDeviceSize srcOffset, VkDeviceSize dstOffset, VkDeviceSize size,
+                             VkQueue graphicsQueue);
 
       template<class DataType>
-      static void copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, VkDeviceSize offset,
-            const DataType& srcData);
+      static void copyDataToMemory(VkDevice device, const DataType& srcData, VkDeviceMemory bufferMemory,
+                                   VkDeviceSize offset);
+
+      template<class DataType>
+      static void copyDataToMemory(VkDevice device, const DataType& srcData, VkDeviceMemory bufferMemory,
+                                   VkDeviceSize offset, VkDeviceSize size);
 
       static bool hasStencilComponent(VkFormat format);
@@ -131,13 +139,20 @@
 
 template<class DataType>
-void VulkanUtils::copyDataToMemory(VkDevice device, VkDeviceMemory bufferMemory, VkDeviceSize offset,
-      const DataType& srcData) {
+void VulkanUtils::copyDataToMemory(VkDevice device, const DataType& srcData, VkDeviceMemory bufferMemory,
+   VkDeviceSize offset) {
+   copyDataToMemory(device, srcData, bufferMemory, offset, sizeof(DataType));
+}
+
+template<class DataType>
+void VulkanUtils::copyDataToMemory(VkDevice device, const DataType& srcData, VkDeviceMemory bufferMemory,
+                                   VkDeviceSize offset, VkDeviceSize size) {
    void* data;
 
-   vkMapMemory(device, bufferMemory, offset, sizeof(DataType), 0, &data);
-   memcpy(data, &srcData, sizeof(DataType));
+   vkMapMemory(device, bufferMemory, offset, size, 0, &data);
+   memcpy(data, &srcData, size);
    vkUnmapMemory(device, bufferMemory);
 }
 
+// TODO: Use this in vulkan-utils itself as well
 #define VKUTIL_CHECK_RESULT(f, msg) {                                                                                      \
    VkResult res = (f);                                                                                                     \
