diff --git a/vulkano/src/device/physical.rs b/vulkano/src/device/physical.rs index 5847da4e..264679fc 100644 --- a/vulkano/src/device/physical.rs +++ b/vulkano/src/device/physical.rs @@ -1981,7 +1981,7 @@ impl PhysicalDevice { } = surface_info; if let Some(present_mode) = present_mode { - let mut present_modes = unsafe { + let present_modes = unsafe { self.surface_present_modes_unchecked( surface, SurfaceInfo { @@ -1999,7 +1999,7 @@ impl PhysicalDevice { })? }; - if !present_modes.any(|mode| mode == present_mode) { + if !present_modes.into_iter().any(|mode| mode == present_mode) { return Err(Box::new(ValidationError { problem: "`surface_info.present_mode` is not supported for `surface`".into(), vuids: &["VUID-VkSurfacePresentModeEXT-presentMode-07780"], @@ -2355,7 +2355,7 @@ impl PhysicalDevice { } = surface_info; if let Some(present_mode) = present_mode { - let mut present_modes = unsafe { + let present_modes = unsafe { self.surface_present_modes_unchecked( surface, SurfaceInfo { @@ -2373,7 +2373,7 @@ impl PhysicalDevice { })? }; - if !present_modes.any(|mode| mode == present_mode) { + if !present_modes.into_iter().any(|mode| mode == present_mode) { return Err(Box::new(ValidationError { problem: "`surface_info.present_mode` is not supported for `surface`".into(), vuids: &["VUID-VkSurfacePresentModeEXT-presentMode-07780"], @@ -2601,7 +2601,7 @@ impl PhysicalDevice { &self, surface: &Surface, surface_info: SurfaceInfo, - ) -> Result, Validated> { + ) -> Result, Validated> { self.validate_surface_present_modes(surface, &surface_info)?; unsafe { Ok(self.surface_present_modes_unchecked(surface, surface_info)?) } @@ -2718,10 +2718,10 @@ impl PhysicalDevice { &self, surface: &Surface, surface_info: SurfaceInfo, - ) -> Result, VulkanError> { - surface - .surface_present_modes - .get_or_try_insert((self.handle, surface_info), |(_, surface_info)| { + ) -> Result, VulkanError> { + surface.surface_present_modes.get_or_try_insert( + (self.handle, surface_info), + |(_, surface_info)| { let &SurfaceInfo { present_mode: _, full_screen_exclusive, @@ -2837,8 +2837,8 @@ impl PhysicalDevice { .filter_map(|mode_vk| mode_vk.try_into().ok()) .collect()) } - }) - .map(IntoIterator::into_iter) + }, + ) } /// Returns whether queues of the given queue family can draw on the given surface. diff --git a/vulkano/src/swapchain/mod.rs b/vulkano/src/swapchain/mod.rs index 53a45ab1..2b2c7d0c 100644 --- a/vulkano/src/swapchain/mod.rs +++ b/vulkano/src/swapchain/mod.rs @@ -621,7 +621,7 @@ impl Swapchain { }) })? }; - let surface_present_modes: SmallVec<[_; PresentMode::COUNT]> = unsafe { + let surface_present_modes = unsafe { device .physical_device() .surface_present_modes_unchecked( @@ -644,7 +644,6 @@ impl Swapchain { ..Default::default() }) })? - .collect() }; if surface_capabilities