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

use utils::vk_traits::*;

/// Wrapper for [VkImageLayout](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkImageLayout.html).
#[repr(i32)]
#[derive(Debug, PartialEq, Copy, Clone)]
pub enum VkImageLayout {
    Undefined = 0,
    General = 1,
    ColorAttachmentOptimal = 2,
    DepthStencilAttachmentOptimal = 3,
    DepthStencilReadOnlyOptimal = 4,
    ShaderReadOnlyOptimal = 5,
    TransferSrcOptimal = 6,
    TransferDstOptimal = 7,
    Preinitialized = 8,
    DepthReadOnlyStencilAttachmentOptimal = 1000117000,
    DepthAttachmentStencilReadOnlyOptimal = 1000117001,
    PresentSrcKhr = 1000001002,
    SharedPresentKhr = 1000111000,
    ShadingRateOptimalNv = 1000164003,
    FragmentDensityMapOptimalExt = 1000218000,
    DepthAttachmentOptimalKhr = 1000241000,
    DepthReadOnlyOptimalKhr = 1000241001,
    StencilAttachmentOptimalKhr = 1000241002,
    StencilReadOnlyOptimalKhr = 1000241003,
}

#[doc(hidden)]
pub type RawVkImageLayout = i32;

impl VkWrappedType<RawVkImageLayout> for VkImageLayout {
    fn vk_to_raw(src: &VkImageLayout, dst: &mut RawVkImageLayout) {
        *dst = *src as i32
    }
}

impl VkRawType<VkImageLayout> for RawVkImageLayout {
    fn vk_to_wrapped(src: &RawVkImageLayout) -> VkImageLayout {
        unsafe {
            *((src as *const i32) as *const VkImageLayout)
        }
    }
}

impl Default for VkImageLayout {
    fn default() -> VkImageLayout {
        VkImageLayout::Undefined
    }
}