/// If drawing to a surface, chooses the best format from the ones available
/// for the surface.  Tries to use B8g8r8a8Srgb format with SRGB_NONLINEAR
/// colorspace.
///
/// If that isn't available, for now we just use the 0th SurfaceFormatKHR.
If drawing to a surface, chooses the best format from the ones available
for the surface.  Tries to use B8g8r8a8Srgb format with SRGB_NONLINEAR
colorspace.

If that isn't available, for now we just use the 0th SurfaceFormatKHR.
If drawing to a surface chooses the best format from the ones available for the surface . Tries to use B8g8r8a8Srgb format with SRGB_NONLINEAR colorspace . If that isn ' t available for now we just use the 0th SurfaceFormatKHR .
fn choose_swap_surface_format(
    available_formats: &[vk::SurfaceFormatKHR],
  ) -> vk::SurfaceFormatKHR {
    *available_formats
      .iter()
      .find(|format| {
        format.format == vk::Format::B8G8R8A8_UNORM
          && format.color_space == vk::ColorSpaceKHR::SRGB_NONLINEAR
      })
      .unwrap_or(&available_formats[0])
  }
fn choose_swap_surface_format ( available_formats : & [ vk :: SurfaceFormatKHR ] , ) -> vk :: SurfaceFormatKHR { * available_formats . iter ( ) . find ( | format | { format . format == vk :: Format :: B8G8R8A8_UNORM && format . color_space == vk :: ColorSpaceKHR :: SRGB_NONLINEAR } ) . unwrap_or ( & available_formats [ 0 ] ) }
If drawing to a surface, chooses the best format from the ones available
for the surface.
If drawing to a surface chooses the best format from the ones available for the surface .
available_formats
&[vk::SurfaceFormatKHR]