From 563d7c4b9ce6111b1f708794a48e5a28df691cc5 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Thu, 4 Aug 2016 21:18:05 +0200 Subject: [PATCH] Removed redundant depth attachment layout transition and wrong comment --- triangle/triangle.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/triangle/triangle.cpp b/triangle/triangle.cpp index ec359f4c..b486e256 100644 --- a/triangle/triangle.cpp +++ b/triangle/triangle.cpp @@ -760,23 +760,12 @@ public: VK_CHECK_RESULT(vkAllocateMemory(device, &memAlloc, nullptr, &depthStencil.mem)); VK_CHECK_RESULT(vkBindImageMemory(device, depthStencil.image, depthStencil.mem, 0)); - // We need to do an initial layout transition before we can use this image - // as the depth (and stencil) attachment + // We need to do an initial layout transition before we can use this image as the depth (and stencil) attachment // Note that this may be ignored by implementations that don't care about image layout // transitions, but it's crucial for those that do VkCommandBuffer layoutCmd = getCommandBuffer(true); - vkTools::setImageLayout( - setupCmdBuffer, - depthStencil.image, - VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT, - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); - - // Add a present memory barrier to the end of the command buffer - // This will transform the frame buffer color attachment to a - // new layout for presenting it to the windowing system integration VkImageMemoryBarrier imageMemoryBarrier = {}; imageMemoryBarrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; imageMemoryBarrier.srcAccessMask = VK_FLAGS_NONE;