pub fn choose_image_count(
    window_surface: &dyn WindowSurface,
    physical_device: &vk::PhysicalDevice,
) -> Result<u32> {
    //! querying surface capabilities is safe in this context because the
    //! physical device will not be selected unless it supports the swapchain
    //! extension
    let capabilities =
        unsafe { window_surface.surface_capabilities(physical_device)? };
    let proposed_image_count = capabilities.min_image_count + 1;
    if capabilities.max_image_count > 0 {
        Ok(std::cmp::min(
            proposed_image_count,
            capabilities.max_image_count,
        ))
    } else {
        Ok(proposed_image_count)
    }
}
/// Choose the number of images to use in the swapchain based on the min and
/// max numbers of images supported by the device.
Choose the number of images to use in the swapchain based on the min and
max numbers of images supported by the device.
Choose the number of images to use in the swapchain based on the min and max numbers of images supported by the device .
pub fn choose_image_count(
    window_surface: &dyn WindowSurface,
    physical_device: &vk::PhysicalDevice,
) -> Result<u32> {
    //! querying surface capabilities is safe in this context because the
    //! physical device will not be selected unless it supports the swapchain
    //! extension
    let capabilities =
        unsafe { window_surface.surface_capabilities(physical_device)? };
    let proposed_image_count = capabilities.min_image_count + 1;
    if capabilities.max_image_count > 0 {
        Ok(std::cmp::min(
            proposed_image_count,
            capabilities.max_image_count,
        ))
    } else {
        Ok(proposed_image_count)
    }
}
pub fn choose_image_count ( window_surface : & dyn WindowSurface , physical_device : & vk :: PhysicalDevice , ) -> Result < u32 > { //! querying surface capabilities is safe in this context because the //! physical device will not be selected unless it supports the swapchain //! extension let capabilities = unsafe { window_surface . surface_capabilities ( physical_device ) ? } ; let proposed_image_count = capabilities . min_image_count + 1 ; if capabilities . max_image_count > 0 { Ok ( std :: cmp :: min ( proposed_image_count , capabilities . max_image_count , ) ) } else { Ok ( proposed_image_count ) } }
Choose the number of images to use in the swapchain based on the min and
max numbers of images supported by the device.
Choose the number of images to use in the swapchain based on the min and max numbers of images supported by the device .
window_surface
&dyn WindowSurface
physical_device
&vk::PhysicalDevice