Make api version optional
This commit is contained in:
parent
c09268bee7
commit
0993d57f8e
2 changed files with 4 additions and 4 deletions
|
@ -120,7 +120,7 @@ impl Instance {
|
||||||
instance: VkInstance,
|
instance: VkInstance,
|
||||||
proc_addr: PFN_vkGetInstanceProcAddr,
|
proc_addr: PFN_vkGetInstanceProcAddr,
|
||||||
extensions: &[VkString],
|
extensions: &[VkString],
|
||||||
api_version: u32,
|
api_version: Option<u32>,
|
||||||
) -> Result<Arc<Instance>> {
|
) -> Result<Arc<Instance>> {
|
||||||
log("Instance::preinitialized: start");
|
log("Instance::preinitialized: start");
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ impl Instance {
|
||||||
|
|
||||||
debug_report: None,
|
debug_report: None,
|
||||||
|
|
||||||
api_version,
|
api_version: api_version.unwrap_or(VK_MAKE_VERSION(1, 0, 0)),
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(instance)
|
Ok(instance)
|
||||||
|
|
|
@ -12,11 +12,11 @@ pub mod types;
|
||||||
|
|
||||||
pub mod functions;
|
pub mod functions;
|
||||||
|
|
||||||
pub fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 {
|
pub const fn VK_MAKE_VERSION(major: u32, minor: u32, patch: u32) -> u32 {
|
||||||
(major as u32) << 22 | (minor as u32) << 12 | (patch as u32)
|
(major as u32) << 22 | (minor as u32) << 12 | (patch as u32)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn VK_GET_VERSION(version: u32) -> (u32, u32, u32) {
|
pub const fn VK_GET_VERSION(version: u32) -> (u32, u32, u32) {
|
||||||
let major = version >> 22;
|
let major = version >> 22;
|
||||||
let minor = (version >> 12) & 0x03FF;
|
let minor = (version >> 12) & 0x03FF;
|
||||||
let patch = version & 0x00CF;
|
let patch = version & 0x00CF;
|
||||||
|
|
Loading…
Reference in a new issue