}
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());
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;
// These calls should be guarded by a call to "HasBinding(binding)" to verify that the given binding exists
uint32_t GetGlobalStartIndexFromBinding(const uint32_t) const;
uint32_t GetGlobalEndIndexFromBinding(const uint32_t) const;
+ // Helper function to get the next valid binding for a descriptor
+ uint32_t GetNextValidBinding(const uint32_t) const;
// For a particular binding starting at offset and having update_count descriptors
// updated, verify that for any binding boundaries crossed, the update is consistent
bool VerifyUpdateConsistency(uint32_t, uint32_t, uint32_t, const char *, const VkDescriptorSet, std::string *) const;