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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
//! <https://registry.khronos.org/vulkan/specs/latest/man/html/VK_INTEL_performance_query.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_INTEL_performance_query";

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;

    handle_nondispatchable!(
        PerformanceConfigurationINTEL,
        PERFORMANCE_CONFIGURATION_INTEL,
        doc = "<https://registry.khronos.org/vulkan/specs/latest/man/html/VkPerformanceConfigurationINTEL.html>"
    );

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkQueryPoolCreateInfoINTEL.html>
    pub type QueryPoolCreateInfoINTEL<'a> = QueryPoolPerformanceQueryCreateInfoINTEL<'a>;

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPerformanceValueINTEL.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PerformanceValueINTEL<'a> {
        pub ty: PerformanceValueTypeINTEL,
        pub data: PerformanceValueDataINTEL<'a>,
        pub _marker: PhantomData<&'a ()>,
    }

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

    impl Default for PerformanceValueINTEL<'_> {
        fn default() -> Self {
            Self {
                ty: Default::default(),
                data: Default::default(),
                _marker: PhantomData,
            }
        }
    }

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

        #[inline]
        pub fn data(mut self, data: PerformanceValueDataINTEL<'a>) -> Self {
            self.data = data;
            self
        }
    }

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

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

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

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

    impl<'a> InitializePerformanceApiInfoINTEL<'a> {
        #[inline]
        pub fn user_data(mut self, user_data: *mut c_void) -> Self {
            self.p_user_data = user_data;
            self
        }
    }

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

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

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

    unsafe impl Extends<QueryPoolCreateInfo<'_>> for QueryPoolPerformanceQueryCreateInfoINTEL<'_> {}

    impl Default for QueryPoolPerformanceQueryCreateInfoINTEL<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null(),
                performance_counters_sampling: Default::default(),
                _marker: PhantomData,
            }
        }
    }

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

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

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

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

    impl Default for PerformanceMarkerInfoINTEL<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null(),
                marker: Default::default(),
                _marker: PhantomData,
            }
        }
    }

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

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

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

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

    impl Default for PerformanceStreamMarkerInfoINTEL<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null(),
                marker: Default::default(),
                _marker: PhantomData,
            }
        }
    }

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

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPerformanceOverrideInfoINTEL.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PerformanceOverrideInfoINTEL<'a> {
        pub s_type: StructureType,
        pub p_next: *const c_void,
        pub ty: PerformanceOverrideTypeINTEL,
        pub enable: Bool32,
        pub parameter: u64,
        pub _marker: PhantomData<&'a ()>,
    }

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

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

    impl Default for PerformanceOverrideInfoINTEL<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null(),
                ty: Default::default(),
                enable: Default::default(),
                parameter: Default::default(),
                _marker: PhantomData,
            }
        }
    }

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

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

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

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

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

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

    impl Default for PerformanceConfigurationAcquireInfoINTEL<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null(),
                ty: Default::default(),
                _marker: PhantomData,
            }
        }
    }

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

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPerformanceValueDataINTEL.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    pub union PerformanceValueDataINTEL<'a> {
        pub value32: u32,
        pub value64: u64,
        pub value_float: f32,
        pub value_bool: Bool32,
        pub value_string: *const c_char,
        pub _marker: PhantomData<&'a ()>,
    }

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

    impl Default for PerformanceValueDataINTEL<'_> {
        fn default() -> Self {
            unsafe { core::mem::zeroed() }
        }
    }

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

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

        pub const COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL: Self = Self(0);
    }

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

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

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

        pub const MANUAL_INTEL: Self = Self(0);
    }

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

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

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

        pub const NULL_HARDWARE_INTEL: Self = Self(0);
        pub const FLUSH_GPU_CACHES_INTEL: Self = Self(1);
    }

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

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

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

        pub const HW_COUNTERS_SUPPORTED_INTEL: Self = Self(0);
        pub const STREAM_MARKER_VALID_BITS_INTEL: Self = Self(1);
    }

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

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

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

        pub const UINT32_INTEL: Self = Self(0);
        pub const UINT64_INTEL: Self = Self(1);
        pub const FLOAT_INTEL: Self = Self(2);
        pub const BOOL_INTEL: Self = Self(3);
        pub const STRING_INTEL: Self = Self(4);
    }

    impl fmt::Debug for PerformanceValueTypeINTEL {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            let name = match *self {
                Self::UINT32_INTEL => Some("UINT32_INTEL"),
                Self::UINT64_INTEL => Some("UINT64_INTEL"),
                Self::FLOAT_INTEL => Some("FLOAT_INTEL"),
                Self::BOOL_INTEL => Some("BOOL_INTEL"),
                Self::STRING_INTEL => Some("STRING_INTEL"),
                _ => None,
            };
            if let Some(name) = name {
                f.write_str(name)
            } else {
                self.0.fmt(f)
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkInitializePerformanceApiINTEL.html>
    pub type PFN_vkInitializePerformanceApiINTEL = unsafe extern "system" fn(
        device: Device,
        p_initialize_info: *const InitializePerformanceApiInfoINTEL<'_>,
    ) -> vk::Result;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkUninitializePerformanceApiINTEL.html>
    pub type PFN_vkUninitializePerformanceApiINTEL = unsafe extern "system" fn(device: Device);
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceMarkerINTEL.html>
    pub type PFN_vkCmdSetPerformanceMarkerINTEL = unsafe extern "system" fn(
        command_buffer: CommandBuffer,
        p_marker_info: *const PerformanceMarkerInfoINTEL<'_>,
    ) -> vk::Result;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceStreamMarkerINTEL.html>
    pub type PFN_vkCmdSetPerformanceStreamMarkerINTEL = unsafe extern "system" fn(
        command_buffer: CommandBuffer,
        p_marker_info: *const PerformanceStreamMarkerInfoINTEL<'_>,
    )
        -> vk::Result;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceOverrideINTEL.html>
    pub type PFN_vkCmdSetPerformanceOverrideINTEL = unsafe extern "system" fn(
        command_buffer: CommandBuffer,
        p_override_info: *const PerformanceOverrideInfoINTEL<'_>,
    ) -> vk::Result;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquirePerformanceConfigurationINTEL.html>
    pub type PFN_vkAcquirePerformanceConfigurationINTEL = unsafe extern "system" fn(
        device: Device,
        p_acquire_info: *const PerformanceConfigurationAcquireInfoINTEL<'_>,
        p_configuration: *mut PerformanceConfigurationINTEL,
    )
        -> vk::Result;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleasePerformanceConfigurationINTEL.html>
    pub type PFN_vkReleasePerformanceConfigurationINTEL = unsafe extern "system" fn(
        device: Device,
        configuration: PerformanceConfigurationINTEL,
    )
        -> vk::Result;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSetPerformanceConfigurationINTEL.html>
    pub type PFN_vkQueueSetPerformanceConfigurationINTEL = unsafe extern "system" fn(
        queue: Queue,
        configuration: PerformanceConfigurationINTEL,
    )
        -> vk::Result;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPerformanceParameterINTEL.html>
    pub type PFN_vkGetPerformanceParameterINTEL = unsafe extern "system" fn(
        device: Device,
        parameter: PerformanceParameterTypeINTEL,
        p_value: *mut PerformanceValueINTEL<'_>,
    ) -> vk::Result;
}

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

    pub type VkPerformanceConfigurationINTEL = PerformanceConfigurationINTEL;
    pub type VkPerformanceValueINTEL = PerformanceValueINTEL<'static>;
    pub type VkInitializePerformanceApiInfoINTEL = InitializePerformanceApiInfoINTEL<'static>;
    pub type VkQueryPoolPerformanceQueryCreateInfoINTEL =
        QueryPoolPerformanceQueryCreateInfoINTEL<'static>;
    pub type VkPerformanceMarkerInfoINTEL = PerformanceMarkerInfoINTEL<'static>;
    pub type VkPerformanceStreamMarkerInfoINTEL = PerformanceStreamMarkerInfoINTEL<'static>;
    pub type VkPerformanceOverrideInfoINTEL = PerformanceOverrideInfoINTEL<'static>;
    pub type VkPerformanceConfigurationAcquireInfoINTEL =
        PerformanceConfigurationAcquireInfoINTEL<'static>;
    pub type VkPerformanceValueDataINTEL = PerformanceValueDataINTEL<'static>;
    pub type VkPerformanceConfigurationTypeINTEL = PerformanceConfigurationTypeINTEL;
    pub type VkQueryPoolSamplingModeINTEL = QueryPoolSamplingModeINTEL;
    pub type VkPerformanceOverrideTypeINTEL = PerformanceOverrideTypeINTEL;
    pub type VkPerformanceParameterTypeINTEL = PerformanceParameterTypeINTEL;
    pub type VkPerformanceValueTypeINTEL = PerformanceValueTypeINTEL;
    pub type VkQueryPoolCreateInfoINTEL = QueryPoolCreateInfoINTEL<'static>;
    impl PerformanceValueINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPerformanceValueINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl InitializePerformanceApiInfoINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkInitializePerformanceApiInfoINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl QueryPoolPerformanceQueryCreateInfoINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkQueryPoolPerformanceQueryCreateInfoINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PerformanceMarkerInfoINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPerformanceMarkerInfoINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PerformanceStreamMarkerInfoINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPerformanceStreamMarkerInfoINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PerformanceOverrideInfoINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPerformanceOverrideInfoINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PerformanceConfigurationAcquireInfoINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPerformanceConfigurationAcquireInfoINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PerformanceValueDataINTEL<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPerformanceValueDataINTEL {
            unsafe { core::mem::transmute(self) }
        }
    }
}

