From: Tobin Ehlis Date: Thu, 22 Dec 2016 20:40:45 +0000 (-0700) Subject: layers:Remove redundant check X-Git-Tag: submit/tizen/20181227.054638~1854 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc0a5f8338a57eb4cd3d1a05cb136647cdd20b3d;p=platform%2Fupstream%2FVulkan-Tools.git layers:Remove redundant check Remove valid buffer check from descriptor_sets.cpp that's already handled in object_tracker. --- diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 7f14801a..2e319585 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -1287,16 +1287,10 @@ bool cvdescriptorset::DescriptorSet::ValidateBufferUsage(BUFFER_STATE const *buf // If there's an error, update the error_msg string with details and return false, else return true bool cvdescriptorset::DescriptorSet::ValidateBufferUpdate(VkDescriptorBufferInfo const *buffer_info, VkDescriptorType type, UNIQUE_VALIDATION_ERROR_CODE *error_code, std::string *error_msg) const { - // TODO : Defaulting to 00962 for all cases here. Need to create new error codes for a few cases below. - *error_code = VALIDATION_ERROR_00962; // First make sure that buffer is valid auto buffer_node = getBufferState(device_data_, buffer_info->buffer); - if (!buffer_node) { - std::stringstream error_str; - error_str << "Invalid VkBuffer: " << buffer_info->buffer; - *error_msg = error_str.str(); - return false; - } + // Any invalid buffer should already be caught by object_tracker + assert(buffer_node); if (ValidateMemoryIsBoundToBuffer(device_data_, buffer_node, "vkUpdateDescriptorSets()", VALIDATION_ERROR_02525)) { *error_code = VALIDATION_ERROR_02525; *error_msg = "No memory bound to buffer.";