vulkanalia_sys/
macros.rs

1// SPDX-License-Identifier: Apache-2.0
2
3// DO NOT EDIT.
4//
5// This file has been generated by the Kotlin project in the `generator`
6// directory from a Vulkan API registry.
7
8#![allow(
9    non_camel_case_types,
10    non_snake_case,
11    clippy::bad_bit_mask,
12    clippy::let_unit_value,
13    clippy::missing_safety_doc,
14    clippy::missing_transmute_annotations,
15    clippy::needless_lifetimes,
16    clippy::too_many_arguments,
17    clippy::type_complexity,
18    clippy::unnecessary_cast,
19    clippy::upper_case_acronyms,
20    clippy::useless_transmute
21)]
22
23/// <https://www.khronos.org/registry/vulkan/specs/latest/man/html/VK_MAKE_VERSION.html>
24#[inline]
25pub const fn make_version(major: u32, minor: u32, patch: u32) -> u32 {
26    (major << 22) | (minor << 12) | patch
27}
28
29/// <https://www.khronos.org/registry/vulkan/specs/latest/man/html/VK_VERSION_MAJOR.html>
30#[inline]
31pub const fn version_major(version: u32) -> u32 {
32    version >> 22
33}
34
35/// <https://www.khronos.org/registry/vulkan/specs/latest/man/html/VK_VERSION_MINOR.html>
36#[inline]
37pub const fn version_minor(version: u32) -> u32 {
38    (version >> 12) & 0x3FF
39}
40
41/// <https://www.khronos.org/registry/vulkan/specs/latest/man/html/VK_VERSION_PATCH.html>
42#[inline]
43pub const fn version_patch(version: u32) -> u32 {
44    version & 0xFFF
45}