pub fn find(
        physical_device: &vk::PhysicalDevice,
        ash: &ash::Instance,
        window_surface: &dyn WindowSurface,
    ) -> Result<Self> {
        let queue_families = unsafe {
            ash.get_physical_device_queue_family_properties(*physical_device)
        };

        let mut graphics_family = None;
        let mut present_family = None;

        queue_families.iter().enumerate().for_each(|(i, family)| {
            if family.queue_flags.contains(vk::QueueFlags::GRAPHICS) {
                graphics_family = Some(i as u32);
            }

            let present_support = unsafe {
                window_surface.get_physical_device_surface_support(
                    physical_device,
                    i as u32,
                )
            };
            match present_support {
                Ok(true) => {
                    present_family = Some(i as u32);
                }
                _ => {}
            }
        });

        let graphics_family_index = graphics_family
            .context("unable to find queue family which supports graphics")?;

        let present_family_index = present_family
            .context("unable to find a queue which supports presentation")?;

        Ok(Self {
            graphics_family_index,
            present_family_index,
        })
    }
/// Find all of the queue families required by this application.
///
/// Yields an Err if any of the queues cannot be found.
///
/// The implementation is greedy, e.g. the same queue will be used for
/// multiple operations where possible.
Find all of the queue families required by this application.
Yields an Err if any of the queues cannot be found.

The implementation is greedy, e.g. the same queue will be used for
multiple operations where possible.
Find all of the queue families required by this application . Yields an Err if any of the queues cannot be found . The implementation is greedy e . g . the same queue will be used for multiple operations where possible .
pub fn find(
        physical_device: &vk::PhysicalDevice,
        ash: &ash::Instance,
        window_surface: &dyn WindowSurface,
    ) -> Result<Self> {
        let queue_families = unsafe {
            ash.get_physical_device_queue_family_properties(*physical_device)
        };
        let mut graphics_family = None;
        let mut present_family = None;
        queue_families.iter().enumerate().for_each(|(i, family)| {
            if family.queue_flags.contains(vk::QueueFlags::GRAPHICS) {
                graphics_family = Some(i as u32);
            }
            let present_support = unsafe {
                window_surface.get_physical_device_surface_support(
                    physical_device,
                    i as u32,
                )
            };
            match present_support {
                Ok(true) => {
                    present_family = Some(i as u32);
                }
                _ => {}
            }
        });
        let graphics_family_index = graphics_family
            .context("unable to find queue family which supports graphics")?;
        let present_family_index = present_family
            .context("unable to find a queue which supports presentation")?;
        Ok(Self {
            graphics_family_index,
            present_family_index,
        })
    }
pub fn find ( physical_device : & vk :: PhysicalDevice , ash : & ash :: Instance , window_surface : & dyn WindowSurface , ) -> Result < Self > { let queue_families = unsafe { ash . get_physical_device_queue_family_properties ( * physical_device ) } ; let mut graphics_family = None ; let mut present_family = None ; queue_families . iter ( ) . enumerate ( ) . for_each ( | ( i , family ) | { if family . queue_flags . contains ( vk :: QueueFlags :: GRAPHICS ) { graphics_family = Some ( i as u32 ) ; } let present_support = unsafe { window_surface . get_physical_device_surface_support ( physical_device , i as u32 , ) } ; match present_support { Ok ( true ) => { present_family = Some ( i as u32 ) ; } _ => { } } } ) ; let graphics_family_index = graphics_family . context ( " " ) ? ; let present_family_index = present_family . context ( " " ) ? ; Ok ( Self { graphics_family_index , present_family_index , } ) }
Find all of the queue families required by this application.
Find all of the queue families required by this application .
physical_device
&vk::PhysicalDevice
ash
&ash::Instance
window_surface
&dyn WindowSurface