fn device_supports_required_extensions(
    instance: &Instance, physical_device: vk::PhysicalDevice,
  ) -> SarektResult<bool> {
    let device_extension_properties =
      unsafe { instance.enumerate_device_extension_properties(physical_device)? };

    let supports_swapchain = device_extension_properties
      .iter()
      .map(|ext_props| ext_props.extension_name)
      .any(|ext_name| unsafe {
        // TODO(issue#9) OFFSCREEN only if drawing to a window.
        CStr::from_ptr(ext_name.as_ptr() as *const c_char)
          .eq(ash::extensions::khr::Swapchain::name())
      });

    Ok(supports_swapchain)
  }
/// Goes through and checks if the device supports all needed extensions for
/// current configuration, such as swapchains when drawing to a window.
Goes through and checks if the device supports all needed extensions for
current configuration, such as swapchains when drawing to a window.
Goes through and checks if the device supports all needed extensions for current configuration such as swapchains when drawing to a window .
fn device_supports_required_extensions(
    instance: &Instance, physical_device: vk::PhysicalDevice,
  ) -> SarektResult<bool> {
    let device_extension_properties =
      unsafe { instance.enumerate_device_extension_properties(physical_device)? };
    let supports_swapchain = device_extension_properties
      .iter()
      .map(|ext_props| ext_props.extension_name)
      .any(|ext_name| unsafe {
        // TODO(issue#9) OFFSCREEN only if drawing to a window.
        CStr::from_ptr(ext_name.as_ptr() as *const c_char)
          .eq(ash::extensions::khr::Swapchain::name())
      });
    Ok(supports_swapchain)
  }
fn device_supports_required_extensions ( instance : & Instance , physical_device : vk :: PhysicalDevice , ) -> SarektResult < bool > { let device_extension_properties = unsafe { instance . enumerate_device_extension_properties ( physical_device ) ? } ; let supports_swapchain = device_extension_properties . iter ( ) . map ( | ext_props | ext_props . extension_name ) . any ( | ext_name | unsafe { // TODO(issue#9) OFFSCREEN only if drawing to a window. CStr :: from_ptr ( ext_name . as_ptr ( ) as * const c_char ) . eq ( ash :: extensions :: khr :: Swapchain :: name ( ) ) } ) ; Ok ( supports_swapchain ) }
Goes through and checks if the device supports all needed extensions for
current configuration, such as swapchains when drawing to a window.
Goes through and checks if the device supports all needed extensions for current configuration such as swapchains when drawing to a window .
instance
&Instance
physical_device
vk::PhysicalDevice
instance
&Instance
physical_device
vk::PhysicalDevice