Osspial / vk-rs

Collection of Rust libraries for the Vulkan API
MIT License
24 stars 4 forks source link

`vk_version_*!`-macros are wrong #20

Open TimDiekmann opened 6 years ago

TimDiekmann commented 6 years ago

The macros vk_version_major! and vk_version_minor!.

Expected:

#[macro_export]
macro_rules! vk_version_major {
    ($major: expr) => (($major as uint32_t) >> 22)
}
#[macro_export]
macro_rules! vk_version_minor {
    ($minor: expr) => ((($minor as uint32_t) >> 12) & 0x3ff)
}

Currently:

#[macro_export]
macro_rules! vk_version_major {
    ($major: expr) => (($major as uint32_t) << 22)
}
#[macro_export]
macro_rules! vk_version_minor {
    ($minor: expr) => ((($minor as uint32_t) << 12) & 0x3ff)
}

However, the macros have the same problem as in #16