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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
use std::os::raw::c_char;
use std::ops::Deref;
use std::ptr;
use std::cmp;
use std::mem;
use utils::c_bindings::*;
use utils::vk_convert::*;
use utils::vk_null::*;
use utils::vk_ptr::*;
use utils::vk_traits::*;
use vk::vk_instance_function_table::*;
use vk::vk_instance::*;
use vk::vk_device::*;
use vk::vk_structure_type::*;
use vk::vk_semaphore::*;
use vk::vk_sparse_buffer_memory_bind_info::*;
use vk::vk_sparse_image_opaque_memory_bind_info::*;
use vk::vk_sparse_image_memory_bind_info::*;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RawVkBindSparseInfo {
pub s_type: RawVkStructureType,
pub next: *const c_void,
pub wait_semaphore_count: u32,
pub wait_semaphores: *mut RawVkSemaphore,
pub buffer_bind_count: u32,
pub buffer_binds: *mut RawVkSparseBufferMemoryBindInfo,
pub image_opaque_bind_count: u32,
pub image_opaque_binds: *mut RawVkSparseImageOpaqueMemoryBindInfo,
pub image_bind_count: u32,
pub image_binds: *mut RawVkSparseImageMemoryBindInfo,
pub signal_semaphore_count: u32,
pub signal_semaphores: *mut RawVkSemaphore,
}
#[derive(Debug, Clone)]
pub struct VkBindSparseInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p>
where
'b: 'a,
'd: 'c,
'e: 'c,
'f: 'e,
'h: 'g,
'i: 'g,
'j: 'i,
'l: 'k,
'm: 'k,
'n: 'm,
'p: 'o,
{
pub wait_semaphores: &'a [&'b VkSemaphore],
pub buffer_binds: &'c [VkSparseBufferMemoryBindInfo<'d, 'e, 'f>],
pub image_opaque_binds: &'g [VkSparseImageOpaqueMemoryBindInfo<'h, 'i, 'j>],
pub image_binds: &'k [VkSparseImageMemoryBindInfo<'l, 'm, 'n>],
pub signal_semaphores: &'o [&'p VkSemaphore],
}
impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p> VkWrappedType<RawVkBindSparseInfo> for VkBindSparseInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p>
where
'b: 'a,
'd: 'c,
'e: 'c,
'f: 'e,
'h: 'g,
'i: 'g,
'j: 'i,
'l: 'k,
'm: 'k,
'n: 'm,
'p: 'o,
{
fn vk_to_raw(src: &VkBindSparseInfo, dst: &mut RawVkBindSparseInfo) {
dst.s_type = vk_to_raw_value(&VkStructureType::BindSparseInfo);
dst.next = ptr::null();
dst.wait_semaphore_count = src.wait_semaphores.len() as u32;
dst.wait_semaphores = new_ptr_vk_array_from_ref(src.wait_semaphores);
dst.buffer_bind_count = src.buffer_binds.len() as u32;
dst.buffer_binds = new_ptr_vk_array(src.buffer_binds);
dst.image_opaque_bind_count = src.image_opaque_binds.len() as u32;
dst.image_opaque_binds = new_ptr_vk_array(src.image_opaque_binds);
dst.image_bind_count = src.image_binds.len() as u32;
dst.image_binds = new_ptr_vk_array(src.image_binds);
dst.signal_semaphore_count = src.signal_semaphores.len() as u32;
dst.signal_semaphores = new_ptr_vk_array_from_ref(src.signal_semaphores);
}
}
impl Default for VkBindSparseInfo<'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static> {
fn default() -> VkBindSparseInfo<'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static, 'static> {
VkBindSparseInfo {
wait_semaphores: &[],
buffer_binds: &[],
image_opaque_binds: &[],
image_binds: &[],
signal_semaphores: &[],
}
}
}
impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p> VkSetup for VkBindSparseInfo<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p>
where
'b: 'a,
'd: 'c,
'e: 'c,
'f: 'e,
'h: 'g,
'i: 'g,
'j: 'i,
'l: 'k,
'm: 'k,
'n: 'm,
'p: 'o,
{
fn vk_setup(&mut self, fn_table: *mut VkInstanceFunctionTable, instance: RawVkInstance, device: RawVkDevice) {
}
}
impl VkFree for RawVkBindSparseInfo {
fn vk_free(&mut self) {
free_ptr(self.wait_semaphores);
free_vk_ptr_array(self.buffer_bind_count as usize, self.buffer_binds);
free_vk_ptr_array(self.image_opaque_bind_count as usize, self.image_opaque_binds);
free_vk_ptr_array(self.image_bind_count as usize, self.image_binds);
free_ptr(self.signal_semaphores);
}
}