/// Selects Mailbox if available, but if not tries to fallback to FIFO. See the [spec](https://renderdoc.org/vkspec_chunked/chap32.html#VkPresentModeKHR) for details on modes.
///
/// TODO(issue#18) CONFIG support immediate mode if possible and allow the
/// user to have tearing if they wish.
Selects Mailbox if available, but if not tries to fallback to FIFO. See the [spec] for details on modes.
TODO(issue#18) CONFIG support immediate mode if possible and allow the
user to have tearing if they wish.
Selects Mailbox if available but if not tries to fallback to FIFO . See the [ spec ] for details on modes . TODO ( issue#18 ) CONFIG support immediate mode if possible and allow the user to have tearing if they wish .
fn choose_presentation_mode(
    available_presentation_modes: &[vk::PresentModeKHR], requested_present_mode: PresentMode,
  ) -> vk::PresentModeKHR {
    let present_mode = *available_presentation_modes
      .iter()
      .find(|&pm| match (requested_present_mode, pm) {
        (PresentMode::Mailbox, &vk::PresentModeKHR::MAILBOX) => true,
        (PresentMode::Immediate, &vk::PresentModeKHR::IMMEDIATE) => true,
        (PresentMode::Fifo, &vk::PresentModeKHR::FIFO) => true,
        _ => false,
      })
      .unwrap_or(&vk::PresentModeKHR::FIFO);
    info!("Selecting present mode: {:?}", present_mode);
    present_mode
  }
fn choose_presentation_mode ( available_presentation_modes : & [ vk :: PresentModeKHR ] , requested_present_mode : PresentMode , ) -> vk :: PresentModeKHR { let present_mode = * available_presentation_modes . iter ( ) . find ( | & pm | match ( requested_present_mode , pm ) { ( PresentMode :: Mailbox , & vk :: PresentModeKHR :: MAILBOX ) => true , ( PresentMode :: Immediate , & vk :: PresentModeKHR :: IMMEDIATE ) => true , ( PresentMode :: Fifo , & vk :: PresentModeKHR :: FIFO ) => true , _ => false , } ) . unwrap_or ( & vk :: PresentModeKHR :: FIFO ) ; info ! ( " " present_mode ) ; present_mode }
Selects Mailbox if available, but if not tries to fallback to FIFO.
Selects Mailbox if available but if not tries to fallback to FIFO .
available_presentation_modes
&[vk::PresentModeKHR]
requested_present_mode
PresentMode