diff options
| author | Tobin Ehlis <tobine@google.com> | 2017-08-09 09:10:37 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2017-08-09 13:09:09 -0600 |
| commit | 2567a3589fadccfabd4e75d0772eb5c79c497324 (patch) | |
| tree | 24dc839305a4ef4b2a94f11f5d081a38765c8ce4 /layers/descriptor_sets.cpp | |
| parent | a29389cc6abe739e38a4df638007e672af6b546b (diff) | |
| download | usermoji-2567a3589fadccfabd4e75d0772eb5c79c497324.tar.xz | |
layers:Fix consecutive binding updates
Fixes #1992
When we're wrapping a descriptor update for consecutive bindings, fix
code so that index into update array consistently increases.
Diffstat (limited to 'layers/descriptor_sets.cpp')
| -rw-r--r-- | layers/descriptor_sets.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index 3f159b29..693b3ae4 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -604,12 +604,13 @@ void cvdescriptorset::DescriptorSet::PerformWriteUpdate(const VkWriteDescriptorS auto descriptors_remaining = update->descriptorCount; auto binding_being_updated = update->dstBinding; auto offset = update->dstArrayElement; + uint32_t update_index = 0; while (descriptors_remaining) { uint32_t update_count = std::min(descriptors_remaining, GetDescriptorCountFromBinding(binding_being_updated)); auto global_idx = p_layout_->GetGlobalStartIndexFromBinding(binding_being_updated) + offset; // Loop over the updates for a single binding at a time - for (uint32_t di = 0; di < update_count; ++di) { - descriptors_[global_idx + di]->WriteUpdate(update, di); + for (uint32_t di = 0; di < update_count; ++di, ++update_index) { + descriptors_[global_idx + di]->WriteUpdate(update, update_index); } // Roll over to next binding in case of consecutive update descriptors_remaining -= update_count; |
