aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-02-28 17:40:29 +1300
committerChris Forbes <chrisf@ijw.co.nz>2017-03-01 09:52:04 +1300
commita0128011e0f93f51984df4fc4ada92ae2f9e06a7 (patch)
tree43705a27100b685608bec362541ff0974ba5262d /layers/core_validation.cpp
parentc557a0f9b60b3604566bd8080ca134105354bbad (diff)
downloadusermoji-a0128011e0f93f51984df4fc4ada92ae2f9e06a7.tar.xz
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 <chrisforbes@google.com>
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp9
1 files changed, 9 insertions, 0 deletions
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;