pub fn choose_present_mode(
    window_surface: &dyn WindowSurface,
    physical_device: &vk::PhysicalDevice,
) -> vk::PresentModeKHR {
    //! checking presentation modes is safe because support for the swapchain
    //! extension is verified when picking a physical device
    let modes =
        unsafe { window_surface.supported_presentation_modes(physical_device) };

    log::info!("available presentation modes {:?}", modes);

    let mode = if modes.contains(&vk::PresentModeKHR::MAILBOX) {
        vk::PresentModeKHR::MAILBOX
    } else {
        vk::PresentModeKHR::IMMEDIATE
    };

    log::info!("chosen presentation mode {:?}", mode);

    mode
}
/// Choose a presentation mode for the swapchain based on the window and chosen
/// physical device.
///
Choose a presentation mode for the swapchain based on the window and chosen
physical device.
Choose a presentation mode for the swapchain based on the window and chosen physical device .
pub fn choose_present_mode(
    window_surface: &dyn WindowSurface,
    physical_device: &vk::PhysicalDevice,
) -> vk::PresentModeKHR {
    //! checking presentation modes is safe because support for the swapchain
    //! extension is verified when picking a physical device
    let modes =
        unsafe { window_surface.supported_presentation_modes(physical_device) };
    log::info!("available presentation modes {:?}", modes);
    let mode = if modes.contains(&vk::PresentModeKHR::MAILBOX) {
        vk::PresentModeKHR::MAILBOX
    } else {
        vk::PresentModeKHR::IMMEDIATE
    };
    log::info!("chosen presentation mode {:?}", mode);
    mode
}
pub fn choose_present_mode ( window_surface : & dyn WindowSurface , physical_device : & vk :: PhysicalDevice , ) -> vk :: PresentModeKHR { //! checking presentation modes is safe because support for the swapchain //! extension is verified when picking a physical device let modes = unsafe { window_surface . supported_presentation_modes ( physical_device ) } ; log :: info ! ( " " modes ) ; let mode = if modes . contains ( & vk :: PresentModeKHR :: MAILBOX ) { vk :: PresentModeKHR :: MAILBOX } else { vk :: PresentModeKHR :: IMMEDIATE } ; log :: info ! ( " " mode ) ; mode }
Choose a presentation mode for the swapchain based on the window and chosen
physical device.
Choose a presentation mode for the swapchain based on the window and chosen physical device .
window_surface
&dyn WindowSurface
physical_device
&vk::PhysicalDevice