layers: Fix CheckPreserved to allow input attachment
authorTony Barbour <tony@LunarG.com>
Fri, 10 Feb 2017 20:41:15 +0000 (13:41 -0700)
committerTony-LunarG <tony@lunarg.com>
Fri, 10 Feb 2017 22:23:36 +0000 (15:23 -0700)
Attachments that are used (input / color / depth attachment)
in a subpass are not allowed in the preserved list, so if they
are used as a color, depth  or input attachment they should
be consided preserved.  Color and depth attachments were accounted
for, this commit adds input attachment

Change-Id: Id87c3c1546092bc64b293bead1d997e0f61f7990

layers/core_validation.cpp

index 3c84942..9f48c63 100644 (file)
@@ -8913,6 +8913,9 @@ static bool CheckPreserved(const layer_data *dev_data, const VkRenderPassCreateI
     for (uint32_t j = 0; j < subpass.colorAttachmentCount; ++j) {
         if (attachment == subpass.pColorAttachments[j].attachment) return true;
     }
+    for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) {
+        if (attachment == subpass.pInputAttachments[j].attachment) return true;
+    }
     if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
         if (attachment == subpass.pDepthStencilAttachment->attachment) return true;
     }