From: Chris Forbes Date: Wed, 31 Aug 2016 19:00:35 +0000 (-0700) Subject: layers: Don't spuriously produce an error if there are no view type bits set X-Git-Tag: upstream/1.1.92~2609 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea07a7f4e19871791627fe6d03e41ec5d553e990;p=platform%2Fupstream%2FVulkan-Tools.git layers: Don't spuriously produce an error if there are no view type bits set Previously we'd complain about any input attachment, since we don't constrain its view type at all. Signed-off-by: Chris Forbes --- diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h index 8c89262..f36e3b2 100644 --- a/layers/core_validation_types.h +++ b/layers/core_validation_types.h @@ -100,6 +100,8 @@ enum descriptor_req { DESCRIPTOR_REQ_VIEW_TYPE_CUBE = 1 << VK_IMAGE_VIEW_TYPE_CUBE, DESCRIPTOR_REQ_VIEW_TYPE_CUBE_ARRAY = 1 << VK_IMAGE_VIEW_TYPE_CUBE_ARRAY, + DESCRIPTOR_REQ_ALL_VIEW_TYPE_BITS = (1 << (VK_IMAGE_VIEW_TYPE_END_RANGE + 1)) - 1, + DESCRIPTOR_REQ_SINGLE_SAMPLE = 2 << VK_IMAGE_VIEW_TYPE_END_RANGE, DESCRIPTOR_REQ_MULTI_SAMPLE = DESCRIPTOR_REQ_SINGLE_SAMPLE << 1, }; diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index c7b39f7..00c0d19 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -429,7 +429,7 @@ bool cvdescriptorset::DescriptorSet::ValidateDrawState(const std::mapviewType)) { + if ((reqs & DESCRIPTOR_REQ_ALL_VIEW_TYPE_BITS) && (~reqs & (1 << image_view_data->viewType))) { // bad view type std::stringstream error_str; error_str << "Descriptor in binding #" << binding << " at global descriptor index " << i