erupt/generated/extensions/
khr_external_memory_win32.rs1#[doc(alias = "VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION")]
4pub const KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION: u32 = 1;
5#[doc(alias = "VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME")]
7pub const KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME: *const std::os::raw::c_char = crate::cstr!(
8 "VK_KHR_external_memory_win32"
9);
10pub const FN_GET_MEMORY_WIN32_HANDLE_KHR: *const std::os::raw::c_char = crate::cstr!(
12 "vkGetMemoryWin32HandleKHR"
13);
14pub const FN_GET_MEMORY_WIN32_HANDLE_PROPERTIES_KHR: *const std::os::raw::c_char = crate::cstr!(
16 "vkGetMemoryWin32HandlePropertiesKHR"
17);
18impl crate::vk1_0::StructureType {
20 pub const IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR: Self = Self(1000073000);
21 pub const EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR: Self = Self(1000073001);
22 pub const MEMORY_WIN32_HANDLE_PROPERTIES_KHR: Self = Self(1000073002);
23 pub const MEMORY_GET_WIN32_HANDLE_INFO_KHR: Self = Self(1000073003);
24}
25#[allow(non_camel_case_types)]
27pub type PFN_vkGetMemoryWin32HandleKHR = unsafe extern "system" fn(
28 device: crate::vk1_0::Device,
29 p_get_win32_handle_info: *const crate::extensions::khr_external_memory_win32::MemoryGetWin32HandleInfoKHR,
30 p_handle: *mut *mut std::ffi::c_void,
31) -> crate::vk1_0::Result;
32#[allow(non_camel_case_types)]
34pub type PFN_vkGetMemoryWin32HandlePropertiesKHR = unsafe extern "system" fn(
35 device: crate::vk1_0::Device,
36 handle_type: crate::vk1_1::ExternalMemoryHandleTypeFlagBits,
37 handle: *mut std::ffi::c_void,
38 p_memory_win32_handle_properties: *mut crate::extensions::khr_external_memory_win32::MemoryWin32HandlePropertiesKHR,
39) -> crate::vk1_0::Result;
40impl<'a> crate::ExtendableFrom<'a, ImportMemoryWin32HandleInfoKHR>
41for crate::vk1_0::MemoryAllocateInfoBuilder<'a> {}
42impl<'a> crate::ExtendableFrom<'a, ImportMemoryWin32HandleInfoKHRBuilder<'_>>
43for crate::vk1_0::MemoryAllocateInfoBuilder<'a> {}
44impl<'a> crate::ExtendableFrom<'a, ExportMemoryWin32HandleInfoKHR>
45for crate::vk1_0::MemoryAllocateInfoBuilder<'a> {}
46impl<'a> crate::ExtendableFrom<'a, ExportMemoryWin32HandleInfoKHRBuilder<'_>>
47for crate::vk1_0::MemoryAllocateInfoBuilder<'a> {}
48#[doc(alias = "VkImportMemoryWin32HandleInfoKHR")]
50#[derive(Copy, Clone)]
51#[repr(C)]
52pub struct ImportMemoryWin32HandleInfoKHR {
53 pub s_type: crate::vk1_0::StructureType,
54 pub p_next: *const std::ffi::c_void,
55 pub handle_type: crate::vk1_1::ExternalMemoryHandleTypeFlagBits,
56 pub handle: *mut std::ffi::c_void,
57 pub name: *const u16,
58}
59impl ImportMemoryWin32HandleInfoKHR {
60 pub const STRUCTURE_TYPE: crate::vk1_0::StructureType = crate::vk1_0::StructureType::IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR;
61}
62impl Default for ImportMemoryWin32HandleInfoKHR {
63 fn default() -> Self {
64 Self {
65 s_type: Self::STRUCTURE_TYPE,
66 p_next: std::ptr::null(),
67 handle_type: Default::default(),
68 handle: std::ptr::null_mut(),
69 name: std::ptr::null(),
70 }
71 }
72}
73impl std::fmt::Debug for ImportMemoryWin32HandleInfoKHR {
74 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
75 f.debug_struct("ImportMemoryWin32HandleInfoKHR")
76 .field("s_type", &self.s_type)
77 .field("p_next", &self.p_next)
78 .field("handle_type", &self.handle_type)
79 .field("handle", &self.handle)
80 .field("name", &self.name)
81 .finish()
82 }
83}
84impl ImportMemoryWin32HandleInfoKHR {
85 #[inline]
86 pub fn into_builder<'a>(self) -> ImportMemoryWin32HandleInfoKHRBuilder<'a> {
87 ImportMemoryWin32HandleInfoKHRBuilder(self, std::marker::PhantomData)
88 }
89}
90#[derive(Copy, Clone)]
91#[repr(transparent)]
93pub struct ImportMemoryWin32HandleInfoKHRBuilder<'a>(
94 ImportMemoryWin32HandleInfoKHR,
95 std::marker::PhantomData<&'a ()>,
96);
97impl<'a> ImportMemoryWin32HandleInfoKHRBuilder<'a> {
98 #[inline]
99 pub fn new() -> ImportMemoryWin32HandleInfoKHRBuilder<'a> {
100 ImportMemoryWin32HandleInfoKHRBuilder(
101 Default::default(),
102 std::marker::PhantomData,
103 )
104 }
105 #[inline]
106 #[must_use]
107 pub fn handle_type(
108 mut self,
109 handle_type: crate::vk1_1::ExternalMemoryHandleTypeFlagBits,
110 ) -> Self {
111 self.0.handle_type = handle_type as _;
112 self
113 }
114 #[inline]
115 #[must_use]
116 pub fn handle(mut self, handle: *mut std::ffi::c_void) -> Self {
117 self.0.handle = handle;
118 self
119 }
120 #[inline]
121 #[must_use]
122 pub fn name(mut self, name: &'a u16) -> Self {
123 self.0.name = name as _;
124 self
125 }
126 #[inline]
127 pub fn build_dangling(self) -> ImportMemoryWin32HandleInfoKHR {
130 self.0
131 }
132}
133impl<'a> std::default::Default for ImportMemoryWin32HandleInfoKHRBuilder<'a> {
134 fn default() -> ImportMemoryWin32HandleInfoKHRBuilder<'a> {
135 Self::new()
136 }
137}
138impl<'a> std::fmt::Debug for ImportMemoryWin32HandleInfoKHRBuilder<'a> {
139 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
140 std::fmt::Debug::fmt(&self.0, f)
141 }
142}
143impl<'a> std::ops::Deref for ImportMemoryWin32HandleInfoKHRBuilder<'a> {
144 type Target = ImportMemoryWin32HandleInfoKHR;
145 fn deref(&self) -> &Self::Target {
146 &self.0
147 }
148}
149impl<'a> std::ops::DerefMut for ImportMemoryWin32HandleInfoKHRBuilder<'a> {
150 fn deref_mut(&mut self) -> &mut Self::Target {
151 &mut self.0
152 }
153}
154#[doc(alias = "VkExportMemoryWin32HandleInfoKHR")]
156#[derive(Copy, Clone)]
157#[repr(C)]
158pub struct ExportMemoryWin32HandleInfoKHR {
159 pub s_type: crate::vk1_0::StructureType,
160 pub p_next: *const std::ffi::c_void,
161 pub p_attributes: *const std::ffi::c_void,
162 pub dw_access: u32,
163 pub name: *const u16,
164}
165impl ExportMemoryWin32HandleInfoKHR {
166 pub const STRUCTURE_TYPE: crate::vk1_0::StructureType = crate::vk1_0::StructureType::EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR;
167}
168impl Default for ExportMemoryWin32HandleInfoKHR {
169 fn default() -> Self {
170 Self {
171 s_type: Self::STRUCTURE_TYPE,
172 p_next: std::ptr::null(),
173 p_attributes: std::ptr::null(),
174 dw_access: Default::default(),
175 name: std::ptr::null(),
176 }
177 }
178}
179impl std::fmt::Debug for ExportMemoryWin32HandleInfoKHR {
180 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
181 f.debug_struct("ExportMemoryWin32HandleInfoKHR")
182 .field("s_type", &self.s_type)
183 .field("p_next", &self.p_next)
184 .field("p_attributes", &self.p_attributes)
185 .field("dw_access", &self.dw_access)
186 .field("name", &self.name)
187 .finish()
188 }
189}
190impl ExportMemoryWin32HandleInfoKHR {
191 #[inline]
192 pub fn into_builder<'a>(self) -> ExportMemoryWin32HandleInfoKHRBuilder<'a> {
193 ExportMemoryWin32HandleInfoKHRBuilder(self, std::marker::PhantomData)
194 }
195}
196#[derive(Copy, Clone)]
197#[repr(transparent)]
199pub struct ExportMemoryWin32HandleInfoKHRBuilder<'a>(
200 ExportMemoryWin32HandleInfoKHR,
201 std::marker::PhantomData<&'a ()>,
202);
203impl<'a> ExportMemoryWin32HandleInfoKHRBuilder<'a> {
204 #[inline]
205 pub fn new() -> ExportMemoryWin32HandleInfoKHRBuilder<'a> {
206 ExportMemoryWin32HandleInfoKHRBuilder(
207 Default::default(),
208 std::marker::PhantomData,
209 )
210 }
211 #[inline]
212 #[must_use]
213 pub fn attributes(mut self, attributes: *const std::ffi::c_void) -> Self {
214 self.0.p_attributes = attributes;
215 self
216 }
217 #[inline]
218 #[must_use]
219 pub fn dw_access(mut self, dw_access: u32) -> Self {
220 self.0.dw_access = dw_access as _;
221 self
222 }
223 #[inline]
224 #[must_use]
225 pub fn name(mut self, name: &'a u16) -> Self {
226 self.0.name = name as _;
227 self
228 }
229 #[inline]
230 pub fn build_dangling(self) -> ExportMemoryWin32HandleInfoKHR {
233 self.0
234 }
235}
236impl<'a> std::default::Default for ExportMemoryWin32HandleInfoKHRBuilder<'a> {
237 fn default() -> ExportMemoryWin32HandleInfoKHRBuilder<'a> {
238 Self::new()
239 }
240}
241impl<'a> std::fmt::Debug for ExportMemoryWin32HandleInfoKHRBuilder<'a> {
242 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
243 std::fmt::Debug::fmt(&self.0, f)
244 }
245}
246impl<'a> std::ops::Deref for ExportMemoryWin32HandleInfoKHRBuilder<'a> {
247 type Target = ExportMemoryWin32HandleInfoKHR;
248 fn deref(&self) -> &Self::Target {
249 &self.0
250 }
251}
252impl<'a> std::ops::DerefMut for ExportMemoryWin32HandleInfoKHRBuilder<'a> {
253 fn deref_mut(&mut self) -> &mut Self::Target {
254 &mut self.0
255 }
256}
257#[doc(alias = "VkMemoryWin32HandlePropertiesKHR")]
259#[derive(Copy, Clone)]
260#[repr(C)]
261pub struct MemoryWin32HandlePropertiesKHR {
262 pub s_type: crate::vk1_0::StructureType,
263 pub p_next: *mut std::ffi::c_void,
264 pub memory_type_bits: u32,
265}
266impl MemoryWin32HandlePropertiesKHR {
267 pub const STRUCTURE_TYPE: crate::vk1_0::StructureType = crate::vk1_0::StructureType::MEMORY_WIN32_HANDLE_PROPERTIES_KHR;
268}
269impl Default for MemoryWin32HandlePropertiesKHR {
270 fn default() -> Self {
271 Self {
272 s_type: Self::STRUCTURE_TYPE,
273 p_next: std::ptr::null_mut(),
274 memory_type_bits: Default::default(),
275 }
276 }
277}
278impl std::fmt::Debug for MemoryWin32HandlePropertiesKHR {
279 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
280 f.debug_struct("MemoryWin32HandlePropertiesKHR")
281 .field("s_type", &self.s_type)
282 .field("p_next", &self.p_next)
283 .field("memory_type_bits", &self.memory_type_bits)
284 .finish()
285 }
286}
287impl MemoryWin32HandlePropertiesKHR {
288 #[inline]
289 pub fn into_builder<'a>(self) -> MemoryWin32HandlePropertiesKHRBuilder<'a> {
290 MemoryWin32HandlePropertiesKHRBuilder(self, std::marker::PhantomData)
291 }
292}
293#[derive(Copy, Clone)]
294#[repr(transparent)]
296pub struct MemoryWin32HandlePropertiesKHRBuilder<'a>(
297 MemoryWin32HandlePropertiesKHR,
298 std::marker::PhantomData<&'a ()>,
299);
300impl<'a> MemoryWin32HandlePropertiesKHRBuilder<'a> {
301 #[inline]
302 pub fn new() -> MemoryWin32HandlePropertiesKHRBuilder<'a> {
303 MemoryWin32HandlePropertiesKHRBuilder(
304 Default::default(),
305 std::marker::PhantomData,
306 )
307 }
308 #[inline]
309 #[must_use]
310 pub fn memory_type_bits(mut self, memory_type_bits: u32) -> Self {
311 self.0.memory_type_bits = memory_type_bits as _;
312 self
313 }
314 #[inline]
315 pub fn build_dangling(self) -> MemoryWin32HandlePropertiesKHR {
318 self.0
319 }
320}
321impl<'a> std::default::Default for MemoryWin32HandlePropertiesKHRBuilder<'a> {
322 fn default() -> MemoryWin32HandlePropertiesKHRBuilder<'a> {
323 Self::new()
324 }
325}
326impl<'a> std::fmt::Debug for MemoryWin32HandlePropertiesKHRBuilder<'a> {
327 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
328 std::fmt::Debug::fmt(&self.0, f)
329 }
330}
331impl<'a> std::ops::Deref for MemoryWin32HandlePropertiesKHRBuilder<'a> {
332 type Target = MemoryWin32HandlePropertiesKHR;
333 fn deref(&self) -> &Self::Target {
334 &self.0
335 }
336}
337impl<'a> std::ops::DerefMut for MemoryWin32HandlePropertiesKHRBuilder<'a> {
338 fn deref_mut(&mut self) -> &mut Self::Target {
339 &mut self.0
340 }
341}
342#[doc(alias = "VkMemoryGetWin32HandleInfoKHR")]
344#[derive(Copy, Clone)]
345#[repr(C)]
346pub struct MemoryGetWin32HandleInfoKHR {
347 pub s_type: crate::vk1_0::StructureType,
348 pub p_next: *const std::ffi::c_void,
349 pub memory: crate::vk1_0::DeviceMemory,
350 pub handle_type: crate::vk1_1::ExternalMemoryHandleTypeFlagBits,
351}
352impl MemoryGetWin32HandleInfoKHR {
353 pub const STRUCTURE_TYPE: crate::vk1_0::StructureType = crate::vk1_0::StructureType::MEMORY_GET_WIN32_HANDLE_INFO_KHR;
354}
355impl Default for MemoryGetWin32HandleInfoKHR {
356 fn default() -> Self {
357 Self {
358 s_type: Self::STRUCTURE_TYPE,
359 p_next: std::ptr::null(),
360 memory: Default::default(),
361 handle_type: Default::default(),
362 }
363 }
364}
365impl std::fmt::Debug for MemoryGetWin32HandleInfoKHR {
366 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
367 f.debug_struct("MemoryGetWin32HandleInfoKHR")
368 .field("s_type", &self.s_type)
369 .field("p_next", &self.p_next)
370 .field("memory", &self.memory)
371 .field("handle_type", &self.handle_type)
372 .finish()
373 }
374}
375impl MemoryGetWin32HandleInfoKHR {
376 #[inline]
377 pub fn into_builder<'a>(self) -> MemoryGetWin32HandleInfoKHRBuilder<'a> {
378 MemoryGetWin32HandleInfoKHRBuilder(self, std::marker::PhantomData)
379 }
380}
381#[derive(Copy, Clone)]
382#[repr(transparent)]
384pub struct MemoryGetWin32HandleInfoKHRBuilder<'a>(
385 MemoryGetWin32HandleInfoKHR,
386 std::marker::PhantomData<&'a ()>,
387);
388impl<'a> MemoryGetWin32HandleInfoKHRBuilder<'a> {
389 #[inline]
390 pub fn new() -> MemoryGetWin32HandleInfoKHRBuilder<'a> {
391 MemoryGetWin32HandleInfoKHRBuilder(Default::default(), std::marker::PhantomData)
392 }
393 #[inline]
394 #[must_use]
395 pub fn memory(mut self, memory: crate::vk1_0::DeviceMemory) -> Self {
396 self.0.memory = memory as _;
397 self
398 }
399 #[inline]
400 #[must_use]
401 pub fn handle_type(
402 mut self,
403 handle_type: crate::vk1_1::ExternalMemoryHandleTypeFlagBits,
404 ) -> Self {
405 self.0.handle_type = handle_type as _;
406 self
407 }
408 #[inline]
409 pub fn build_dangling(self) -> MemoryGetWin32HandleInfoKHR {
412 self.0
413 }
414}
415impl<'a> std::default::Default for MemoryGetWin32HandleInfoKHRBuilder<'a> {
416 fn default() -> MemoryGetWin32HandleInfoKHRBuilder<'a> {
417 Self::new()
418 }
419}
420impl<'a> std::fmt::Debug for MemoryGetWin32HandleInfoKHRBuilder<'a> {
421 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
422 std::fmt::Debug::fmt(&self.0, f)
423 }
424}
425impl<'a> std::ops::Deref for MemoryGetWin32HandleInfoKHRBuilder<'a> {
426 type Target = MemoryGetWin32HandleInfoKHR;
427 fn deref(&self) -> &Self::Target {
428 &self.0
429 }
430}
431impl<'a> std::ops::DerefMut for MemoryGetWin32HandleInfoKHRBuilder<'a> {
432 fn deref_mut(&mut self) -> &mut Self::Target {
433 &mut self.0
434 }
435}
436impl crate::DeviceLoader {
438 #[inline]
439 #[track_caller]
440 #[doc(alias = "vkGetMemoryWin32HandleKHR")]
442 pub unsafe fn get_memory_win32_handle_khr(
443 &self,
444 get_win32_handle_info: &crate::extensions::khr_external_memory_win32::MemoryGetWin32HandleInfoKHR,
445 ) -> crate::utils::VulkanResult<*mut std::ffi::c_void> {
446 let _function = self
447 .get_memory_win32_handle_khr
448 .expect(crate::NOT_LOADED_MESSAGE);
449 let mut handle = std::ptr::null_mut();
450 let _return = _function(self.handle, get_win32_handle_info as _, &mut handle);
451 crate::utils::VulkanResult::new(_return, handle)
452 }
453 #[inline]
454 #[track_caller]
455 #[doc(alias = "vkGetMemoryWin32HandlePropertiesKHR")]
457 pub unsafe fn get_memory_win32_handle_properties_khr(
458 &self,
459 handle_type: crate::vk1_1::ExternalMemoryHandleTypeFlagBits,
460 handle: *mut std::ffi::c_void,
461 memory_win32_handle_properties: &mut crate::extensions::khr_external_memory_win32::MemoryWin32HandlePropertiesKHR,
462 ) -> crate::utils::VulkanResult<()> {
463 let _function = self
464 .get_memory_win32_handle_properties_khr
465 .expect(crate::NOT_LOADED_MESSAGE);
466 let _return = _function(
467 self.handle,
468 handle_type as _,
469 handle,
470 memory_win32_handle_properties as _,
471 );
472 crate::utils::VulkanResult::new(_return, ())
473 }
474}