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
47
48
49
50
51
52
53
54
use crate::device::physical::PhysicalDevice;
pub use crate::extensions::{
ExtensionRestriction, ExtensionRestrictionError, OneOfRequirements, SupportedExtensionsError,
};
use crate::instance::InstanceExtensions;
use crate::Version;
use std::ffi::{CStr, CString};
use std::fmt::Formatter;
include!(concat!(env!("OUT_DIR"), "/device_extensions.rs"));
impl DeviceExtensions {
#[deprecated(
since = "0.25",
note = "Use PhysicalDevice::supported_extensions instead"
)]
pub fn supported_by_device_raw(
physical_device: PhysicalDevice,
) -> Result<Self, SupportedExtensionsError> {
Ok(*physical_device.supported_extensions())
}
#[deprecated(
since = "0.25",
note = "Use PhysicalDevice::supported_extensions instead"
)]
pub fn supported_by_device(physical_device: PhysicalDevice) -> Self {
*physical_device.supported_extensions()
}
}
#[cfg(test)]
mod tests {
use crate::device::DeviceExtensions;
use std::ffi::CString;
#[test]
fn empty_extensions() {
let d: Vec<CString> = (&DeviceExtensions::none()).into();
assert!(d.iter().next().is_none());
}
}