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>
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 199cb48..1c9ab86 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -9274,6 +9274,15 @@
                     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;