pub fn select_queue_family_index(
    adapter: &AdapterInner,
    queue_flags: vk::QueueFlags,
    surface: Option<&SurfaceInner>,
) -> Result<u32, Error> {
    for (queue_family_index, queue_family) in adapter.queue_family_properties.iter().enumerate() {
        let queue_family_index = queue_family_index as u32;
        if let Some(surface) = surface {
            if !adapter.get_surface_support(surface, queue_family_index)? {
                continue;
            }
        }
        if queue_family.queue_flags.contains(queue_flags) && queue_family.queue_count > 0 {
            return Ok(queue_family_index);
        }
    }

    Err(Error::from(vk::Result::ERROR_INCOMPATIBLE_DISPLAY_KHR))
}
/// Recipe: _Selecting a queue family that supports presentation to a given surface_ (page `81`)
///
/// Selects a queue family with the requested `queue_flags` and support for surface presentation.
_Selecting a queue family that supports presentation to a given surface_ (page `81`)
Selects a queue family with the requested `queue_flags` and support for surface presentation.
_Selecting a queue family that supports presentation to a given surface_ ( page ` 81 ` ) Selects a queue family with the requested ` queue_flags ` and support for surface presentation .
pub fn select_queue_family_index(
    adapter: &AdapterInner,
    queue_flags: vk::QueueFlags,
    surface: Option<&SurfaceInner>,
) -> Result<u32, Error> {
    for (queue_family_index, queue_family) in adapter.queue_family_properties.iter().enumerate() {
        let queue_family_index = queue_family_index as u32;
        if let Some(surface) = surface {
            if !adapter.get_surface_support(surface, queue_family_index)? {
                continue;
            }
        }
        if queue_family.queue_flags.contains(queue_flags) && queue_family.queue_count > 0 {
            return Ok(queue_family_index);
        }
    }
    Err(Error::from(vk::Result::ERROR_INCOMPATIBLE_DISPLAY_KHR))
}
pub fn select_queue_family_index ( adapter : & AdapterInner , queue_flags : vk :: QueueFlags , surface : Option < & SurfaceInner > , ) -> Result < u32 , Error > { for ( queue_family_index , queue_family ) in adapter . queue_family_properties . iter ( ) . enumerate ( ) { let queue_family_index = queue_family_index as u32 ; if let Some ( surface ) = surface { if ! adapter . get_surface_support ( surface , queue_family_index ) ? { continue ; } } if queue_family . queue_flags . contains ( queue_flags ) && queue_family . queue_count > 0 { return Ok ( queue_family_index ) ; } } Err ( Error :: from ( vk :: Result :: ERROR_INCOMPATIBLE_DISPLAY_KHR ) ) }
Recipe: _Selecting a queue family that supports presentation to a given surface_ (page `81`)
Selects a queue family with the requested `queue_flags` and support for surface presentation.
Recipe : _Selecting a queue family that supports presentation to a given surface_ ( page ` 81 ` ) Selects a queue family with the requested ` queue_flags ` and support for surface presentation .
adapter
&AdapterInner
queue_flags
vk::QueueFlags
surface
Option<&SurfaceInner>
adapter
&AdapterInner
queue_flags
vk::QueueFlags
surface
Option<&SurfaceInner>