layers:Remove redundant checks
authorTobin Ehlis <tobine@google.com>
Wed, 4 Jan 2017 16:41:47 +0000 (09:41 -0700)
committerTobin Ehlis <tobine@google.com>
Wed, 4 Jan 2017 22:05:18 +0000 (15:05 -0700)
Remove descriptor set check to make sure that src & dest descriptor
sets of copy update are valid. Object_tracker already verifies this.

layers/descriptor_sets.cpp

index 6de07cc..6d7ef55 100644 (file)
@@ -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<uint64_t &>(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<uint64_t &>(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<uint64_t &>(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<uint64_t &>(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<uint64_t &>(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<uint64_t &>(src_set), reinterpret_cast<uint64_t &>(dst_set),
-                                     error_str.c_str(), validation_error_map[error_code]);
-            }
+                                 reinterpret_cast<uint64_t &>(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<uint64_t &>(src_set), reinterpret_cast<uint64_t &>(dst_set), error_str.c_str(),
+                                 validation_error_map[error_code]);
         }
     }
     return skip_call;