fn device_is_suitable(physical_device: &PhysicalDevice, surface: &SurfaceKhr)
    -> VdResult<bool> {
    let device_features = physical_device.features();

    let extensions_supported = physical_device.verify_extension_support(
        REQUIRED_DEVICE_EXTENSIONS)?;

    let mut swap_chain_adequate = false;
    if extensions_supported {
        let swap_chain_details = SwapchainSupportDetails::new(surface,
            &physical_device)?;
        swap_chain_adequate = !swap_chain_details.formats.is_empty() &&
            !swap_chain_details.present_modes.is_empty()
    }

    let queue_family_indices = find_queue_families(&physical_device, surface)?;

    Ok(extensions_supported &&
        swap_chain_adequate &&
        device_features.sampler_anisotropy())
}
/// Returns true if the specified physical device has the required features,
/// extensions, queue families and if the supported swap chain has the correct
/// presentation modes.
Returns true if the specified physical device has the required features,
extensions, queue families and if the supported swap chain has the correct
presentation modes.
Returns true if the specified physical device has the required features extensions queue families and if the supported swap chain has the correct presentation modes .
fn device_is_suitable(physical_device: &PhysicalDevice, surface: &SurfaceKhr)
    -> VdResult<bool> {
    let device_features = physical_device.features();
    let extensions_supported = physical_device.verify_extension_support(
        REQUIRED_DEVICE_EXTENSIONS)?;
    let mut swap_chain_adequate = false;
    if extensions_supported {
        let swap_chain_details = SwapchainSupportDetails::new(surface,
            &physical_device)?;
        swap_chain_adequate = !swap_chain_details.formats.is_empty() &&
            !swap_chain_details.present_modes.is_empty()
    }
    let queue_family_indices = find_queue_families(&physical_device, surface)?;
    Ok(extensions_supported &&
        swap_chain_adequate &&
        device_features.sampler_anisotropy())
}
fn device_is_suitable ( physical_device : & PhysicalDevice , surface : & SurfaceKhr ) -> VdResult < bool > { let device_features = physical_device . features ( ) ; let extensions_supported = physical_device . verify_extension_support ( REQUIRED_DEVICE_EXTENSIONS ) ? ; let mut swap_chain_adequate = false ; if extensions_supported { let swap_chain_details = SwapchainSupportDetails :: new ( surface , & physical_device ) ? ; swap_chain_adequate = ! swap_chain_details . formats . is_empty ( ) && ! swap_chain_details . present_modes . is_empty ( ) } let queue_family_indices = find_queue_families ( & physical_device , surface ) ? ; Ok ( extensions_supported && swap_chain_adequate && device_features . sampler_anisotropy ( ) ) }
Returns true if the specified physical device has the required features,
extensions, queue families and if the supported swap chain has the correct
presentation modes.
Returns true if the specified physical device has the required features extensions queue families and if the supported swap chain has the correct presentation modes .
physical_device
&PhysicalDevice
surface
&SurfaceKhr
physical_device
&PhysicalDevice
surface
&SurfaceKhr