Skip to main content

lava/vulkan/vk/
vk_pipeline_layout.rs

1// Generated by `scripts/generate.js`
2
3use utils::c_bindings::*;
4use utils::vk_traits::*;
5use utils::vk_ptr::*;
6use utils::vk_convert::*;
7use std::os::raw::c_char;
8use std::ops::Drop;
9use std::ptr;
10use std::mem;
11use std::cmp;
12use std::slice;
13use vulkan::*;
14use vulkan::vk::*;
15
16#[doc(hidden)]
17pub type RawVkPipelineLayout = u64;
18
19/// Wrapper for [VkPipelineLayout](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPipelineLayout.html).
20#[derive(Debug, Clone, Copy)]
21pub struct VkPipelineLayout {
22    _handle: RawVkPipelineLayout,
23    _fn_table: *mut VkFunctionTable
24}
25
26impl VkRawType<VkPipelineLayout> for RawVkPipelineLayout {
27    fn vk_to_wrapped(src: &RawVkPipelineLayout) -> VkPipelineLayout {
28        VkPipelineLayout {
29            _handle: *src,
30            _fn_table: ptr::null_mut()
31        }
32    }
33}
34
35impl VkWrappedType<RawVkPipelineLayout> for VkPipelineLayout {
36    fn vk_to_raw(src: &VkPipelineLayout, dst: &mut RawVkPipelineLayout) {
37        *dst = src._handle
38    }
39}
40
41impl Default for VkPipelineLayout {
42    fn default() -> VkPipelineLayout {
43        VkPipelineLayout {
44            _handle: 0,
45            _fn_table: ptr::null_mut()
46        }
47    }
48}
49
50impl PartialEq for VkPipelineLayout {
51    fn eq(&self, other: &VkPipelineLayout) -> bool {
52        self._handle == other._handle
53    }
54}
55
56impl VkSetup for VkPipelineLayout {
57    fn vk_setup(&mut self, fn_table: *mut VkFunctionTable) {
58        self._fn_table = fn_table;
59    }
60}
61
62impl VkPipelineLayout {
63    
64    /// Returns the internal Vulkan handle for the object.
65    pub fn vk_handle(&self) -> u64 {
66        self._handle
67    }
68    
69    /// Indicates if the Vulkan internal handle for this object is 0.
70    pub fn is_null(&self) -> bool {
71        self._handle == 0
72    }
73    
74    /// Creates an object with a null Vulkan internal handle.
75    ///
76    /// Calling a method with a null handle will most likely result in a crash.
77    pub fn null() -> Self {
78        Self {
79            _handle: 0,
80            _fn_table: ptr::null_mut()
81        }
82    }
83    
84    /// Wrapper for [vkDestroyPipelineLayout](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkDestroyPipelineLayout.html).
85    pub fn destroy(&self) {
86        unsafe {
87            ((&*self._fn_table).vkDestroyPipelineLayout)((*self._fn_table).device, self._handle, ptr::null());
88        }
89    }
90}