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
// Generated by `scripts/generate_vk.js`

use utils::vk_traits::*;

pub type RawVkDescriptorPoolCreateFlags = u32;

#[derive(Debug, Clone, Copy)]
pub struct VkDescriptorPoolCreateFlags {
    pub free_descriptor_set: bool,
    pub update_after_bind_ext: bool,
}

impl VkRawType<VkDescriptorPoolCreateFlags> for RawVkDescriptorPoolCreateFlags {
    fn vk_to_wrapped(src: &RawVkDescriptorPoolCreateFlags) -> VkDescriptorPoolCreateFlags {
        VkDescriptorPoolCreateFlags {
            free_descriptor_set: (src & 0x00000001) != 0,
            update_after_bind_ext: (src & 0x00000002) != 0,
        }
    }
}

impl VkWrappedType<RawVkDescriptorPoolCreateFlags> for VkDescriptorPoolCreateFlags {
    fn vk_to_raw(src: &VkDescriptorPoolCreateFlags, dst: &mut RawVkDescriptorPoolCreateFlags) {
        *dst = 0;
        if src.free_descriptor_set { *dst |= 0x00000001; }
        if src.update_after_bind_ext { *dst |= 0x00000002; }
    }
}

impl Default for VkDescriptorPoolCreateFlags {
    fn default() -> VkDescriptorPoolCreateFlags {
        VkDescriptorPoolCreateFlags {
            free_descriptor_set: false,
            update_after_bind_ext: false,
        }
    }
}

impl VkDescriptorPoolCreateFlags {
    
    pub fn none() -> VkDescriptorPoolCreateFlags {
        VkDescriptorPoolCreateFlags {
            free_descriptor_set: false,
            update_after_bind_ext: false,
        }
    }
    
    pub fn all() -> VkDescriptorPoolCreateFlags {
        VkDescriptorPoolCreateFlags {
            free_descriptor_set: true,
            update_after_bind_ext: true,
        }
    }
}