aboutsummaryrefslogtreecommitdiffhomepage
path: root/spirv_tools-sys/src/spirv_tools.rs
blob: fe9640b8f3dd2a7b0991e10f82ae8c87435d4977 (plain)
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
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
/* automatically generated by rust-bindgen 0.54.1 */

pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __uint32_t = ::std::os::raw::c_uint;
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_result_t {
    SPV_SUCCESS = 0,
    SPV_UNSUPPORTED = 1,
    SPV_END_OF_STREAM = 2,
    SPV_WARNING = 3,
    SPV_FAILED_MATCH = 4,
    SPV_REQUESTED_TERMINATION = 5,
    SPV_ERROR_INTERNAL = -1,
    SPV_ERROR_OUT_OF_MEMORY = -2,
    SPV_ERROR_INVALID_POINTER = -3,
    SPV_ERROR_INVALID_BINARY = -4,
    SPV_ERROR_INVALID_TEXT = -5,
    SPV_ERROR_INVALID_TABLE = -6,
    SPV_ERROR_INVALID_VALUE = -7,
    SPV_ERROR_INVALID_DIAGNOSTIC = -8,
    SPV_ERROR_INVALID_LOOKUP = -9,
    SPV_ERROR_INVALID_ID = -10,
    SPV_ERROR_INVALID_CFG = -11,
    SPV_ERROR_INVALID_LAYOUT = -12,
    SPV_ERROR_INVALID_CAPABILITY = -13,
    SPV_ERROR_INVALID_DATA = -14,
    SPV_ERROR_MISSING_EXTENSION = -15,
    SPV_ERROR_WRONG_VERSION = -16,
    _spv_result_t = 2147483647,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_message_level_t {
    SPV_MSG_FATAL = 0,
    SPV_MSG_INTERNAL_ERROR = 1,
    SPV_MSG_ERROR = 2,
    SPV_MSG_WARNING = 3,
    SPV_MSG_INFO = 4,
    SPV_MSG_DEBUG = 5,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_endianness_t {
    SPV_ENDIANNESS_LITTLE = 0,
    SPV_ENDIANNESS_BIG = 1,
    _spv_endianness_t = 2147483647,
}
impl spv_operand_type_t {
    pub const SPV_OPERAND_TYPE_FIRST_OPTIONAL_TYPE: spv_operand_type_t =
        spv_operand_type_t::SPV_OPERAND_TYPE_OPTIONAL_ID;
}
impl spv_operand_type_t {
    pub const SPV_OPERAND_TYPE_FIRST_VARIABLE_TYPE: spv_operand_type_t =
        spv_operand_type_t::SPV_OPERAND_TYPE_VARIABLE_ID;
}
impl spv_operand_type_t {
    pub const SPV_OPERAND_TYPE_LAST_VARIABLE_TYPE: spv_operand_type_t =
        spv_operand_type_t::SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER;
}
impl spv_operand_type_t {
    pub const SPV_OPERAND_TYPE_LAST_OPTIONAL_TYPE: spv_operand_type_t =
        spv_operand_type_t::SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_operand_type_t {
    SPV_OPERAND_TYPE_NONE = 0,
    SPV_OPERAND_TYPE_ID = 1,
    SPV_OPERAND_TYPE_TYPE_ID = 2,
    SPV_OPERAND_TYPE_RESULT_ID = 3,
    SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID = 4,
    SPV_OPERAND_TYPE_SCOPE_ID = 5,
    SPV_OPERAND_TYPE_LITERAL_INTEGER = 6,
    SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER = 7,
    SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER = 8,
    SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER = 9,
    SPV_OPERAND_TYPE_LITERAL_STRING = 10,
    SPV_OPERAND_TYPE_SOURCE_LANGUAGE = 11,
    SPV_OPERAND_TYPE_EXECUTION_MODEL = 12,
    SPV_OPERAND_TYPE_ADDRESSING_MODEL = 13,
    SPV_OPERAND_TYPE_MEMORY_MODEL = 14,
    SPV_OPERAND_TYPE_EXECUTION_MODE = 15,
    SPV_OPERAND_TYPE_STORAGE_CLASS = 16,
    SPV_OPERAND_TYPE_DIMENSIONALITY = 17,
    SPV_OPERAND_TYPE_SAMPLER_ADDRESSING_MODE = 18,
    SPV_OPERAND_TYPE_SAMPLER_FILTER_MODE = 19,
    SPV_OPERAND_TYPE_SAMPLER_IMAGE_FORMAT = 20,
    SPV_OPERAND_TYPE_IMAGE_CHANNEL_ORDER = 21,
    SPV_OPERAND_TYPE_IMAGE_CHANNEL_DATA_TYPE = 22,
    SPV_OPERAND_TYPE_FP_ROUNDING_MODE = 23,
    SPV_OPERAND_TYPE_LINKAGE_TYPE = 24,
    SPV_OPERAND_TYPE_ACCESS_QUALIFIER = 25,
    SPV_OPERAND_TYPE_FUNCTION_PARAMETER_ATTRIBUTE = 26,
    SPV_OPERAND_TYPE_DECORATION = 27,
    SPV_OPERAND_TYPE_BUILT_IN = 28,
    SPV_OPERAND_TYPE_GROUP_OPERATION = 29,
    SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS = 30,
    SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO = 31,
    SPV_OPERAND_TYPE_CAPABILITY = 32,
    SPV_OPERAND_TYPE_RAY_FLAGS = 33,
    SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION = 34,
    SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE = 35,
    SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE = 36,
    SPV_OPERAND_TYPE_IMAGE = 37,
    SPV_OPERAND_TYPE_FP_FAST_MATH_MODE = 38,
    SPV_OPERAND_TYPE_SELECTION_CONTROL = 39,
    SPV_OPERAND_TYPE_LOOP_CONTROL = 40,
    SPV_OPERAND_TYPE_FUNCTION_CONTROL = 41,
    SPV_OPERAND_TYPE_MEMORY_ACCESS = 42,
    SPV_OPERAND_TYPE_OPTIONAL_ID = 43,
    SPV_OPERAND_TYPE_OPTIONAL_IMAGE = 44,
    SPV_OPERAND_TYPE_OPTIONAL_MEMORY_ACCESS = 45,
    SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER = 46,
    SPV_OPERAND_TYPE_OPTIONAL_LITERAL_NUMBER = 47,
    SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER = 48,
    SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING = 49,
    SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER = 50,
    SPV_OPERAND_TYPE_OPTIONAL_CIV = 51,
    SPV_OPERAND_TYPE_VARIABLE_ID = 52,
    SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER = 53,
    SPV_OPERAND_TYPE_VARIABLE_LITERAL_INTEGER_ID = 54,
    SPV_OPERAND_TYPE_VARIABLE_ID_LITERAL_INTEGER = 55,
    SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS = 56,
    SPV_OPERAND_TYPE_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING = 57,
    SPV_OPERAND_TYPE_DEBUG_COMPOSITE_TYPE = 58,
    SPV_OPERAND_TYPE_DEBUG_TYPE_QUALIFIER = 59,
    SPV_OPERAND_TYPE_DEBUG_OPERATION = 60,
    SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS = 61,
    SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_BASE_TYPE_ATTRIBUTE_ENCODING = 62,
    SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_COMPOSITE_TYPE = 63,
    SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_TYPE_QUALIFIER = 64,
    SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION = 65,
    SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY = 66,
    SPV_OPERAND_TYPE_NUM_OPERAND_TYPES = 67,
    _spv_operand_type_t = 2147483647,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_ext_inst_type_t {
    SPV_EXT_INST_TYPE_NONE = 0,
    SPV_EXT_INST_TYPE_GLSL_STD_450 = 1,
    SPV_EXT_INST_TYPE_OPENCL_STD = 2,
    SPV_EXT_INST_TYPE_SPV_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER = 3,
    SPV_EXT_INST_TYPE_SPV_AMD_SHADER_TRINARY_MINMAX = 4,
    SPV_EXT_INST_TYPE_SPV_AMD_GCN_SHADER = 5,
    SPV_EXT_INST_TYPE_SPV_AMD_SHADER_BALLOT = 6,
    SPV_EXT_INST_TYPE_DEBUGINFO = 7,
    SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 = 8,
    SPV_EXT_INST_TYPE_NONSEMANTIC_UNKNOWN = 9,
    _spv_ext_inst_type_t = 2147483647,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_number_kind_t {
    SPV_NUMBER_NONE = 0,
    SPV_NUMBER_UNSIGNED_INT = 1,
    SPV_NUMBER_SIGNED_INT = 2,
    SPV_NUMBER_FLOATING = 3,
}
impl spv_text_to_binary_options_t {
    pub const SPV_TEXT_TO_BINARY_OPTION_NONE: spv_text_to_binary_options_t =
        spv_text_to_binary_options_t(1);
}
impl spv_text_to_binary_options_t {
    pub const SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS: spv_text_to_binary_options_t =
        spv_text_to_binary_options_t(2);
}
impl spv_text_to_binary_options_t {
    pub const _spv_text_to_binary_options_t: spv_text_to_binary_options_t =
        spv_text_to_binary_options_t(2147483647);
}
impl ::std::ops::BitOr<spv_text_to_binary_options_t> for spv_text_to_binary_options_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        spv_text_to_binary_options_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for spv_text_to_binary_options_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: spv_text_to_binary_options_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<spv_text_to_binary_options_t> for spv_text_to_binary_options_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        spv_text_to_binary_options_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for spv_text_to_binary_options_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: spv_text_to_binary_options_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct spv_text_to_binary_options_t(pub u32);
impl spv_binary_to_text_options_t {
    pub const SPV_BINARY_TO_TEXT_OPTION_NONE: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(1);
}
impl spv_binary_to_text_options_t {
    pub const SPV_BINARY_TO_TEXT_OPTION_PRINT: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(2);
}
impl spv_binary_to_text_options_t {
    pub const SPV_BINARY_TO_TEXT_OPTION_COLOR: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(4);
}
impl spv_binary_to_text_options_t {
    pub const SPV_BINARY_TO_TEXT_OPTION_INDENT: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(8);
}
impl spv_binary_to_text_options_t {
    pub const SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(16);
}
impl spv_binary_to_text_options_t {
    pub const SPV_BINARY_TO_TEXT_OPTION_NO_HEADER: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(32);
}
impl spv_binary_to_text_options_t {
    pub const SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(64);
}
impl spv_binary_to_text_options_t {
    pub const _spv_binary_to_text_options_t: spv_binary_to_text_options_t =
        spv_binary_to_text_options_t(2147483647);
}
impl ::std::ops::BitOr<spv_binary_to_text_options_t> for spv_binary_to_text_options_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        spv_binary_to_text_options_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for spv_binary_to_text_options_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: spv_binary_to_text_options_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<spv_binary_to_text_options_t> for spv_binary_to_text_options_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        spv_binary_to_text_options_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for spv_binary_to_text_options_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: spv_binary_to_text_options_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct spv_binary_to_text_options_t(pub u32);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_parsed_operand_t {
    pub offset: u16,
    pub num_words: u16,
    pub type_: spv_operand_type_t,
    pub number_kind: spv_number_kind_t,
    pub number_bit_width: u32,
}
#[test]
fn bindgen_test_layout_spv_parsed_operand_t() {
    assert_eq!(
        ::std::mem::size_of::<spv_parsed_operand_t>(),
        16usize,
        concat!("Size of: ", stringify!(spv_parsed_operand_t))
    );
    assert_eq!(
        ::std::mem::align_of::<spv_parsed_operand_t>(),
        4usize,
        concat!("Alignment of ", stringify!(spv_parsed_operand_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_parsed_operand_t>())).offset as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_operand_t),
            "::",
            stringify!(offset)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_parsed_operand_t>())).num_words as *const _ as usize },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_operand_t),
            "::",
            stringify!(num_words)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_parsed_operand_t>())).type_ as *const _ as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_operand_t),
            "::",
            stringify!(type_)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_operand_t>())).number_kind as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_operand_t),
            "::",
            stringify!(number_kind)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_operand_t>())).number_bit_width as *const _ as usize
        },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_operand_t),
            "::",
            stringify!(number_bit_width)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_parsed_instruction_t {
    pub words: *const u32,
    pub num_words: u16,
    pub opcode: u16,
    pub ext_inst_type: spv_ext_inst_type_t,
    pub type_id: u32,
    pub result_id: u32,
    pub operands: *const spv_parsed_operand_t,
    pub num_operands: u16,
}
#[test]
fn bindgen_test_layout_spv_parsed_instruction_t() {
    assert_eq!(
        ::std::mem::size_of::<spv_parsed_instruction_t>(),
        40usize,
        concat!("Size of: ", stringify!(spv_parsed_instruction_t))
    );
    assert_eq!(
        ::std::mem::align_of::<spv_parsed_instruction_t>(),
        8usize,
        concat!("Alignment of ", stringify!(spv_parsed_instruction_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_parsed_instruction_t>())).words as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(words)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_instruction_t>())).num_words as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(num_words)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_parsed_instruction_t>())).opcode as *const _ as usize },
        10usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(opcode)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_instruction_t>())).ext_inst_type as *const _ as usize
        },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(ext_inst_type)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_instruction_t>())).type_id as *const _ as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(type_id)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_instruction_t>())).result_id as *const _ as usize
        },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(result_id)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_instruction_t>())).operands as *const _ as usize
        },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(operands)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<spv_parsed_instruction_t>())).num_operands as *const _ as usize
        },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_parsed_instruction_t),
            "::",
            stringify!(num_operands)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_const_binary_t {
    pub code: *const u32,
    pub wordCount: usize,
}
#[test]
fn bindgen_test_layout_spv_const_binary_t() {
    assert_eq!(
        ::std::mem::size_of::<spv_const_binary_t>(),
        16usize,
        concat!("Size of: ", stringify!(spv_const_binary_t))
    );
    assert_eq!(
        ::std::mem::align_of::<spv_const_binary_t>(),
        8usize,
        concat!("Alignment of ", stringify!(spv_const_binary_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_const_binary_t>())).code as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_const_binary_t),
            "::",
            stringify!(code)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_const_binary_t>())).wordCount as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_const_binary_t),
            "::",
            stringify!(wordCount)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_binary_t {
    pub code: *mut u32,
    pub wordCount: usize,
}
#[test]
fn bindgen_test_layout_spv_binary_t() {
    assert_eq!(
        ::std::mem::size_of::<spv_binary_t>(),
        16usize,
        concat!("Size of: ", stringify!(spv_binary_t))
    );
    assert_eq!(
        ::std::mem::align_of::<spv_binary_t>(),
        8usize,
        concat!("Alignment of ", stringify!(spv_binary_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_binary_t>())).code as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_binary_t),
            "::",
            stringify!(code)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_binary_t>())).wordCount as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_binary_t),
            "::",
            stringify!(wordCount)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_text_t {
    pub str_: *const ::std::os::raw::c_char,
    pub length: usize,
}
#[test]
fn bindgen_test_layout_spv_text_t() {
    assert_eq!(
        ::std::mem::size_of::<spv_text_t>(),
        16usize,
        concat!("Size of: ", stringify!(spv_text_t))
    );
    assert_eq!(
        ::std::mem::align_of::<spv_text_t>(),
        8usize,
        concat!("Alignment of ", stringify!(spv_text_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_text_t>())).str_ as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_text_t),
            "::",
            stringify!(str_)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_text_t>())).length as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_text_t),
            "::",
            stringify!(length)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_position_t {
    pub line: usize,
    pub column: usize,
    pub index: usize,
}
#[test]
fn bindgen_test_layout_spv_position_t() {
    assert_eq!(
        ::std::mem::size_of::<spv_position_t>(),
        24usize,
        concat!("Size of: ", stringify!(spv_position_t))
    );
    assert_eq!(
        ::std::mem::align_of::<spv_position_t>(),
        8usize,
        concat!("Alignment of ", stringify!(spv_position_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_position_t>())).line as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_position_t),
            "::",
            stringify!(line)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_position_t>())).column as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_position_t),
            "::",
            stringify!(column)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_position_t>())).index as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_position_t),
            "::",
            stringify!(index)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_diagnostic_t {
    pub position: spv_position_t,
    pub error: *mut ::std::os::raw::c_char,
    pub isTextSource: bool,
}
#[test]
fn bindgen_test_layout_spv_diagnostic_t() {
    assert_eq!(
        ::std::mem::size_of::<spv_diagnostic_t>(),
        40usize,
        concat!("Size of: ", stringify!(spv_diagnostic_t))
    );
    assert_eq!(
        ::std::mem::align_of::<spv_diagnostic_t>(),
        8usize,
        concat!("Alignment of ", stringify!(spv_diagnostic_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_diagnostic_t>())).position as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_diagnostic_t),
            "::",
            stringify!(position)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_diagnostic_t>())).error as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_diagnostic_t),
            "::",
            stringify!(error)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<spv_diagnostic_t>())).isTextSource as *const _ as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(spv_diagnostic_t),
            "::",
            stringify!(isTextSource)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_context_t {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_validator_options_t {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_optimizer_options_t {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_reducer_options_t {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct spv_fuzzer_options_t {
    _unused: [u8; 0],
}
pub type spv_const_binary = *mut spv_const_binary_t;
pub type spv_binary = *mut spv_binary_t;
pub type spv_text = *mut spv_text_t;
pub type spv_position = *mut spv_position_t;
pub type spv_diagnostic = *mut spv_diagnostic_t;
pub type spv_const_context = *const spv_context_t;
pub type spv_context = *mut spv_context_t;
pub type spv_validator_options = *mut spv_validator_options_t;
pub type spv_const_validator_options = *const spv_validator_options_t;
pub type spv_optimizer_options = *mut spv_optimizer_options_t;
pub type spv_const_optimizer_options = *const spv_optimizer_options_t;
pub type spv_reducer_options = *mut spv_reducer_options_t;
pub type spv_const_reducer_options = *const spv_reducer_options_t;
pub type spv_fuzzer_options = *mut spv_fuzzer_options_t;
pub type spv_const_fuzzer_options = *const spv_fuzzer_options_t;
extern "C" {
    pub fn spvSoftwareVersionString() -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn spvSoftwareVersionDetailsString() -> *const ::std::os::raw::c_char;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_target_env {
    SPV_ENV_UNIVERSAL_1_0 = 0,
    SPV_ENV_VULKAN_1_0 = 1,
    SPV_ENV_UNIVERSAL_1_1 = 2,
    SPV_ENV_OPENCL_2_1 = 3,
    SPV_ENV_OPENCL_2_2 = 4,
    SPV_ENV_OPENGL_4_0 = 5,
    SPV_ENV_OPENGL_4_1 = 6,
    SPV_ENV_OPENGL_4_2 = 7,
    SPV_ENV_OPENGL_4_3 = 8,
    SPV_ENV_OPENGL_4_5 = 9,
    SPV_ENV_UNIVERSAL_1_2 = 10,
    SPV_ENV_OPENCL_1_2 = 11,
    SPV_ENV_OPENCL_EMBEDDED_1_2 = 12,
    SPV_ENV_OPENCL_2_0 = 13,
    SPV_ENV_OPENCL_EMBEDDED_2_0 = 14,
    SPV_ENV_OPENCL_EMBEDDED_2_1 = 15,
    SPV_ENV_OPENCL_EMBEDDED_2_2 = 16,
    SPV_ENV_UNIVERSAL_1_3 = 17,
    SPV_ENV_VULKAN_1_1 = 18,
    SPV_ENV_WEBGPU_0 = 19,
    SPV_ENV_UNIVERSAL_1_4 = 20,
    SPV_ENV_VULKAN_1_1_SPIRV_1_4 = 21,
    SPV_ENV_UNIVERSAL_1_5 = 22,
    SPV_ENV_VULKAN_1_2 = 23,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum spv_validator_limit {
    spv_validator_limit_max_struct_members = 0,
    spv_validator_limit_max_struct_depth = 1,
    spv_validator_limit_max_local_variables = 2,
    spv_validator_limit_max_global_variables = 3,
    spv_validator_limit_max_switch_branches = 4,
    spv_validator_limit_max_function_args = 5,
    spv_validator_limit_max_control_flow_nesting_depth = 6,
    spv_validator_limit_max_access_chain_indexes = 7,
    spv_validator_limit_max_id_bound = 8,
}
extern "C" {
    pub fn spvTargetEnvDescription(env: spv_target_env) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn spvParseTargetEnv(s: *const ::std::os::raw::c_char, env: *mut spv_target_env) -> bool;
}
extern "C" {
    pub fn spvParseVulkanEnv(vulkan_ver: u32, spirv_ver: u32, env: *mut spv_target_env) -> bool;
}
extern "C" {
    pub fn spvContextCreate(env: spv_target_env) -> spv_context;
}
extern "C" {
    pub fn spvContextDestroy(context: spv_context);
}
extern "C" {
    pub fn spvValidatorOptionsCreate() -> spv_validator_options;
}
extern "C" {
    pub fn spvValidatorOptionsDestroy(options: spv_validator_options);
}
extern "C" {
    pub fn spvValidatorOptionsSetUniversalLimit(
        options: spv_validator_options,
        limit_type: spv_validator_limit,
        limit: u32,
    );
}
extern "C" {
    pub fn spvValidatorOptionsSetRelaxStoreStruct(options: spv_validator_options, val: bool);
}
extern "C" {
    pub fn spvValidatorOptionsSetRelaxLogicalPointer(options: spv_validator_options, val: bool);
}
extern "C" {
    pub fn spvValidatorOptionsSetBeforeHlslLegalization(options: spv_validator_options, val: bool);
}
extern "C" {
    pub fn spvValidatorOptionsSetRelaxBlockLayout(options: spv_validator_options, val: bool);
}
extern "C" {
    pub fn spvValidatorOptionsSetUniformBufferStandardLayout(
        options: spv_validator_options,
        val: bool,
    );
}
extern "C" {
    pub fn spvValidatorOptionsSetScalarBlockLayout(options: spv_validator_options, val: bool);
}
extern "C" {
    pub fn spvValidatorOptionsSetSkipBlockLayout(options: spv_validator_options, val: bool);
}
extern "C" {
    pub fn spvOptimizerOptionsCreate() -> spv_optimizer_options;
}
extern "C" {
    pub fn spvOptimizerOptionsDestroy(options: spv_optimizer_options);
}
extern "C" {
    pub fn spvOptimizerOptionsSetRunValidator(options: spv_optimizer_options, val: bool);
}
extern "C" {
    pub fn spvOptimizerOptionsSetValidatorOptions(
        options: spv_optimizer_options,
        val: spv_validator_options,
    );
}
extern "C" {
    pub fn spvOptimizerOptionsSetMaxIdBound(options: spv_optimizer_options, val: u32);
}
extern "C" {
    pub fn spvOptimizerOptionsSetPreserveBindings(options: spv_optimizer_options, val: bool);
}
extern "C" {
    pub fn spvOptimizerOptionsSetPreserveSpecConstants(options: spv_optimizer_options, val: bool);
}
extern "C" {
    pub fn spvReducerOptionsCreate() -> spv_reducer_options;
}
extern "C" {
    pub fn spvReducerOptionsDestroy(options: spv_reducer_options);
}
extern "C" {
    pub fn spvReducerOptionsSetStepLimit(options: spv_reducer_options, step_limit: u32);
}
extern "C" {
    pub fn spvReducerOptionsSetFailOnValidationError(
        options: spv_reducer_options,
        fail_on_validation_error: bool,
    );
}
extern "C" {
    pub fn spvFuzzerOptionsCreate() -> spv_fuzzer_options;
}
extern "C" {
    pub fn spvFuzzerOptionsDestroy(options: spv_fuzzer_options);
}
extern "C" {
    pub fn spvFuzzerOptionsEnableReplayValidation(options: spv_fuzzer_options);
}
extern "C" {
    pub fn spvFuzzerOptionsSetRandomSeed(options: spv_fuzzer_options, seed: u32);
}
extern "C" {
    pub fn spvFuzzerOptionsSetShrinkerStepLimit(
        options: spv_fuzzer_options,
        shrinker_step_limit: u32,
    );
}
extern "C" {
    pub fn spvFuzzerOptionsEnableFuzzerPassValidation(options: spv_fuzzer_options);
}
extern "C" {
    pub fn spvTextToBinary(
        context: spv_const_context,
        text: *const ::std::os::raw::c_char,
        length: usize,
        binary: *mut spv_binary,
        diagnostic: *mut spv_diagnostic,
    ) -> spv_result_t;
}
extern "C" {
    pub fn spvTextToBinaryWithOptions(
        context: spv_const_context,
        text: *const ::std::os::raw::c_char,
        length: usize,
        options: u32,
        binary: *mut spv_binary,
        diagnostic: *mut spv_diagnostic,
    ) -> spv_result_t;
}
extern "C" {
    pub fn spvTextDestroy(text: spv_text);
}
extern "C" {
    pub fn spvBinaryToText(
        context: spv_const_context,
        binary: *const u32,
        word_count: usize,
        options: u32,
        text: *mut spv_text,
        diagnostic: *mut spv_diagnostic,
    ) -> spv_result_t;
}
extern "C" {
    pub fn spvBinaryDestroy(binary: spv_binary);
}
extern "C" {
    pub fn spvValidate(
        context: spv_const_context,
        binary: spv_const_binary,
        diagnostic: *mut spv_diagnostic,
    ) -> spv_result_t;
}
extern "C" {
    pub fn spvValidateWithOptions(
        context: spv_const_context,
        options: spv_const_validator_options,
        binary: spv_const_binary,
        diagnostic: *mut spv_diagnostic,
    ) -> spv_result_t;
}
extern "C" {
    pub fn spvValidateBinary(
        context: spv_const_context,
        words: *const u32,
        num_words: usize,
        diagnostic: *mut spv_diagnostic,
    ) -> spv_result_t;
}
extern "C" {
    pub fn spvDiagnosticCreate(
        position: spv_position,
        message: *const ::std::os::raw::c_char,
    ) -> spv_diagnostic;
}
extern "C" {
    pub fn spvDiagnosticDestroy(diagnostic: spv_diagnostic);
}
extern "C" {
    pub fn spvDiagnosticPrint(diagnostic: spv_diagnostic) -> spv_result_t;
}
extern "C" {
    pub fn spvOpcodeString(opcode: u32) -> *const ::std::os::raw::c_char;
}
pub type spv_parsed_header_fn_t = ::std::option::Option<
    unsafe extern "C" fn(
        user_data: *mut ::std::os::raw::c_void,
        endian: spv_endianness_t,
        magic: u32,
        version: u32,
        generator: u32,
        id_bound: u32,
        reserved: u32,
    ) -> spv_result_t,
>;
pub type spv_parsed_instruction_fn_t = ::std::option::Option<
    unsafe extern "C" fn(
        user_data: *mut ::std::os::raw::c_void,
        parsed_instruction: *const spv_parsed_instruction_t,
    ) -> spv_result_t,
>;
extern "C" {
    pub fn spvBinaryParse(
        context: spv_const_context,
        user_data: *mut ::std::os::raw::c_void,
        words: *const u32,
        num_words: usize,
        parse_header: spv_parsed_header_fn_t,
        parse_instruction: spv_parsed_instruction_fn_t,
        diagnostic: *mut spv_diagnostic,
    ) -> spv_result_t;
}