pub fn new(instance: ArcVulkanInstance, physical_device: VkPhysicalDevice) -> Self {
        unsafe {
            let mut features = MaybeUninit::uninit();
            (instance.as_ref().fns().vkGetPhysicalDeviceFeatures)(
                physical_device,
                features.as_mut_ptr(),
            );

            let mut properties = MaybeUninit::uninit();
            (instance.as_ref().fns().vkGetPhysicalDeviceProperties)(
                physical_device,
                properties.as_mut_ptr(),
            );

            let mut memory_properties = MaybeUninit::uninit();
            (instance.as_ref().fns().vkGetPhysicalDeviceMemoryProperties)(
                physical_device,
                memory_properties.as_mut_ptr(),
            );

            let mut count = MaybeUninit::uninit();
            (instance
                .as_ref()
                .fns()
                .vkGetPhysicalDeviceQueueFamilyProperties)(
                physical_device,
                count.as_mut_ptr(),
                ptr::null_mut(),
            );

            let mut queue_families: Vec<VkQueueFamilyProperties> =
                Vec::with_capacity(count.assume_init() as _);
            queue_families.set_len(count.assume_init() as _);
            (instance
                .as_ref()
                .fns()
                .vkGetPhysicalDeviceQueueFamilyProperties)(
                physical_device,
                count.as_mut_ptr(),
                queue_families.as_mut_ptr(),
            );

            Self {
                msaa_samples: get_max_sample_count(properties.assume_init_ref()),
                depth_format: get_depth_format(instance.as_ref(), physical_device),
                queue_families,
                features: features.assume_init(),
                properties: properties.assume_init(),
                memory_properties: memory_properties.assume_init(),
                physical_device,
                instance,
            }
        }
    }
// Select the best physical device.
Select the best physical device.
Select the best physical device .
pub fn new(instance: ArcVulkanInstance, physical_device: VkPhysicalDevice) -> Self {
        unsafe {
            let mut features = MaybeUninit::uninit();
            (instance.as_ref().fns().vkGetPhysicalDeviceFeatures)(
                physical_device,
                features.as_mut_ptr(),
            );
            let mut properties = MaybeUninit::uninit();
            (instance.as_ref().fns().vkGetPhysicalDeviceProperties)(
                physical_device,
                properties.as_mut_ptr(),
            );
            let mut memory_properties = MaybeUninit::uninit();
            (instance.as_ref().fns().vkGetPhysicalDeviceMemoryProperties)(
                physical_device,
                memory_properties.as_mut_ptr(),
            );
            let mut count = MaybeUninit::uninit();
            (instance
                .as_ref()
                .fns()
                .vkGetPhysicalDeviceQueueFamilyProperties)(
                physical_device,
                count.as_mut_ptr(),
                ptr::null_mut(),
            );
            let mut queue_families: Vec<VkQueueFamilyProperties> =
                Vec::with_capacity(count.assume_init() as _);
            queue_families.set_len(count.assume_init() as _);
            (instance
                .as_ref()
                .fns()
                .vkGetPhysicalDeviceQueueFamilyProperties)(
                physical_device,
                count.as_mut_ptr(),
                queue_families.as_mut_ptr(),
            );
            Self {
                msaa_samples: get_max_sample_count(properties.assume_init_ref()),
                depth_format: get_depth_format(instance.as_ref(), physical_device),
                queue_families,
                features: features.assume_init(),
                properties: properties.assume_init(),
                memory_properties: memory_properties.assume_init(),
                physical_device,
                instance,
            }
        }
    }
pub fn new ( instance : ArcVulkanInstance , physical_device : VkPhysicalDevice ) -> Self { unsafe { let mut features = MaybeUninit :: uninit ( ) ; ( instance . as_ref ( ) . fns ( ) . vkGetPhysicalDeviceFeatures ) ( physical_device , features . as_mut_ptr ( ) , ) ; let mut properties = MaybeUninit :: uninit ( ) ; ( instance . as_ref ( ) . fns ( ) . vkGetPhysicalDeviceProperties ) ( physical_device , properties . as_mut_ptr ( ) , ) ; let mut memory_properties = MaybeUninit :: uninit ( ) ; ( instance . as_ref ( ) . fns ( ) . vkGetPhysicalDeviceMemoryProperties ) ( physical_device , memory_properties . as_mut_ptr ( ) , ) ; let mut count = MaybeUninit :: uninit ( ) ; ( instance . as_ref ( ) . fns ( ) . vkGetPhysicalDeviceQueueFamilyProperties ) ( physical_device , count . as_mut_ptr ( ) , ptr :: null_mut ( ) , ) ; let mut queue_families : Vec < VkQueueFamilyProperties > = Vec :: with_capacity ( count . assume_init ( ) as _ ) ; queue_families . set_len ( count . assume_init ( ) as _ ) ; ( instance . as_ref ( ) . fns ( ) . vkGetPhysicalDeviceQueueFamilyProperties ) ( physical_device , count . as_mut_ptr ( ) , queue_families . as_mut_ptr ( ) , ) ; Self { msaa_samples : get_max_sample_count ( properties . assume_init_ref ( ) ) , depth_format : get_depth_format ( instance . as_ref ( ) , physical_device ) , queue_families , features : features . assume_init ( ) , properties : properties . assume_init ( ) , memory_properties : memory_properties . assume_init ( ) , physical_device , instance , } } }
Select the best physical device.
Select the best physical device .
instance
ArcVulkanInstance
physical_device
VkPhysicalDevice
instance
ArcVulkanInstance
physical_device
VkPhysicalDevice