pub(crate) unsafe fn read_into_uninitialized_vector<N: Copy + Default + TryInto<usize>, T>(
    f: impl Fn(&mut N, *mut T) -> Result
) -> VkResult<Vec<T>>
where <N as TryInto<usize>>::Error: Debug,
Expand description

Repeatedly calls f until it does not return vk::Result::INCOMPLETE anymore, ensuring all available data has been read into the vector.

See for example vkEnumerateInstanceExtensionProperties: the number of available items may change between calls; vk::Result::INCOMPLETE is returned when the count increased (and the vector is not large enough after querying the initial size), requiring Ash to try again.