aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 3cdedc6d..b0b8515f 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -2134,7 +2134,7 @@ static bool validate_draw_state_flags(layer_data *dev_data, GLOBAL_CB_NODE *pCB,
// Verify attachment reference compatibility according to spec
// If one array is larger, treat missing elements of shorter array as VK_ATTACHMENT_UNUSED & other array much match this
-// If both AttachmentReference arrays have requested index, check their corresponding AttachementDescriptions
+// If both AttachmentReference arrays have requested index, check their corresponding AttachmentDescriptions
// to make sure that format and samples counts match.
// If not, they are not compatible.
static bool attachment_references_compatible(const uint32_t index, const VkAttachmentReference *pPrimary,
@@ -2156,7 +2156,12 @@ static bool attachment_references_compatible(const uint32_t index, const VkAttac
} else if (index >= secondaryCount) { // Check primary as if secondary is VK_ATTACHMENT_UNUSED
if (VK_ATTACHMENT_UNUSED == pPrimary[index].attachment)
return true;
- } else { // format and sample count must match
+ } else { // Format and sample count must match
+ if ((pPrimary[index].attachment == VK_ATTACHMENT_UNUSED) && (pSecondary[index].attachment == VK_ATTACHMENT_UNUSED)) {
+ return true;
+ } else if ((pPrimary[index].attachment == VK_ATTACHMENT_UNUSED) || (pSecondary[index].attachment == VK_ATTACHMENT_UNUSED)) {
+ return false;
+ }
if ((pPrimaryAttachments[pPrimary[index].attachment].format ==
pSecondaryAttachments[pSecondary[index].attachment].format) &&
(pPrimaryAttachments[pPrimary[index].attachment].samples ==