message: Added barriers
diff: @@ -90,7 +90,29 @@ public:
  {
  VK_CHECK_RESULT(vkBeginCommandBuffer(drawCmdBuffers[i], &cmdBufInfo));
  - // @todo: comment
  + // Transition color and depth images for drawing
  + vks::tools::insertImageMemoryBarrier(
  + drawCmdBuffers[i],
  + swapChain.buffers[i].image,
  + 0,
  + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
  + VK_IMAGE_LAYOUT_UNDEFINED,
  + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
  + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
  + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
  + VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 });
  + vks::tools::insertImageMemoryBarrier(
  + drawCmdBuffers[i],
  + swapChain.buffers[i].image,
  + 0,
  + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
  + VK_IMAGE_LAYOUT_UNDEFINED,
  + VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
  + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
  + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
  + VkImageSubresourceRange{ VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1 });
  +
  + // New structures are used to define the attachments used in dynamic rendering
  VkRenderingAttachmentInfoKHR colorAttachment{};
  colorAttachment.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
  colorAttachment.imageView = swapChain.buffers[i].view;
  @@ -135,6 +157,18 @@ public:
  // End dynamic rendering
  vkCmdEndRenderingKHR(drawCmdBuffers[i]);
  + // Transition color image for presentation
  + vks::tools::insertImageMemoryBarrier(
  + drawCmdBuffers[i],
  + swapChain.buffers[i].image,
  + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
  + 0,
  + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
  + VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
  + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
  + VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
  + VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 });
  +
  VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
  }
  }
  