From: Tobin Ehlis Date: Wed, 4 Jan 2017 16:41:47 +0000 (-0700) Subject: layers:Remove redundant checks X-Git-Tag: upstream/1.1.92~1797 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1647f05c88c887bc23920dcd4e1c58053667679d;p=platform%2Fupstream%2FVulkan-Tools.git layers:Remove redundant checks Remove descriptor set check to make sure that src & dest descriptor sets of copy update are valid. Object_tracker already verifies this. --- diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 6de07cc..6d7ef55 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -1109,29 +1109,18 @@ bool cvdescriptorset::ValidateUpdateDescriptorSets(const debug_report_data *repo auto src_set = p_cds[i].srcSet; auto src_node = core_validation::getSetNode(dev_data, src_set); auto dst_node = core_validation::getSetNode(dev_data, dst_set); - if (!src_node) { + // Object_tracker verifies that src & dest descriptor set are valid + assert(src_node); + assert(dst_node); + UNIQUE_VALIDATION_ERROR_CODE error_code; + std::string error_str; + if (!dst_node->ValidateCopyUpdate(report_data, &p_cds[i], src_node, &error_code, &error_str)) { skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - reinterpret_cast(src_set), __LINE__, VALIDATION_ERROR_00971, "DS", - "Cannot call vkUpdateDescriptorSets() to copy from descriptor set 0x%" PRIxLEAST64 - " that has not been allocated. %s", - reinterpret_cast(src_set), validation_error_map[VALIDATION_ERROR_00971]); - } else if (!dst_node) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - reinterpret_cast(dst_set), __LINE__, VALIDATION_ERROR_00972, "DS", - "Cannot call vkUpdateDescriptorSets() to copy to descriptor set 0x%" PRIxLEAST64 - " that has not been allocated. %s", - reinterpret_cast(dst_set), validation_error_map[VALIDATION_ERROR_00972]); - } else { - UNIQUE_VALIDATION_ERROR_CODE error_code; - std::string error_str; - if (!dst_node->ValidateCopyUpdate(report_data, &p_cds[i], src_node, &error_code, &error_str)) { - skip_call |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - reinterpret_cast(dst_set), __LINE__, error_code, "DS", - "vkUpdateDescriptorsSets() failed copy update from Descriptor Set 0x%" PRIx64 - " to Descriptor Set 0x%" PRIx64 " with error: %s. %s", - reinterpret_cast(src_set), reinterpret_cast(dst_set), - error_str.c_str(), validation_error_map[error_code]); - } + reinterpret_cast(dst_set), __LINE__, error_code, "DS", + "vkUpdateDescriptorsSets() failed copy update from Descriptor Set 0x%" PRIx64 + " to Descriptor Set 0x%" PRIx64 " with error: %s. %s", + reinterpret_cast(src_set), reinterpret_cast(dst_set), error_str.c_str(), + validation_error_map[error_code]); } } return skip_call;