1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Generated by `scripts/generate.js`

use utils::vk_traits::*;

/// Wrapper for [VkDescriptorSetLayoutCreateFlagBits](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkDescriptorSetLayoutCreateFlagBits.html)
#[derive(Debug, Clone, Copy)]
pub struct VkDescriptorSetLayoutCreateFlags {
    pub push_descriptor_khr: bool,
    pub update_after_bind_pool_ext: bool,
}

#[doc(hidden)]
pub type RawVkDescriptorSetLayoutCreateFlags = u32;

impl VkWrappedType<RawVkDescriptorSetLayoutCreateFlags> for VkDescriptorSetLayoutCreateFlags {
    fn vk_to_raw(src: &VkDescriptorSetLayoutCreateFlags, dst: &mut RawVkDescriptorSetLayoutCreateFlags) {
        *dst = 0;
        if src.push_descriptor_khr { *dst |= 0x00000001; }
        if src.update_after_bind_pool_ext { *dst |= 0x00000002; }
    }
}

impl VkRawType<VkDescriptorSetLayoutCreateFlags> for RawVkDescriptorSetLayoutCreateFlags {
    fn vk_to_wrapped(src: &RawVkDescriptorSetLayoutCreateFlags) -> VkDescriptorSetLayoutCreateFlags {
        VkDescriptorSetLayoutCreateFlags {
            push_descriptor_khr: (src & 0x00000001) != 0,
            update_after_bind_pool_ext: (src & 0x00000002) != 0,
        }
    }
}

impl Default for VkDescriptorSetLayoutCreateFlags {
    fn default() -> VkDescriptorSetLayoutCreateFlags {
        VkDescriptorSetLayoutCreateFlags {
            push_descriptor_khr: false,
            update_after_bind_pool_ext: false,
        }
    }
}

impl VkDescriptorSetLayoutCreateFlags {
    
    pub fn none() -> VkDescriptorSetLayoutCreateFlags {
        VkDescriptorSetLayoutCreateFlags {
            push_descriptor_khr: false,
            update_after_bind_pool_ext: false,
        }
    }
    
    pub fn all() -> VkDescriptorSetLayoutCreateFlags {
        VkDescriptorSetLayoutCreateFlags {
            push_descriptor_khr: true,
            update_after_bind_pool_ext: true,
        }
    }
}

#[macro_export]
macro_rules! VkDescriptorSetLayoutCreateFlags {
    ( $( $x:ident ),* ) => {
        VkDescriptorSetLayoutCreateFlags {
            $($x: true,)*
            ..VkDescriptorSetLayoutCreateFlags::none()
        }
    }
}

impl VkDescriptorSetLayoutCreateFlags {
    
    pub fn to_u32(&self) -> u32 {
        0
        + if self.push_descriptor_khr { 0x00000001 } else { 0 }
        + if self.update_after_bind_pool_ext { 0x00000002 } else { 0 }
    }
}