aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-05-19 07:56:18 -0600
committerTobin Ehlis <tobine@google.com>2016-05-19 08:48:42 -0600
commitb5dd2356f3ecabaef208c7c013fac27aebaa061f (patch)
tree0a3edaffa96febb6722b800b74fb03def09f52a7
parent8ac68a5c55f9662b74db3826f97aa2f28d21503f (diff)
downloadusermoji-b5dd2356f3ecabaef208c7c013fac27aebaa061f.tar.xz
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.
-rw-r--r--layers/descriptor_sets.cpp12
1 files changed, 11 insertions, 1 deletions
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;