aboutsummaryrefslogtreecommitdiff
path: root/layers/descriptor_sets.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-03-10 09:14:00 -0700
committerMark Lobodzinski <mark@lunarg.com>2017-03-13 08:53:38 -0600
commit3e2cbb2ca47416711ed1c0b82a3d3e71927bf526 (patch)
tree6952bde19d74803c9ab97cf634de18d571378859 /layers/descriptor_sets.cpp
parentb8ccfc4270a34e192b567ab47258d611abb1d542 (diff)
downloadusermoji-3e2cbb2ca47416711ed1c0b82a3d3e71927bf526.tar.xz
layers: Add GetNextValidBinding function to CV
Change-Id: Ifaa7aea1c7569ffaf5d417a1cd5caadaa38c96b0
Diffstat (limited to 'layers/descriptor_sets.cpp')
-rw-r--r--layers/descriptor_sets.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp
index 469eb4d2..b697e01a 100644
--- a/layers/descriptor_sets.cpp
+++ b/layers/descriptor_sets.cpp
@@ -193,6 +193,14 @@ VkSampler const *cvdescriptorset::DescriptorSetLayout::GetImmutableSamplerPtrFro
}
return nullptr;
}
+// Move to next valid binding having a non-zero binding count
+uint32_t cvdescriptorset::DescriptorSetLayout::GetNextValidBinding(const uint32_t binding) const {
+ uint32_t new_binding = binding;
+ do {
+ new_binding++;
+ } while (GetDescriptorCountFromBinding(new_binding) == 0);
+ return new_binding;
+}
// For given index, return ptr to ImmutableSampler array
VkSampler const *cvdescriptorset::DescriptorSetLayout::GetImmutableSamplerPtrFromIndex(const uint32_t index) const {
assert(index < bindings_.size());
@@ -1162,11 +1170,7 @@ void cvdescriptorset::PerformUpdateDescriptorSetsWithTemplateKHR(layer_data *dev
if (dst_array_element >= binding_count) {
dst_array_element = 0;
- // Move to next binding having a non-zero binding count
- do {
- binding_being_updated++;
- binding_count = layout_obj->GetDescriptorCountFromBinding(binding_being_updated);
- } while (binding_count == 0);
+ binding_being_updated = layout_obj->GetNextValidBinding(binding_being_updated);
}
write_entry.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;