kazan 0.3.9+1.4.359

Vulkan bindings for Rust
Documentation
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
//! <https://registry.khronos.org/vulkan/specs/latest/man/html/VK_KHR_maintenance7.html>
#![allow(unused_imports)]
use crate::{vk::Result as VkResult, vk::*, *};
use core::ffi::{CStr, c_char, c_int, c_void};
use core::mem::transmute;
use core::ptr;

pub const EXTENSION_NAME: &CStr = c"VK_KHR_maintenance7";

pub(super) mod defs {
    #![allow(non_camel_case_types, unused_imports)]
    use crate::{vk::*, *};
    use core::ffi::{CStr, c_char, c_int, c_void};
    use core::fmt;
    use core::marker::PhantomData;
    use core::ptr;

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceMaintenance7FeaturesKHR.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceMaintenance7FeaturesKHR<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub maintenance7: Bool32,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for PhysicalDeviceMaintenance7FeaturesKHR<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("PhysicalDeviceMaintenance7FeaturesKHR")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field("maintenance7", &self.maintenance7)
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for PhysicalDeviceMaintenance7FeaturesKHR<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::PHYSICAL_DEVICE_MAINTENANCE_7_FEATURES_KHR;
    }

    unsafe impl Extends<PhysicalDeviceFeatures2<'_>> for PhysicalDeviceMaintenance7FeaturesKHR<'_> {}
    unsafe impl Extends<DeviceCreateInfo<'_>> for PhysicalDeviceMaintenance7FeaturesKHR<'_> {}

    impl Default for PhysicalDeviceMaintenance7FeaturesKHR<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null_mut(),
                maintenance7: Default::default(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> PhysicalDeviceMaintenance7FeaturesKHR<'a> {
        #[inline]
        pub fn maintenance7(mut self, maintenance7: bool) -> Self {
            self.maintenance7 = maintenance7.into();
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceMaintenance7PropertiesKHR.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceMaintenance7PropertiesKHR<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub robust_fragment_shading_rate_attachment_access: Bool32,
        pub separate_depth_stencil_attachment_access: Bool32,
        pub max_descriptor_set_total_uniform_buffers_dynamic: u32,
        pub max_descriptor_set_total_storage_buffers_dynamic: u32,
        pub max_descriptor_set_total_buffers_dynamic: u32,
        pub max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic: u32,
        pub max_descriptor_set_update_after_bind_total_storage_buffers_dynamic: u32,
        pub max_descriptor_set_update_after_bind_total_buffers_dynamic: u32,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for PhysicalDeviceMaintenance7PropertiesKHR<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("PhysicalDeviceMaintenance7PropertiesKHR")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field(
                    "robust_fragment_shading_rate_attachment_access",
                    &self.robust_fragment_shading_rate_attachment_access,
                )
                .field(
                    "separate_depth_stencil_attachment_access",
                    &self.separate_depth_stencil_attachment_access,
                )
                .field(
                    "max_descriptor_set_total_uniform_buffers_dynamic",
                    &self.max_descriptor_set_total_uniform_buffers_dynamic,
                )
                .field(
                    "max_descriptor_set_total_storage_buffers_dynamic",
                    &self.max_descriptor_set_total_storage_buffers_dynamic,
                )
                .field(
                    "max_descriptor_set_total_buffers_dynamic",
                    &self.max_descriptor_set_total_buffers_dynamic,
                )
                .field(
                    "max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic",
                    &self.max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic,
                )
                .field(
                    "max_descriptor_set_update_after_bind_total_storage_buffers_dynamic",
                    &self.max_descriptor_set_update_after_bind_total_storage_buffers_dynamic,
                )
                .field(
                    "max_descriptor_set_update_after_bind_total_buffers_dynamic",
                    &self.max_descriptor_set_update_after_bind_total_buffers_dynamic,
                )
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for PhysicalDeviceMaintenance7PropertiesKHR<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::PHYSICAL_DEVICE_MAINTENANCE_7_PROPERTIES_KHR;
    }

    unsafe impl Extends<PhysicalDeviceProperties2<'_>> for PhysicalDeviceMaintenance7PropertiesKHR<'_> {}

    impl Default for PhysicalDeviceMaintenance7PropertiesKHR<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null_mut(),
                robust_fragment_shading_rate_attachment_access: Default::default(),
                separate_depth_stencil_attachment_access: Default::default(),
                max_descriptor_set_total_uniform_buffers_dynamic: Default::default(),
                max_descriptor_set_total_storage_buffers_dynamic: Default::default(),
                max_descriptor_set_total_buffers_dynamic: Default::default(),
                max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic:
                    Default::default(),
                max_descriptor_set_update_after_bind_total_storage_buffers_dynamic:
                    Default::default(),
                max_descriptor_set_update_after_bind_total_buffers_dynamic: Default::default(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> PhysicalDeviceMaintenance7PropertiesKHR<'a> {
        #[inline]
        pub fn robust_fragment_shading_rate_attachment_access(
            mut self,
            robust_fragment_shading_rate_attachment_access: bool,
        ) -> Self {
            self.robust_fragment_shading_rate_attachment_access =
                robust_fragment_shading_rate_attachment_access.into();
            self
        }

        #[inline]
        pub fn separate_depth_stencil_attachment_access(
            mut self,
            separate_depth_stencil_attachment_access: bool,
        ) -> Self {
            self.separate_depth_stencil_attachment_access =
                separate_depth_stencil_attachment_access.into();
            self
        }

        #[inline]
        pub fn max_descriptor_set_total_uniform_buffers_dynamic(
            mut self,
            max_descriptor_set_total_uniform_buffers_dynamic: u32,
        ) -> Self {
            self.max_descriptor_set_total_uniform_buffers_dynamic =
                max_descriptor_set_total_uniform_buffers_dynamic;
            self
        }

        #[inline]
        pub fn max_descriptor_set_total_storage_buffers_dynamic(
            mut self,
            max_descriptor_set_total_storage_buffers_dynamic: u32,
        ) -> Self {
            self.max_descriptor_set_total_storage_buffers_dynamic =
                max_descriptor_set_total_storage_buffers_dynamic;
            self
        }

        #[inline]
        pub fn max_descriptor_set_total_buffers_dynamic(
            mut self,
            max_descriptor_set_total_buffers_dynamic: u32,
        ) -> Self {
            self.max_descriptor_set_total_buffers_dynamic =
                max_descriptor_set_total_buffers_dynamic;
            self
        }

        #[inline]
        pub fn max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic(
            mut self,
            max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic: u32,
        ) -> Self {
            self.max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic =
                max_descriptor_set_update_after_bind_total_uniform_buffers_dynamic;
            self
        }

        #[inline]
        pub fn max_descriptor_set_update_after_bind_total_storage_buffers_dynamic(
            mut self,
            max_descriptor_set_update_after_bind_total_storage_buffers_dynamic: u32,
        ) -> Self {
            self.max_descriptor_set_update_after_bind_total_storage_buffers_dynamic =
                max_descriptor_set_update_after_bind_total_storage_buffers_dynamic;
            self
        }

        #[inline]
        pub fn max_descriptor_set_update_after_bind_total_buffers_dynamic(
            mut self,
            max_descriptor_set_update_after_bind_total_buffers_dynamic: u32,
        ) -> Self {
            self.max_descriptor_set_update_after_bind_total_buffers_dynamic =
                max_descriptor_set_update_after_bind_total_buffers_dynamic;
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceLayeredApiPropertiesListKHR.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceLayeredApiPropertiesListKHR<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub layered_api_count: u32,
        pub p_layered_apis: *mut PhysicalDeviceLayeredApiPropertiesKHR<'a>,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for PhysicalDeviceLayeredApiPropertiesListKHR<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("PhysicalDeviceLayeredApiPropertiesListKHR")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field("layered_api_count", &self.layered_api_count)
                .field("p_layered_apis", &self.p_layered_apis)
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for PhysicalDeviceLayeredApiPropertiesListKHR<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_LIST_KHR;
    }

    unsafe impl Extends<PhysicalDeviceProperties2<'_>>
        for PhysicalDeviceLayeredApiPropertiesListKHR<'_>
    {
    }

    impl Default for PhysicalDeviceLayeredApiPropertiesListKHR<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null_mut(),
                layered_api_count: Default::default(),
                p_layered_apis: ptr::null_mut(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> PhysicalDeviceLayeredApiPropertiesListKHR<'a> {
        #[inline]
        pub fn layered_apis(
            mut self,
            layered_apis: &'a mut [PhysicalDeviceLayeredApiPropertiesKHR<'_>],
        ) -> Self {
            self.layered_api_count = layered_apis.len().try_into().unwrap();
            self.p_layered_apis = layered_apis.as_mut_ptr() as _;
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceLayeredApiPropertiesKHR.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceLayeredApiPropertiesKHR<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub vendor_id: u32,
        pub device_id: u32,
        pub layered_api: PhysicalDeviceLayeredApiKHR,
        pub device_name: ArrayCStr<{ MAX_PHYSICAL_DEVICE_NAME_SIZE as usize }>,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for PhysicalDeviceLayeredApiPropertiesKHR<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("PhysicalDeviceLayeredApiPropertiesKHR")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field("vendor_id", &self.vendor_id)
                .field("device_id", &self.device_id)
                .field("layered_api", &self.layered_api)
                .field("device_name", &self.device_name)
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for PhysicalDeviceLayeredApiPropertiesKHR<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_KHR;
    }

    impl Default for PhysicalDeviceLayeredApiPropertiesKHR<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null_mut(),
                vendor_id: Default::default(),
                device_id: Default::default(),
                layered_api: Default::default(),
                device_name: Default::default(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> PhysicalDeviceLayeredApiPropertiesKHR<'a> {
        #[inline]
        pub fn vendor_id(mut self, vendor_id: u32) -> Self {
            self.vendor_id = vendor_id;
            self
        }

        #[inline]
        pub fn device_id(mut self, device_id: u32) -> Self {
            self.device_id = device_id;
            self
        }

        #[inline]
        pub fn layered_api(mut self, layered_api: PhysicalDeviceLayeredApiKHR) -> Self {
            self.layered_api = layered_api;
            self
        }

        #[inline]
        pub fn device_name(
            mut self,
            device_name: ArrayCStr<{ MAX_PHYSICAL_DEVICE_NAME_SIZE as usize }>,
        ) -> Self {
            self.device_name = device_name;
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceLayeredApiVulkanPropertiesKHR.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceLayeredApiVulkanPropertiesKHR<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub properties: PhysicalDeviceProperties2<'a>,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for PhysicalDeviceLayeredApiVulkanPropertiesKHR<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("PhysicalDeviceLayeredApiVulkanPropertiesKHR")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field("properties", &self.properties)
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for PhysicalDeviceLayeredApiVulkanPropertiesKHR<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::PHYSICAL_DEVICE_LAYERED_API_VULKAN_PROPERTIES_KHR;
    }

    unsafe impl Extends<PhysicalDeviceLayeredApiPropertiesKHR<'_>>
        for PhysicalDeviceLayeredApiVulkanPropertiesKHR<'_>
    {
    }

    impl Default for PhysicalDeviceLayeredApiVulkanPropertiesKHR<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null_mut(),
                properties: Default::default(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> PhysicalDeviceLayeredApiVulkanPropertiesKHR<'a> {
        #[inline]
        pub fn properties(mut self, properties: PhysicalDeviceProperties2<'a>) -> Self {
            self.properties = properties;
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceLayeredApiKHR.html>
    #[repr(transparent)]
    #[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct PhysicalDeviceLayeredApiKHR(i32);

    impl PhysicalDeviceLayeredApiKHR {
        #[inline]
        pub const fn from_raw(x: i32) -> Self {
            Self(x)
        }
        #[inline]
        pub const fn as_raw(self) -> i32 {
            self.0
        }

        pub const VULKAN_KHR: Self = Self(0);
        pub const D3D12_KHR: Self = Self(1);
        pub const METAL_KHR: Self = Self(2);
        pub const OPENGL_KHR: Self = Self(3);
        pub const OPENGLES_KHR: Self = Self(4);
    }

    impl fmt::Debug for PhysicalDeviceLayeredApiKHR {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            let name = match *self {
                Self::VULKAN_KHR => Some("VULKAN_KHR"),
                Self::D3D12_KHR => Some("D3D12_KHR"),
                Self::METAL_KHR => Some("METAL_KHR"),
                Self::OPENGL_KHR => Some("OPENGL_KHR"),
                Self::OPENGLES_KHR => Some("OPENGLES_KHR"),
                _ => None,
            };
            if let Some(name) = name {
                f.write_str(name)
            } else {
                self.0.fmt(f)
            }
        }
    }
}

#[cfg(feature = "ffi")]
pub(super) mod ffi {
    #![allow(non_camel_case_types)]
    use super::defs::*;

    pub type VkPhysicalDeviceMaintenance7FeaturesKHR =
        PhysicalDeviceMaintenance7FeaturesKHR<'static>;
    pub type VkPhysicalDeviceMaintenance7PropertiesKHR =
        PhysicalDeviceMaintenance7PropertiesKHR<'static>;
    pub type VkPhysicalDeviceLayeredApiPropertiesListKHR =
        PhysicalDeviceLayeredApiPropertiesListKHR<'static>;
    pub type VkPhysicalDeviceLayeredApiPropertiesKHR =
        PhysicalDeviceLayeredApiPropertiesKHR<'static>;
    pub type VkPhysicalDeviceLayeredApiVulkanPropertiesKHR =
        PhysicalDeviceLayeredApiVulkanPropertiesKHR<'static>;
    pub type VkPhysicalDeviceLayeredApiKHR = PhysicalDeviceLayeredApiKHR;
    impl PhysicalDeviceMaintenance7FeaturesKHR<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPhysicalDeviceMaintenance7FeaturesKHR {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PhysicalDeviceMaintenance7PropertiesKHR<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPhysicalDeviceMaintenance7PropertiesKHR {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PhysicalDeviceLayeredApiPropertiesListKHR<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPhysicalDeviceLayeredApiPropertiesListKHR {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PhysicalDeviceLayeredApiPropertiesKHR<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPhysicalDeviceLayeredApiPropertiesKHR {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PhysicalDeviceLayeredApiVulkanPropertiesKHR<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(
            &self,
        ) -> &VkPhysicalDeviceLayeredApiVulkanPropertiesKHR {
            unsafe { core::mem::transmute(self) }
        }
    }
}