Index: vulkan-game.cpp
===================================================================
--- vulkan-game.cpp	(revision 84216c71959c5122ff6b8948a6d96a8bf1a351a5)
+++ vulkan-game.cpp	(revision be34c9a6bba08254efa559ad761334e7d9502fdd)
@@ -113,4 +113,5 @@
 
       vector<VkImageView> swapChainImageViews;
+      VkRenderPass renderPass;
       VkPipelineLayout pipelineLayout;
 
@@ -147,4 +148,5 @@
          createSwapChain();
          createImageViews();
+         createRenderPass();
          createGraphicsPipeline();
       }
@@ -556,4 +558,36 @@
                throw runtime_error("failed to create image views!");
             }
+         }
+      }
+
+      void createRenderPass() {
+         VkAttachmentDescription colorAttachment = {};
+         colorAttachment.format = swapChainImageFormat;
+         colorAttachment.samples = VK_SAMPLE_COUNT_1_BIT;
+         colorAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+         colorAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
+         colorAttachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+         colorAttachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+         colorAttachment.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+         colorAttachment.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+
+         VkAttachmentReference colorAttachmentRef = {};
+         colorAttachmentRef.attachment = 0;
+         colorAttachmentRef.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+
+         VkSubpassDescription subpass = {};
+         subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
+         subpass.colorAttachmentCount = 1;
+         subpass.pColorAttachments = &colorAttachmentRef;
+
+         VkRenderPassCreateInfo renderPassInfo = {};
+         renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
+         renderPassInfo.attachmentCount = 1;
+         renderPassInfo.pAttachments = &colorAttachment;
+         renderPassInfo.subpassCount = 1;
+         renderPassInfo.pSubpasses = &subpass;
+
+         if (vkCreateRenderPass(device, &renderPassInfo, nullptr, &renderPass) != VK_SUCCESS) {
+            throw runtime_error("failed to create render pass!");
          }
       }
@@ -694,4 +728,5 @@
       void cleanup() {
          vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
+         vkDestroyRenderPass(device, renderPass, nullptr);
 
          for (auto imageView : swapChainImageViews) {
