1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use {crate::VulkanInstance, ash::vk};
#[derive(Copy, Clone, Debug, Default)]
pub struct PhysicalDeviceProperties {
physical_device_properties: vk::PhysicalDeviceProperties2,
}
impl PhysicalDeviceProperties {
pub fn from_physical_device(
instance: &VulkanInstance,
physical_device: &vk::PhysicalDevice,
) -> Self {
let mut properties = Self::default();
unsafe {
instance.ash().get_physical_device_properties2(
*physical_device,
properties.link_p_next_chain(),
)
};
properties
}
pub fn properties(&self) -> &vk::PhysicalDeviceProperties {
&self.physical_device_properties.properties
}
pub fn properties_mut(&mut self) -> &mut vk::PhysicalDeviceProperties {
&mut self.physical_device_properties.properties
}
pub unsafe fn link_p_next_chain(
&mut self,
) -> &mut vk::PhysicalDeviceProperties2 {
&mut self.physical_device_properties
}
}