dzn: Fix loop condition in dzn_descriptor_set_copy()

We need to make sure we still have descriptors to copy in the
while() condition. While at it, drop the assert() checking that
the number of descriptors already copied is less than the
requested number.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15828>
This commit is contained in:
Boris Brezillon 2022-04-08 12:02:56 -07:00 committed by Marge Bot
parent 7744a477e8
commit bc58b34087
1 changed files with 2 additions and 2 deletions

View File

@ -1713,13 +1713,13 @@ dzn_descriptor_set_copy(const VkCopyDescriptorSet *pDescriptorCopy)
uint32_t copied_count = 0;
while (dzn_descriptor_set_ptr_is_valid(&src_ptr) &&
dzn_descriptor_set_ptr_is_valid(&dst_ptr)) {
dzn_descriptor_set_ptr_is_valid(&dst_ptr) &&
copied_count < pDescriptorCopy->descriptorCount) {
VkDescriptorType src_type =
dzn_descriptor_set_get_desc_vk_type(src_set, &src_ptr);
VkDescriptorType dst_type =
dzn_descriptor_set_get_desc_vk_type(dst_set, &dst_ptr);
assert(copied_count < pDescriptorCopy->descriptorCount);
assert(src_type == dst_type);
uint32_t count =
MIN2(dzn_descriptor_set_remaining_descs_in_binding(src_set, &src_ptr),