Index: vulkan-game.cpp
===================================================================
--- vulkan-game.cpp	(revision 880cfc2c386f5cc616fd4d6c165078cdf13eb20d)
+++ vulkan-game.cpp	(revision 7734042d6fd036b480c40e04ad83a562162543a7)
@@ -1714,17 +1714,19 @@
       imageAcquiredSemaphores[currentFrame], VK_NULL_HANDLE, &imageIndex);
 
-   if (result == VK_ERROR_OUT_OF_DATE_KHR) {
-      recreateSwapChain();
+   if (result == VK_SUBOPTIMAL_KHR) {
+      shouldRecreateSwapChain = true;
+   } else if (result == VK_ERROR_OUT_OF_DATE_KHR) {
+      shouldRecreateSwapChain = true;
       return;
-   } else if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
-      throw runtime_error("failed to acquire swap chain image!");
-   }
-
-   if (vkWaitForFences(device, 1, &inFlightFences[imageIndex], VK_TRUE, numeric_limits<uint64_t>::max()) != VK_SUCCESS) {
-      throw runtime_error("failed waiting for fence!");
-   }
-   if (vkResetFences(device, 1, &inFlightFences[imageIndex]) != VK_SUCCESS) {
-      throw runtime_error("failed to reset fence!");
-   }
+   } else {
+      VKUTIL_CHECK_RESULT(result, "failed to acquire swap chain image!");
+   }
+
+   VKUTIL_CHECK_RESULT(
+      vkWaitForFences(device, 1, &inFlightFences[imageIndex], VK_TRUE, numeric_limits<uint64_t>::max()),
+      "failed waiting for fence!");
+
+   VKUTIL_CHECK_RESULT(vkResetFences(device, 1, &inFlightFences[imageIndex]),
+      "failed to reset fence!");
 
    VKUTIL_CHECK_RESULT(vkResetCommandPool(device, commandPools[imageIndex], 0),
@@ -1733,10 +1735,8 @@
    VkCommandBufferBeginInfo beginInfo = {};
    beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
-   beginInfo.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT;
-   beginInfo.pInheritanceInfo = nullptr;
-
-   if (vkBeginCommandBuffer(commandBuffers[imageIndex], &beginInfo) != VK_SUCCESS) {
-      throw runtime_error("failed to begin recording command buffer!");
-   }
+   beginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
+
+   VKUTIL_CHECK_RESULT(vkBeginCommandBuffer(commandBuffers[imageIndex], &beginInfo),
+      "failed to begin recording command buffer!");
 
    VkRenderPassBeginInfo renderPassInfo = {};
@@ -1762,7 +1762,6 @@
    vkCmdEndRenderPass(commandBuffers[imageIndex]);
 
-   if (vkEndCommandBuffer(commandBuffers[imageIndex]) != VK_SUCCESS) {
-      throw runtime_error("failed to record command buffer!");
-   }
+   VKUTIL_CHECK_RESULT(vkEndCommandBuffer(commandBuffers[imageIndex]),
+      "failed to record command buffer!");
 
    VkSemaphore waitSemaphores[] = { imageAcquiredSemaphores[currentFrame] };
