From b5dd2356f3ecabaef208c7c013fac27aebaa061f Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 19 May 2016 07:56:18 -0600 Subject: layers: Verify that src of copy update is updated Before verifying source update comments make sure that the source descriptors have been updated. This guards against some obscure corner cases where a bad source descriptor could slip through the content verification. --- layers/descriptor_sets.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 2955a6a3..d178a916 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -543,7 +543,17 @@ bool cvdescriptorset::DescriptorSet::ValidateCopyUpdate(const debug_report_data set_, error))) { return false; } - // Update parameters all look good so verify update contents + // First make sure source descriptors are updated + for (uint32_t i = 0; i < update->descriptorCount; ++i) { + if (!src_set->descriptors_[src_start_idx + i]) { + std::stringstream error_str; + error_str << "Attempting copy update from descriptorSet " << src_set << " binding #" << update->srcBinding << " but descriptor at array offset " + << update->srcArrayElement + i << " has not been updated."; + *error = error_str.str(); + return false; + } + } + // Update parameters all look good and descriptor updated so verify update contents if (!VerifyCopyUpdateContents(update, src_set, src_start_idx, error)) return false; -- cgit v1.2.3