use utils::vk_traits::*;
#[derive(Debug, Clone)]
pub struct VkPipelineCacheCreateFlags {
pub externally_synchronized_ext: bool,
}
#[doc(hidden)]
pub type RawVkPipelineCacheCreateFlags = u32;
impl VkWrappedType<RawVkPipelineCacheCreateFlags> for VkPipelineCacheCreateFlags {
fn vk_to_raw(src: &VkPipelineCacheCreateFlags, dst: &mut RawVkPipelineCacheCreateFlags) {
*dst = 0;
if src.externally_synchronized_ext { *dst |= 0x00000001; }
}
}
impl VkRawType<VkPipelineCacheCreateFlags> for RawVkPipelineCacheCreateFlags {
fn vk_to_wrapped(src: &RawVkPipelineCacheCreateFlags) -> VkPipelineCacheCreateFlags {
VkPipelineCacheCreateFlags {
externally_synchronized_ext: (src & 0x00000001) != 0,
}
}
}
impl Default for VkPipelineCacheCreateFlags {
fn default() -> VkPipelineCacheCreateFlags {
VkPipelineCacheCreateFlags {
externally_synchronized_ext: false,
}
}
}
impl VkPipelineCacheCreateFlags {
pub fn none() -> Self {
VkPipelineCacheCreateFlags {
externally_synchronized_ext: false,
}
}
pub fn all() -> Self {
VkPipelineCacheCreateFlags {
externally_synchronized_ext: true,
}
}
pub fn to_u32(&self) -> u32 {
0
+ if self.externally_synchronized_ext { 0x00000001 } else { 0 }
}
pub fn from_u32(value: u32) -> Self {
VkPipelineCacheCreateFlags {
externally_synchronized_ext: value & 0x00000001 > 0,
}
}
}
#[doc(hidden)]
#[macro_export]
macro_rules! VkPipelineCacheCreateFlags {
( $( $x:ident ),* ) => {
VkPipelineCacheCreateFlags {
$($x: true,)*
..VkPipelineCacheCreateFlags::none()
}
}
}