pub fn find_optimal(
    instance: &Instance,
    window_surface: &dyn WindowSurface,
) -> Result<vk::PhysicalDevice> {
    let physical_devices =
        unsafe { instance.ash.enumerate_physical_devices()? };
    let physical_device = physical_devices
        .iter()
        .find(|device| is_device_suitable(&instance, device, window_surface))
        .context("unable to pick a suitable device")?;
    Ok(*physical_device)
}
/// Pick a physical device based on suitability criteria.
Pick a physical device based on suitability criteria.
Pick a physical device based on suitability criteria .
pub fn find_optimal(
    instance: &Instance,
    window_surface: &dyn WindowSurface,
) -> Result<vk::PhysicalDevice> {
    let physical_devices =
        unsafe { instance.ash.enumerate_physical_devices()? };
    let physical_device = physical_devices
        .iter()
        .find(|device| is_device_suitable(&instance, device, window_surface))
        .context("unable to pick a suitable device")?;
    Ok(*physical_device)
}
pub fn find_optimal ( instance : & Instance , window_surface : & dyn WindowSurface , ) -> Result < vk :: PhysicalDevice > { let physical_devices = unsafe { instance . ash . enumerate_physical_devices ( ) ? } ; let physical_device = physical_devices . iter ( ) . find ( | device | is_device_suitable ( & instance , device , window_surface ) ) . context ( " " ) ? ; Ok ( * physical_device ) }
Pick a physical device based on suitability criteria.
Pick a physical device based on suitability criteria .
instance
&Instance
window_surface
&dyn WindowSurface