From a0128011e0f93f51984df4fc4ada92ae2f9e06a7 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 28 Feb 2017 17:40:29 +1300 Subject: layers: Consider resolve attachments to be written in renderpass Previously, if there was a later read of the attachment within the renderpass, we'd mistakenly record this attachment as being read-first, and insist on its contents having been made valid by some write prior to the renderpass. Signed-off-by: Chris Forbes --- layers/core_validation.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 199cb486..1c9ab864 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -9274,6 +9274,15 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass(VkDevice device, const VkRenderP attachment_first_read.insert(std::make_pair(attachment, false)); attachment_first_layout.insert(std::make_pair(attachment, subpass.pColorAttachments[j].layout)); } + + if (subpass.pResolveAttachments && subpass.pResolveAttachments[j].attachment != VK_ATTACHMENT_UNUSED) { + // resolve attachments are considered to be written + attachment = subpass.pResolveAttachments[j].attachment; + if (!attachment_first_read.count(attachment)) { + attachment_first_read.insert(std::make_pair(attachment, false)); + attachment_first_layout.insert(std::make_pair(attachment, subpass.pResolveAttachments[j].layout)); + } + } } if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) { uint32_t attachment = subpass.pDepthStencilAttachment->attachment; -- cgit v1.2.3