fn rank_device(
    instance: &Instance, physical_device: vk::PhysicalDevice,
    surface_and_extension: &SurfaceAndExtension,
  ) -> (vk::PhysicalDevice, i32) {
    let device_properties = unsafe { instance.get_physical_device_properties(physical_device) };
    // TODO(issue#18) CONFIG utilize physicsl_device_features

    if !Self::is_device_suitable(instance, physical_device, surface_and_extension).unwrap_or(false)
    {
      return (physical_device, -1);
    }

    let mut score = 0;
    if device_properties.device_type == vk::PhysicalDeviceType::DISCRETE_GPU {
      score += 10;
    } else if device_properties.device_type == vk::PhysicalDeviceType::INTEGRATED_GPU {
      score += 5;
    }

    (physical_device, score)
  }
/// Rank the devices based on an internal scoring mechanism.
/// A score of -1 means the device is not supported.
///
/// TODO(issue#18) CONFIG add ways to configure device selection later.
Rank the devices based on an internal scoring mechanism.
A score of -1 means the device is not supported.


Rank the devices based on an internal scoring mechanism . A score of - 1 means the device is not supported .
fn rank_device(
    instance: &Instance, physical_device: vk::PhysicalDevice,
    surface_and_extension: &SurfaceAndExtension,
  ) -> (vk::PhysicalDevice, i32) {
    let device_properties = unsafe { instance.get_physical_device_properties(physical_device) };
    // TODO(issue#18) CONFIG utilize physicsl_device_features
    if !Self::is_device_suitable(instance, physical_device, surface_and_extension).unwrap_or(false)
    {
      return (physical_device, -1);
    }
    let mut score = 0;
    if device_properties.device_type == vk::PhysicalDeviceType::DISCRETE_GPU {
      score += 10;
    } else if device_properties.device_type == vk::PhysicalDeviceType::INTEGRATED_GPU {
      score += 5;
    }
    (physical_device, score)
  }
fn rank_device ( instance : & Instance , physical_device : vk :: PhysicalDevice , surface_and_extension : & SurfaceAndExtension , ) -> ( vk :: PhysicalDevice , i32 ) { let device_properties = unsafe { instance . get_physical_device_properties ( physical_device ) } ; // TODO(issue#18) CONFIG utilize physicsl_device_features if ! Self :: is_device_suitable ( instance , physical_device , surface_and_extension ) . unwrap_or ( false ) { return ( physical_device , - 1 ) ; } let mut score = 0 ; if device_properties . device_type == vk :: PhysicalDeviceType :: DISCRETE_GPU { score += 10 ; } else if device_properties . device_type == vk :: PhysicalDeviceType :: INTEGRATED_GPU { score += 5 ; } ( physical_device , score ) }
Rank the devices based on an internal scoring mechanism.
Rank the devices based on an internal scoring mechanism .
instance
&Instance
physical_device
vk::PhysicalDevice
surface_and_extension
&SurfaceAndExtension
instance
&Instance
physical_device
vk::PhysicalDevice
surface_and_extension
&SurfaceAndExtension