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

use utils::vk_traits::*;

/// Wrapper for [VkPerformanceCounterUnitKHR](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkPerformanceCounterUnitKHR.html).
#[repr(i32)]
#[derive(Debug, PartialEq, Copy, Clone)]
pub enum VkPerformanceCounterUnit {
    Generic = 0,
    Percentage = 1,
    Nanoseconds = 2,
    Bytes = 3,
    BytesPerSecond = 4,
    Kelvin = 5,
    Watts = 6,
    Volts = 7,
    Amps = 8,
    Hertz = 9,
    Cycles = 10,
}

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

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

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

impl Default for VkPerformanceCounterUnit {
    fn default() -> VkPerformanceCounterUnit {
        VkPerformanceCounterUnit::Generic
    }
}