ash/extensions/khr/
get_physical_device_properties2.rs1use crate::prelude::*;
4use crate::vk;
5use core::mem;
6use core::ptr;
7
8impl crate::khr::get_physical_device_properties2::Instance {
9 #[inline]
11 pub unsafe fn get_physical_device_features2(
12 &self,
13 physical_device: vk::PhysicalDevice,
14 features: &mut vk::PhysicalDeviceFeatures2KHR<'_>,
15 ) {
16 (self.fp.get_physical_device_features2_khr)(physical_device, features);
17 }
18
19 #[inline]
21 pub unsafe fn get_physical_device_format_properties2(
22 &self,
23 physical_device: vk::PhysicalDevice,
24 format: vk::Format,
25 format_properties: &mut vk::FormatProperties2KHR<'_>,
26 ) {
27 (self.fp.get_physical_device_format_properties2_khr)(
28 physical_device,
29 format,
30 format_properties,
31 );
32 }
33
34 #[inline]
36 pub unsafe fn get_physical_device_image_format_properties2(
37 &self,
38 physical_device: vk::PhysicalDevice,
39 image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR<'_>,
40 image_format_properties: &mut vk::ImageFormatProperties2KHR<'_>,
41 ) -> VkResult<()> {
42 (self.fp.get_physical_device_image_format_properties2_khr)(
43 physical_device,
44 image_format_info,
45 image_format_properties,
46 )
47 .result()
48 }
49
50 #[inline]
52 pub unsafe fn get_physical_device_memory_properties2(
53 &self,
54 physical_device: vk::PhysicalDevice,
55 memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR<'_>,
56 ) {
57 (self.fp.get_physical_device_memory_properties2_khr)(physical_device, memory_properties);
58 }
59
60 #[inline]
62 pub unsafe fn get_physical_device_properties2(
63 &self,
64 physical_device: vk::PhysicalDevice,
65 properties: &mut vk::PhysicalDeviceProperties2KHR<'_>,
66 ) {
67 (self.fp.get_physical_device_properties2_khr)(physical_device, properties);
68 }
69
70 #[inline]
72 pub unsafe fn get_physical_device_queue_family_properties2_len(
73 &self,
74 physical_device: vk::PhysicalDevice,
75 ) -> usize {
76 let mut count = mem::MaybeUninit::uninit();
77 (self.fp.get_physical_device_queue_family_properties2_khr)(
78 physical_device,
79 count.as_mut_ptr(),
80 ptr::null_mut(),
81 );
82 count.assume_init() as usize
83 }
84
85 #[inline]
90 pub unsafe fn get_physical_device_queue_family_properties2(
91 &self,
92 physical_device: vk::PhysicalDevice,
93 out: &mut [vk::QueueFamilyProperties2KHR<'_>],
94 ) {
95 let mut count = out.len() as u32;
96 (self.fp.get_physical_device_queue_family_properties2_khr)(
97 physical_device,
98 &mut count,
99 out.as_mut_ptr(),
100 );
101 assert_eq!(count as usize, out.len());
102 }
103
104 #[inline]
106 pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
107 &self,
108 physical_device: vk::PhysicalDevice,
109 format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR<'_>,
110 ) -> usize {
111 let mut count = mem::MaybeUninit::uninit();
112 (self
113 .fp
114 .get_physical_device_sparse_image_format_properties2_khr)(
115 physical_device,
116 format_info,
117 count.as_mut_ptr(),
118 ptr::null_mut(),
119 );
120 count.assume_init() as usize
121 }
122
123 #[inline]
128 pub unsafe fn get_physical_device_sparse_image_format_properties2(
129 &self,
130 physical_device: vk::PhysicalDevice,
131 format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR<'_>,
132 out: &mut [vk::SparseImageFormatProperties2KHR<'_>],
133 ) {
134 let mut count = out.len() as u32;
135 (self
136 .fp
137 .get_physical_device_sparse_image_format_properties2_khr)(
138 physical_device,
139 format_info,
140 &mut count,
141 out.as_mut_ptr(),
142 );
143 assert_eq!(count as usize, out.len());
144 }
145}