From: Mark Young Date: Thu, 24 Mar 2016 16:14:35 +0000 (-0600) Subject: layers: Fix issue when sub-passes have diff attachment count. X-Git-Tag: sdk-1.0.8.1~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06e963555b0df747c98c43816c16647349d21001;p=platform%2Fupstream%2FVulkan-LoaderAndValidationLayers.git layers: Fix issue when sub-passes have diff attachment count. In core_validation, if the attachment count between a primary and secondary sub-pass was different, then it should treat the shorter one as UNUSED. So, if the longer one has the attachment flags set to UNUSED, it shouldn't be an error. Change-Id: I3647403551962ef522e7e2ba7ab10a5cb7466c52 --- diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index cfc9ae7..a11a214 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2247,11 +2247,11 @@ static bool attachment_references_compatible(const uint32_t index, const VkAttac const VkAttachmentReference *pSecondary, const uint32_t secondaryCount, const VkAttachmentDescription *pSecondaryAttachments) { if (index >= primaryCount) { // Check secondary as if primary is VK_ATTACHMENT_UNUSED - if (VK_ATTACHMENT_UNUSED != pSecondary[index].attachment) - return false; + if (VK_ATTACHMENT_UNUSED == pSecondary[index].attachment) + return true; } else if (index >= secondaryCount) { // Check primary as if secondary is VK_ATTACHMENT_UNUSED - if (VK_ATTACHMENT_UNUSED != pPrimary[index].attachment) - return false; + if (VK_ATTACHMENT_UNUSED == pPrimary[index].attachment) + return true; } else { // format and sample count must match if ((pPrimaryAttachments[pPrimary[index].attachment].format == pSecondaryAttachments[pSecondary[index].attachment].format) &&