Index: graphics-pipeline_vulkan.cpp
===================================================================
--- graphics-pipeline_vulkan.cpp	(revision 603b5bc69c413a1767dc42b7921374fc1c992f31)
+++ graphics-pipeline_vulkan.cpp	(revision 87c8f1abdf1a94f87d0f0051fbc134d1ec1fa9ee)
@@ -5,14 +5,20 @@
 #include <iostream>
 
+#include "vulkan-utils.hpp"
+
 using namespace std;
 
 // TODO: Remove any instances of cout and instead throw exceptions
 
-GraphicsPipeline_Vulkan::GraphicsPipeline_Vulkan(VkDevice device, VkRenderPass renderPass, Viewport viewport,
-      int vertexSize) {
+GraphicsPipeline_Vulkan::GraphicsPipeline_Vulkan(VkPhysicalDevice physicalDevice, VkDevice device,
+      VkRenderPass renderPass, Viewport viewport, int vertexSize) {
+   this->physicalDevice = physicalDevice;
    this->device = device;
    this->renderPass = renderPass;
    this->viewport = viewport;
 
+   // Since there is only one array of vertex data, we use binding = 0
+   // I'll probably do that for the foreseeable future
+   // I can calculate the stride myself given info about all the varying attributes
    this->bindingDescription.binding = 0;
    this->bindingDescription.stride = vertexSize;
@@ -21,4 +27,56 @@
 
 GraphicsPipeline_Vulkan::~GraphicsPipeline_Vulkan() {
+}
+
+void GraphicsPipeline_Vulkan::createVertexBuffer(const void* bufferData, int vertexSize,
+      VkCommandPool commandPool, VkQueue graphicsQueue) {
+   VkDeviceSize bufferSize = numVertices * vertexSize;
+   VkDeviceSize bufferCapacity = vertexCapacity * vertexSize;
+
+   VkBuffer stagingBuffer;
+   VkDeviceMemory stagingBufferMemory;
+   VulkanUtils::createBuffer(device, physicalDevice, bufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
+      VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
+      stagingBuffer, stagingBufferMemory);
+
+   void* data;
+   vkMapMemory(device, stagingBufferMemory, 0, bufferSize, 0, &data);
+   memcpy(data, bufferData, (size_t) bufferSize);
+   vkUnmapMemory(device, stagingBufferMemory);
+
+   VulkanUtils::createBuffer(device, physicalDevice, bufferCapacity,
+      VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
+      VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, vertexBuffer, vertexBufferMemory);
+
+   VulkanUtils::copyBuffer(device, commandPool, stagingBuffer, vertexBuffer, 0, 0, bufferSize, graphicsQueue);
+
+   vkDestroyBuffer(device, stagingBuffer, nullptr);
+   vkFreeMemory(device, stagingBufferMemory, nullptr);
+}
+
+void GraphicsPipeline_Vulkan::createIndexBuffer(const void* bufferData, int indexSize,
+      VkCommandPool commandPool, VkQueue graphicsQueue) {
+   VkDeviceSize bufferSize = numIndices * indexSize;
+   VkDeviceSize bufferCapacity = indexCapacity * indexSize;
+
+   VkBuffer stagingBuffer;
+   VkDeviceMemory stagingBufferMemory;
+   VulkanUtils::createBuffer(device, physicalDevice, bufferSize, VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
+      VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
+      stagingBuffer, stagingBufferMemory);
+
+   void* data;
+   vkMapMemory(device, stagingBufferMemory, 0, bufferSize, 0, &data);
+   memcpy(data, bufferData, (size_t) bufferSize);
+   vkUnmapMemory(device, stagingBufferMemory);
+
+   VulkanUtils::createBuffer(device, physicalDevice, bufferCapacity,
+      VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
+      VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, indexBuffer, indexBufferMemory);
+
+   VulkanUtils::copyBuffer(device, commandPool, stagingBuffer, indexBuffer, 0, 0, bufferSize, graphicsQueue);
+
+   vkDestroyBuffer(device, stagingBuffer, nullptr);
+   vkFreeMemory(device, stagingBufferMemory, nullptr);
 }
 
@@ -313,10 +371,15 @@
 
 void GraphicsPipeline_Vulkan::cleanup() {
-   vkDestroyPipeline(this->device, this->pipeline, nullptr);
-   vkDestroyDescriptorPool(this->device, this->descriptorPool, nullptr);
-   vkDestroyPipelineLayout(this->device, this->pipelineLayout, nullptr);
+   vkDestroyPipeline(device, pipeline, nullptr);
+   vkDestroyDescriptorPool(device, descriptorPool, nullptr);
+   vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
 }
 
 void GraphicsPipeline_Vulkan::cleanupBuffers() {
-   vkDestroyDescriptorSetLayout(this->device, this->descriptorSetLayout, nullptr);
-}
+   vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr);
+
+   vkDestroyBuffer(device, vertexBuffer, nullptr);
+   vkFreeMemory(device, vertexBufferMemory, nullptr);
+   vkDestroyBuffer(device, indexBuffer, nullptr);
+   vkFreeMemory(device, indexBufferMemory, nullptr);
+}