pub struct DeviceFn {
    initialize_performance_api: PFN_vkInitializePerformanceApiINTEL,
    uninitialize_performance_api: PFN_vkUninitializePerformanceApiINTEL,
    cmd_set_performance_marker: PFN_vkCmdSetPerformanceMarkerINTEL,
    cmd_set_performance_stream_marker: PFN_vkCmdSetPerformanceStreamMarkerINTEL,
    cmd_set_performance_override: PFN_vkCmdSetPerformanceOverrideINTEL,
    acquire_performance_configuration: PFN_vkAcquirePerformanceConfigurationINTEL,
    release_performance_configuration: PFN_vkReleasePerformanceConfigurationINTEL,
    queue_set_performance_configuration: PFN_vkQueueSetPerformanceConfigurationINTEL,
    get_performance_parameter: PFN_vkGetPerformanceParameterINTEL,
}

impl LoadDeviceFn for DeviceFn {
    unsafe fn load_with(
        load: impl Fn(&CStr) -> Option<PFN_vkVoidFunction>,
    ) -> core::result::Result<Self, MissingEntryPointError> {
        unsafe {
            Ok(Self {
                initialize_performance_api: transmute(
                    load(c"vkInitializePerformanceApiINTEL").ok_or(MissingEntryPointError)?,
                ),
                uninitialize_performance_api: transmute(
                    load(c"vkUninitializePerformanceApiINTEL").ok_or(MissingEntryPointError)?,
                ),
                cmd_set_performance_marker: transmute(
                    load(c"vkCmdSetPerformanceMarkerINTEL").ok_or(MissingEntryPointError)?,
                ),
                cmd_set_performance_stream_marker: transmute(
                    load(c"vkCmdSetPerformanceStreamMarkerINTEL").ok_or(MissingEntryPointError)?,
                ),
                cmd_set_performance_override: transmute(
                    load(c"vkCmdSetPerformanceOverrideINTEL").ok_or(MissingEntryPointError)?,
                ),
                acquire_performance_configuration: transmute(
                    load(c"vkAcquirePerformanceConfigurationINTEL")
                        .ok_or(MissingEntryPointError)?,
                ),
                release_performance_configuration: transmute(
                    load(c"vkReleasePerformanceConfigurationINTEL")
                        .ok_or(MissingEntryPointError)?,
                ),
                queue_set_performance_configuration: transmute(
                    load(c"vkQueueSetPerformanceConfigurationINTEL")
                        .ok_or(MissingEntryPointError)?,
                ),
                get_performance_parameter: transmute(
                    load(c"vkGetPerformanceParameterINTEL").ok_or(MissingEntryPointError)?,
                ),
            })
        }
    }
}

