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