diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-11-21 09:41:57 -0700 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-11-21 15:56:46 -0700 |
| commit | c3c51c60ed3c551f2af28c800ecd21880ad3723e (patch) | |
| tree | 72618b63a377f5512efa6f6d50836c6378146654 /layers/descriptor_sets.cpp | |
| parent | bd74767349a2b2ae84321c9ff2162906a2a1921b (diff) | |
| download | usermoji-c3c51c60ed3c551f2af28c800ecd21880ad3723e.tar.xz | |
layers:Check for update of empty binding
Validation error if descriptor update performed on an empty binding.
Diffstat (limited to 'layers/descriptor_sets.cpp')
| -rw-r--r-- | layers/descriptor_sets.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 2a6b73e1..97fde15e 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -1148,6 +1148,15 @@ bool cvdescriptorset::DescriptorSet::ValidateWriteUpdate(const debug_report_data error_str << "DescriptorSet " << set_ << " does not have binding " << update->dstBinding << "."; *error_msg = error_str.str(); return false; + } else { + // Make sure binding isn't empty + if (0 == p_layout_->GetDescriptorCountFromBinding(update->dstBinding)) { + *error_code = VALIDATION_ERROR_02348; + std::stringstream error_str; + error_str << "DescriptorSet " << set_ << " cannot updated binding " << update->dstBinding << " that has 0 descriptors"; + *error_msg = error_str.str(); + return false; + } } // We know that binding is valid, verify update and do update on each descriptor auto start_idx = p_layout_->GetGlobalStartIndexFromBinding(update->dstBinding) + update->dstArrayElement; |