impl DeviceFn {
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkInitializePerformanceApiINTEL.html>
    #[inline]
    pub unsafe fn initialize_performance_api(
        &self,
        device: Device,
        initialize_info: &InitializePerformanceApiInfoINTEL<'_>,
    ) -> crate::Result<()> {
        unsafe {
            let result = (self.initialize_performance_api)(device, initialize_info);

            match result {
                VkResult::SUCCESS => Ok(()),
                err => Err(err),
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkUninitializePerformanceApiINTEL.html>
    #[inline]
    pub unsafe fn uninitialize_performance_api(&self, device: Device) {
        unsafe { (self.uninitialize_performance_api)(device) }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceMarkerINTEL.html>
    #[inline]
    pub unsafe fn cmd_set_performance_marker(
        &self,
        command_buffer: CommandBuffer,
        marker_info: &PerformanceMarkerInfoINTEL<'_>,
    ) -> crate::Result<()> {
        unsafe {
            let result = (self.cmd_set_performance_marker)(command_buffer, marker_info);

            match result {
                VkResult::SUCCESS => Ok(()),
                err => Err(err),
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceStreamMarkerINTEL.html>
    #[inline]
    pub unsafe fn cmd_set_performance_stream_marker(
        &self,
        command_buffer: CommandBuffer,
        marker_info: &PerformanceStreamMarkerInfoINTEL<'_>,
    ) -> crate::Result<()> {
        unsafe {
            let result = (self.cmd_set_performance_stream_marker)(command_buffer, marker_info);

            match result {
                VkResult::SUCCESS => Ok(()),
                err => Err(err),
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetPerformanceOverrideINTEL.html>
    #[inline]
    pub unsafe fn cmd_set_performance_override(
        &self,
        command_buffer: CommandBuffer,
        override_info: &PerformanceOverrideInfoINTEL<'_>,
    ) -> crate::Result<()> {
        unsafe {
            let result = (self.cmd_set_performance_override)(command_buffer, override_info);

            match result {
                VkResult::SUCCESS => Ok(()),
                err => Err(err),
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkAcquirePerformanceConfigurationINTEL.html>
    #[inline]
    pub unsafe fn acquire_performance_configuration(
        &self,
        device: Device,
        acquire_info: &PerformanceConfigurationAcquireInfoINTEL<'_>,
    ) -> crate::Result<PerformanceConfigurationINTEL> {
        unsafe {
            let mut configuration = core::mem::MaybeUninit::uninit();
            let result = (self.acquire_performance_configuration)(
                device,
                acquire_info,
                configuration.as_mut_ptr(),
            );

            match result {
                VkResult::SUCCESS => Ok(configuration.assume_init()),
                err => Err(err),
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkReleasePerformanceConfigurationINTEL.html>
    #[inline]
    pub unsafe fn release_performance_configuration(
        &self,
        device: Device,
        configuration: PerformanceConfigurationINTEL,
    ) -> crate::Result<()> {
        unsafe {
            let result = (self.release_performance_configuration)(device, configuration);

            match result {
                VkResult::SUCCESS => Ok(()),
                err => Err(err),
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkQueueSetPerformanceConfigurationINTEL.html>
    #[inline]
    pub unsafe fn queue_set_performance_configuration(
        &self,
        queue: Queue,
        configuration: PerformanceConfigurationINTEL,
    ) -> crate::Result<()> {
        unsafe {
            let result = (self.queue_set_performance_configuration)(queue, configuration);

            match result {
                VkResult::SUCCESS => Ok(()),
                err => Err(err),
            }
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkGetPerformanceParameterINTEL.html>
    #[inline]
    pub unsafe fn get_performance_parameter(
        &self,
        device: Device,
        parameter: PerformanceParameterTypeINTEL,
    ) -> crate::Result<PerformanceValueINTEL<'_>> {
        unsafe {
            let mut value = core::mem::MaybeUninit::uninit();
            let result = (self.get_performance_parameter)(device, parameter, value.as_mut_ptr());

            match result {
                VkResult::SUCCESS => Ok(value.assume_init()),
                err => Err(err),
            }
        }
    }
}