From 642a665144fc554d1cb5953205aa44dd18c60f77 Mon Sep 17 00:00:00 2001 From: Igor Ostrowski Date: Thu, 1 Feb 2018 12:40:08 +0100 Subject: [PATCH] multisampling, subpasses, textoverlay: Fix renderpass initial layout. Fixes #418 --- examples/multisampling/multisampling.cpp | 1 + examples/subpasses/subpasses.cpp | 1 + examples/textoverlay/textoverlay.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/multisampling/multisampling.cpp b/examples/multisampling/multisampling.cpp index 91c3f051..73c96c61 100644 --- a/examples/multisampling/multisampling.cpp +++ b/examples/multisampling/multisampling.cpp @@ -343,6 +343,7 @@ public: // Create custom overlay render pass colorReference.attachment = 1; attachments[1].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; + attachments[1].initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; subpass.pResolveAttachments = 0; subpass.pDepthStencilAttachment = 0; diff --git a/examples/subpasses/subpasses.cpp b/examples/subpasses/subpasses.cpp index 72decbaf..80d24d3e 100644 --- a/examples/subpasses/subpasses.cpp +++ b/examples/subpasses/subpasses.cpp @@ -443,6 +443,7 @@ public: // Create custom overlay render pass attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; + attachments[0].initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &uiRenderPass)); } diff --git a/examples/textoverlay/textoverlay.cpp b/examples/textoverlay/textoverlay.cpp index 073692cb..3ebf69ee 100644 --- a/examples/textoverlay/textoverlay.cpp +++ b/examples/textoverlay/textoverlay.cpp @@ -470,7 +470,7 @@ public: attachments[0].storeOp = VK_ATTACHMENT_STORE_OP_STORE; attachments[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; attachments[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; - attachments[0].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + attachments[0].initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; attachments[0].finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; // Depth attachment