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
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
// "asi_vulkan" crate - Licensed under the MIT LICENSE
//  * Copyright (c) 2017-2018  Jeron A. Lau <jeron.lau@plopgrizzly.com>

use std::fmt;
use libc::c_void;

pub type VkDeviceSize = u64;
pub type VkFlags = u32;
pub type VkBool32 = u32;
pub type VkSampleMask = u32;

// Non-Dispatchable Handles
pub type VkSurfaceKHR = u64;
pub type VkImage = u64;
pub type VkDeviceMemory = u64;
pub type VkDescriptorSet = u64;
pub type VkDescriptorPool = u64;
pub type VkSampler = u64;
pub type VkPipeline = u64;
pub type VkDescriptorSetLayout = u64;
pub type VkPipelineLayout = u64;
pub type VkImageView = u64;
pub type VkBuffer = u64;
pub type VkFence = u64;
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkSwapchainKHR(pub(crate) u64);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkRenderPass(pub(crate) u64);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkFramebuffer(pub(crate) u64);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkSemaphore(pub(crate)  u64);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkShaderModule(pub(crate) u64);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkPipelineCache(pub(crate) u64);

// Dispatchable Handles
pub type VkCommandBuffer = *mut c_void;
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkDevice(*mut c_void);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkPhysicalDevice(*mut c_void);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkInstance(*mut c_void);
#[repr(C)] #[derive(Copy, Clone, Debug)] pub struct VkQueue(*mut c_void);

#[repr(C)] pub struct VkRenderPassBeginInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub render_pass: VkRenderPass,
	pub framebuffer: VkFramebuffer,
	pub render_area: VkRect2D,
	pub clear_value_count: u32,
	pub p_clear_values: *const VkClearValue,
}

#[repr(C)] pub struct VkSubresourceLayout {
	pub offset: VkDeviceSize,
	pub size: VkDeviceSize,
	pub row_pitch: VkDeviceSize,
	pub array_pitch: VkDeviceSize,
	pub depth_pitch: VkDeviceSize,
}

#[repr(C)] pub struct VkImageSubresource {
	pub aspect_mask: VkImageAspectFlags,
	pub mip_level: u32,
	pub array_layer: u32,
}

#[repr(C)] pub struct VkSamplerCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub mag_filter: VkFilter,
	pub min_filter: VkFilter,
	pub mipmap_mode: VkSamplerMipmapMode,
	pub address_mode_u: VkSamplerAddressMode,
	pub address_mode_v: VkSamplerAddressMode,
	pub address_mode_w: VkSamplerAddressMode,
	pub mip_lod_bias: f32,
	pub anisotropy_enable: VkBool32,
	pub max_anisotropy: f32,
	pub compare_enable: VkBool32,
	pub compare_op: VkCompareOp,
	pub min_lod: f32,
	pub max_lod: f32,
	pub border_color: VkBorderColor,
	pub unnormalized_coordinates: VkBool32
}

#[repr(C)] pub struct VkFormatProperties {
	pub linear_tiling_features: VkFlags,
	pub optimal_tiling_features: VkFlags,
	pub buffer_features: VkFlags,
}

#[repr(C)] pub struct VkImageSubresourceLayers {
	pub aspect_mask: VkImageAspectFlags,
	pub mip_level: u32,
	pub base_array_layer: u32,
	pub layer_count: u32,
}

#[repr(C)] pub struct VkOffset3D {
	pub x: i32,
	pub y: i32,
	pub z: i32,
}

#[repr(C)] pub struct VkImageCopy {
	pub src_subresource: VkImageSubresourceLayers,
	pub src_offset: VkOffset3D,
	pub dst_subresource: VkImageSubresourceLayers,
	pub dst_offset: VkOffset3D,
	pub extent: VkExtent3D,
}

#[repr(C)] pub struct VkSemaphoreCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
}

#[repr(C)] pub struct VkPushConstantRange {
	pub stage_flags: VkShaderStage,
	pub offset: u32,
	pub size: u32,
}

#[repr(C)] pub struct VkPipelineTessellationStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub patch_control_points: u32,
}

#[repr(C)] pub struct VkStencilOpState {
	pub fail_op: VkStencilOp,
	pub pass_op: VkStencilOp,
	pub depth_fail_op: VkStencilOp,
	pub compare_op: VkCompareOp,
	pub compare_mask: u32,
	pub write_mask: u32,
	pub reference: u32,
}

#[repr(C)] pub struct VkDescriptorSetLayoutCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub binding_count: u32,
	pub bindings: *const VkDescriptorSetLayoutBinding,
}

#[repr(C)] pub struct VkDescriptorSetLayoutBinding {
	pub binding: u32,
	pub descriptor_type: VkDescriptorType,
	pub descriptor_count: u32,
	pub stage_flags: VkShaderStage,
	pub immutable_samplers: *const VkSampler,
}

#[repr(C)] pub struct VkPipelineLayoutCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub set_layout_count: u32,
	pub set_layouts: *const VkDescriptorSetLayout,
	pub push_constant_range_count: u32,
	pub push_constant_ranges: *const VkPushConstantRange,
}

#[repr(C)] pub struct VkGraphicsPipelineCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub stage_count: u32,
	pub stages: *const VkPipelineShaderStageCreateInfo,
	pub vertex_input_state: *const VkPipelineVertexInputStateCreateInfo,
	pub input_assembly_state: *const VkPipelineInputAssemblyStateCreateInfo,
	pub tessellation_state: *const VkPipelineTessellationStateCreateInfo,
	pub viewport_state: *const VkPipelineViewportStateCreateInfo,
	pub rasterization_state: *const VkPipelineRasterizationStateCreateInfo,
	pub multisample_state: *const VkPipelineMultisampleStateCreateInfo,
	pub depth_stencil_state: *const VkPipelineDepthStencilStateCreateInfo,
	pub color_blend_state: *const VkPipelineColorBlendStateCreateInfo,
	pub dynamic_state: *const VkPipelineDynamicStateCreateInfo,
	pub layout: VkPipelineLayout,
	pub render_pass: VkRenderPass,
	pub subpass: u32,
	pub base_pipeline_handle: VkPipeline,
	pub base_pipeline_index: i32,
}

#[repr(C)] pub struct VkPipelineShaderStageCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub stage: VkShaderStage,
	pub module: VkShaderModule,
	pub name: *const u8,
	pub specialization_info: *const c_void,
}

#[repr(C)] pub struct VkPipelineVertexInputStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub vertex_binding_description_count: u32,
	pub vertex_binding_descriptions: *const VkVertexInputBindingDescription,
	pub vertex_attribute_description_count: u32,
	pub vertex_attribute_descriptions: *const VkVertexInputAttributeDescription,
}

#[repr(C)] pub struct VkVertexInputBindingDescription {
	pub binding: u32,
	pub stride: u32,
	pub input_rate: VkVertexInputRate,
}

#[repr(C)] pub struct VkVertexInputAttributeDescription {
	pub location: u32,
	pub binding: u32,
	pub format: VkFormat,
	pub offset: u32,
}

#[repr(C)] pub struct VkPipelineInputAssemblyStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub topology: VkPrimitiveTopology,
	pub primitive_restart_enable: VkBool32,
}

#[repr(C)] pub struct VkPipelineViewportStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub viewport_count: u32,
	pub viewports: *const VkViewport,
	pub scissor_count: u32,
	pub scissors: *const VkRect2D
}

#[repr(C)] pub struct VkViewport {
	pub x: f32,
	pub y: f32,
	pub width: f32,
	pub height: f32,
	pub min_depth: f32,
	pub max_depth: f32,
}

#[repr(C)] pub struct VkOffset2D {
	pub x: i32,
	pub y: i32,
}

#[repr(C)] pub struct VkRect2D {
	pub offset: VkOffset2D,
	pub extent: VkExtent2D,
}

#[repr(C)] pub struct VkPipelineRasterizationStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub depth_clamp_enable: VkBool32,
	pub rasterizer_discard_enable: VkBool32,
	pub polygon_mode: VkPolygonMode,
	pub cull_mode: VkCullMode,
	pub front_face: VkFrontFace,
	pub depth_bias_enable: VkBool32,
	pub depth_bias_constant_factor: f32,
	pub depth_bias_clamp: f32,
	pub depth_bias_slope_factor: f32,
	pub line_width: f32,
}

#[repr(C)] pub struct VkPipelineMultisampleStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub rasterization_samples: VkSampleCount,
	pub sample_shading_enable: VkBool32,
	pub min_sample_shading: f32,
	pub sample_mask: *const VkSampleMask,
	pub alpha_to_coverage_enable: VkBool32,
	pub alpha_to_one_enable: VkBool32,
}

#[repr(C)] pub struct VkPipelineDepthStencilStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub depth_test_enable: VkBool32,
	pub depth_write_enable: VkBool32,
	pub depth_compare_op: VkCompareOp,
	pub depth_bounds_test_enable: VkBool32,
	pub stencil_test_enable: VkBool32,
	pub front: VkStencilOpState,
	pub back: VkStencilOpState,
	pub min_depth_bounds: f32,
	pub max_depth_bounds: f32,
}

#[repr(C)] pub struct VkPipelineColorBlendStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub logic_op_enable: VkBool32,
	pub logic_op: VkLogicOp,
	pub attachment_count: u32,
	pub attachments: *const VkPipelineColorBlendAttachmentState,
	pub blend_constants: [f32; 4],
}

#[repr(C)] pub struct VkPipelineColorBlendAttachmentState {
	pub blend_enable: VkBool32,
	pub src_color_blend_factor: VkBlendFactor,
	pub dst_color_blend_factor: VkBlendFactor,
	pub color_blend_op: VkBlendOp,
	pub src_alpha_blend_factor: VkBlendFactor,
	pub dst_alpha_blend_factor: VkBlendFactor,
	pub alpha_blend_op: VkBlendOp,
	pub color_write_mask: VkFlags,
}

#[repr(C)] pub struct VkPipelineDynamicStateCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub dynamic_state_count: u32,
	pub dynamic_states: *const VkDynamicState,
}

#[repr(C)] pub struct VkShaderModuleCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub code_size: usize,
	pub code: *const u8, // Actually u32
}

#[repr(C)] pub struct VkDescriptorPoolCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub max_sets: u32,
	pub pool_size_count: u32,
	pub pool_sizes: *const VkDescriptorPoolSize
}

#[repr(C)] pub struct VkDescriptorPoolSize {
	pub descriptor_type: VkDescriptorType,
	pub descriptor_count: u32,
}

#[repr(C)] pub struct VkDescriptorSetAllocateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub descriptor_pool: VkDescriptorPool,
	pub descriptor_set_count: u32,
	pub set_layouts: *const VkDescriptorSetLayout,
}

#[repr(C)] pub struct VkBufferCreateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub flags: VkFlags,
	pub size: VkDeviceSize,
	pub usage: VkBufferUsage,
	pub sharing_mode: VkSharingMode,
	pub queue_family_index_count: u32,
	pub queue_family_indices: *const u32,
}

#[repr(C)] pub struct VkDescriptorBufferInfo {
	pub buffer: VkBuffer,
	pub offset: VkDeviceSize,
	pub range: VkDeviceSize,
}

#[repr(C)] pub struct VkWriteDescriptorSet {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub dst_set: VkDescriptorSet,
	pub dst_binding: u32,
	pub dst_array_element: u32,
	pub descriptor_count: u32,
	pub descriptor_type: VkDescriptorType,
	pub image_info: *const VkDescriptorImageInfo,
	pub buffer_info: *const VkDescriptorBufferInfo,
	pub texel_buffer_view: *const c_void,
}

#[repr(C)] pub struct VkDescriptorImageInfo {
	pub sampler: VkSampler,
	pub image_view: VkImageView,
	pub image_layout: VkImageLayout,
}

#[repr(C)] pub struct VkFramebufferCreateInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub flags: VkFlags,
	pub render_pass: VkRenderPass,
	pub attachment_count: u32,
	pub attachments: *const VkImageView,
	pub width: u32,
	pub height: u32,
	pub layers: u32,
}

#[repr(C)] pub struct VkRenderPassCreateInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub flags: VkFlags,
	pub attachment_count: u32,
	pub attachments: *const VkAttachmentDescription,
	pub subpass_count: u32,
	pub subpasses: *const VkSubpassDescription,
	pub dependency_count: u32,
	pub dependencies: *const VkSubpassDependency,
}

#[repr(C)] pub struct VkSubpassDescription {
	pub flags: VkFlags,
	pub pipeline_bind_point: VkPipelineBindPoint,
	pub input_attachment_count: u32,
	pub input_attachments: *const VkAttachmentReference,
	pub color_attachment_count: u32,
	pub color_attachments: *const VkAttachmentReference,
	pub resolve_attachments: *const VkAttachmentReference,
	pub depth_stencil_attachment: *const VkAttachmentReference,
	pub preserve_attachment_count: u32,
	pub preserve_attachments: *const u32,
}

#[repr(C)] pub struct VkAttachmentReference {
	pub attachment: u32,
	pub layout: VkImageLayout,
}

#[repr(C)] pub struct VkAttachmentDescription {
	pub flags: VkFlags,
	pub format: VkFormat,
	pub samples: VkSampleCount,
	pub load_op: VkAttachmentLoadOp,
	pub store_op: VkAttachmentStoreOp,
	pub stencil_load_op: VkAttachmentLoadOp,
	pub stencil_store_op: VkAttachmentStoreOp,
	pub initial_layout: VkImageLayout,
	pub final_layout: VkImageLayout,
}

#[repr(C)] pub struct VkMemoryRequirements {
	pub size: VkDeviceSize,
	pub alignment: VkDeviceSize,
	pub memory_type_bits: u32,
}

#[repr(C)] pub struct VkMemoryAllocateInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub allocation_size: VkDeviceSize,
	pub memory_type_index: u32,
}

#[repr(C)] pub struct VkExtent3D {
	pub width: u32,
	pub height: u32,
	pub depth: u32,
}

#[repr(C)] pub struct VkImageCreateInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub flags: VkFlags,
	pub image_type: VkImageType,
	pub format: VkFormat,
	pub extent: VkExtent3D,
	pub mip_levels: u32,
	pub array_layers: u32,
	pub samples: VkSampleCount,
	pub tiling: VkImageTiling,
	pub usage: VkImageUsage,
	pub sharing_mode: VkSharingMode,
	pub queue_family_index_count: u32,
	pub p_queue_family_indices: *const u32,
	pub initial_layout: VkImageLayout,
}

#[repr(C)] pub struct VkMemoryType {
	pub property_flags: VkFlags,
	pub heap_index: u32,
}

#[repr(C)] pub struct VkPhysicalDeviceMemoryProperties {
	pub memory_type_count: u32,
	pub memory_types: [VkMemoryType; 32],
	pub memory_heap_count: u32,
	pub memory_heaps: [VkMemoryType; 32],
}

#[repr(C)] pub struct VkImageMemoryBarrier {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub src_access_mask: VkAccess,
	pub dst_access_mask: VkAccess,
	pub old_layout: VkImageLayout,
	pub new_layout: VkImageLayout,
	pub src_queue_family_index: u32,
	pub dst_queue_family_index: u32,
	pub image: VkImage,
	pub subresource_range: VkImageSubresourceRange,
}

#[repr(C)] pub struct VkSubmitInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub wait_semaphore_count: u32,
	pub wait_semaphores: *const VkSemaphore,
	pub wait_dst_stage_mask: *const VkPipelineStage,
	pub command_buffer_count: u32,
	pub p_command_buffers: *const VkCommandBuffer,
	pub signal_semaphore_count: u32,
	pub p_signal_semaphores: *const VkSemaphore,
}

#[repr(C)] pub struct VkBufferMemoryBarrier {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub src_access_mask: VkFlags,
	pub dst_access_mask: VkFlags,
	pub src_queue_family_index: u32,
	pub dst_queue_family_index: u32,
	pub buffer: VkBuffer,
	pub offset: VkDeviceSize,
	pub size: VkDeviceSize,
}

#[repr(C)] pub struct VkMemoryBarrier {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub src_access_mask: VkFlags,
	pub dst_access_mask: VkFlags,
}

#[repr(C)] pub struct VkCommandBufferInheritanceInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub render_pass: VkRenderPass,
	pub subpass: u32,
	pub framebuffer: VkFramebuffer,
	pub occlusion_query_enable: VkBool32,
	pub query_flags: VkFlags,
	pub pipeline_statistics: VkFlags,
}

#[repr(C)] pub struct VkFenceCreateInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub flags: VkFlags,
}

#[repr(C)] pub struct VkCommandBufferBeginInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub flags: VkCommandBufferUsage,
	pub p_inheritance_info: *const VkCommandBufferInheritanceInfo,
}

#[repr(C)] pub struct VkImageSubresourceRange {
	pub aspect_mask: VkImageAspectFlags,
	pub base_mip_level: u32,
	pub level_count: u32,
	pub base_array_layer: u32,
	pub layer_count: u32,
}

#[repr(C)] pub struct VkComponentMapping {
	pub r: VkComponentSwizzle,
	pub g: VkComponentSwizzle,
	pub b: VkComponentSwizzle,
	pub a: VkComponentSwizzle,
}

#[repr(C)] pub struct VkImageViewCreateInfo {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub flags: VkFlags,
	pub image: VkImage,
	pub view_type: VkImageViewType,
	pub format: VkFormat,
	pub components: VkComponentMapping,
	pub subresource_range: VkImageSubresourceRange,
}

#[repr(C)] pub struct VkSwapchainCreateInfoKHR {
	pub s_type: VkStructureType,
	pub p_next: *const c_void,
	pub flags: VkFlags,
	pub surface: VkSurfaceKHR,
	pub min_image_count: u32,
	pub image_format: VkFormat,
	pub image_color_space: VkColorSpaceKHR,
	pub image_extent: VkExtent2D,
	pub image_array_layers: u32,
	pub image_usage: VkImageUsage,
        pub image_sharing_mode: VkSharingMode,
	pub queue_family_index_count: u32,
	pub p_queue_family_indices: *const u32,
	pub pre_transform: VkSurfaceTransformFlagBitsKHR,
	pub composite_alpha: VkCompositeAlphaFlagBitsKHR,
	pub present_mode: VkPresentModeKHR,
	pub clipped: VkBool32,
	pub old_swapchain: VkSwapchainKHR,
}

#[repr(C)] pub struct VkExtent2D {
	pub width: u32,
	pub height: u32,
}

#[repr(C)] pub struct VkSurfaceCapabilitiesKHR {
	pub min_image_count: u32,
	pub max_image_count: u32,
	pub current_extent: VkExtent2D,
	pub min_image_extent: VkExtent2D,
	pub max_image_extent: VkExtent2D,
	pub max_image_array_layers: u32,
	pub supported_transforms: VkFlags,
	pub current_transform: VkSurfaceTransformFlagBitsKHR,
	pub supported_composite_alpha: VkFlags,
	pub supported_usage_flags: VkFlags
}

#[repr(C)] pub struct VkSurfaceFormatKHR {
	pub format: VkFormat,
	pub color_space: VkColorSpaceKHR,
}

#[repr(C)] pub struct VkApplicationInfo {
	pub s_type: VkStructureType,
	pub p_next: *mut c_void,
	pub p_application_name: *const i8,
	pub application_version: u32,
	pub p_engine_name: *const i8,
	pub engine_version: u32,
	pub api_version: u32,
}

#[derive(Debug)] #[repr(C)] pub struct VkInstanceCreateInfo {
	pub s_type: VkStructureType,
	pub p_next: *mut c_void,
	pub flags: u32,
	pub p_application_info: *const VkApplicationInfo,
	pub enabled_layer_count: u32,
	pub pp_enabled_layer_names: *const *const i8,
	pub enabled_extension_count: u32,
	pub pp_enabled_extension_names: *const *const i8,
}

#[derive(Copy, Clone)] #[repr(C)]
pub struct VkClearDepthStencilValue {
	pub depth: f32,
	pub stencil: u32,
}

#[repr(C)]
pub struct VkPresentInfo {
	pub s_type: VkStructureType,
	pub next: *const c_void,
	pub wait_semaphore_count: u32,
	pub wait_semaphores: *const VkSemaphore,
	pub swapchain_count: u32,
	pub swapchains: *const VkSwapchainKHR,
	pub image_indices: *const u32,
	pub results: *mut VkResult,
}

#[repr(C)]
pub struct VkSubpassDependency {
	pub src_subpass: u32,
	pub dst_subpass: u32,
	pub src_stage_mask: VkPipelineStage,
	pub dst_stage_mask: VkPipelineStage,
	pub src_access_mask: VkAccess,
	pub dst_access_mask: VkAccess,
	pub dependency_flags: u32,
}

#[derive(Copy, Clone)] #[repr(C)]
pub union VkClearColorValue  {
	pub float32: [f32; 4],
	pub int32: [i32; 4],
	pub uint32: [u32; 4],
}

#[derive(Copy, Clone)] #[repr(C)]
pub union VkClearValue {
	pub color: VkClearColorValue,
	pub depth_stencil: VkClearDepthStencilValue,
}

#[repr(C)] #[allow(dead_code)] pub enum VkSubpassContents {
	Inline = 0,
	SecondaryCommandBuffers = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkIndexType {
	Uint16 = 0,
	Uint32 = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkBorderColor {
	FloatTransparentBlack = 0,
	IntTransparentBlack = 1,
	FloatOpaqueBlack = 2,
	IntOpaqueBlack = 3,
	FloatOpaqueWhite = 4,
	IntOpaqueWhite = 5,
}

#[repr(C)] #[allow(dead_code)] pub enum VkSamplerAddressMode {
	Repeat = 0,
	MirroredRepeat = 1,
	ClampToEdge = 2,
	ClampToBorder = 3,
	MirrorClampToEdge = 4,
}

#[repr(C)] #[allow(dead_code)] pub enum VkSamplerMipmapMode {
	Nearest = 0,
	Linear = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkFilter {
	Nearest = 0,
	Linear = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkStencilOp {
	Keep = 0,
	Zero = 1,
	Replace = 2,
	IncrementAndClamp = 3,
	DecrementAndClamp = 4,
	Invert = 5,
	IncrementAndWrap = 6,
	DecrementAndWrap = 7,
}

#[repr(C)] #[allow(dead_code)] pub enum VkShaderStage {
	Vertex = 0x00000001,
	TessellationControl = 0x00000002,
	TessellationEvaluation = 0x00000004,
	Geometry = 0x00000008,
	Fragment = 0x00000010,
	Compute = 0x00000020,
	AllGraphics = 0x0000001f,
	All = 0x7fffffff,
	VertexAndFragment = 0x00000001 | 0x00000010,
}

#[repr(C)] #[allow(dead_code)] pub enum VkVertexInputRate {
	Vertex = 0,
	Instance = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkPrimitiveTopology {
	PointList = 0,
	LineList = 1,
	LineStrip = 2,
	TriangleList = 3,
	TriangleStrip = 4,
	TriangleFan = 5,
	LineListWithAdjacency = 6,
	LineStripWithAdjacency = 7,
	TriangleListWithAdjacency = 8,
	TriangleStripWithAdjacency = 9,
	PatchList = 10,
}

#[repr(C)] #[allow(dead_code)] pub enum VkPolygonMode {
	Fill = 0,
	Line = 1,
	Point = 2,
}

#[repr(C)] #[allow(dead_code)] pub enum VkCullMode {
//	None = 0,
//	Front = 0x00000001,
	Back = 0x00000002,
//	FrontAndBack = 0x00000003,
}

#[repr(C)] #[allow(dead_code)] pub enum VkFrontFace {
	CounterClockwise = 0,
	Clockwise = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkCompareOp {
	Never = 0,
	Less = 1,
	Equal = 2,
	LessOrEqual = 3,
	Greater = 4,
	NotEqual = 5,
	GreaterOrEqual = 6,
	Always = 7,
}

#[repr(C)] #[allow(dead_code)] pub enum VkLogicOp {
	Clear = 0,
	And = 1,
	AndReverse = 2,
	Copy = 3,
	AndInverted = 4,
	NoOp = 5,
	Xor = 6,
	Or = 7,
	Nor = 8,
	Equivalent = 9,
	Invert = 10,
	OrReverse = 11,
	CopyInverted = 12,
	OrInverted = 13,
	Nand = 14,
	Set = 15,
}

#[repr(C)] #[allow(dead_code)] pub enum VkBlendFactor {
	Zero = 0,
	One = 1,
	SrcColor = 2,
	OneMinusSrcColor = 3,
	DstColor = 4,
	OneMinusDstColor = 5,
	SrcAlpha = 6,
	OneMinusSrcAlpha = 7,
	DstAlpha = 8,
	OneMinusDstAlpha = 9,
	ConstantColor = 10,
	OneMinusConstantColor = 11,
	ConstantAlpha = 12,
	OneMinusConstantAlpha = 13,
	SrcAlphaSaturate = 14,
	Src1Color = 15,
	OneMinusSrc1Color = 16,
	Src1Alpha = 17,
	OneMinusSrc1Alpha = 18,
}

#[repr(C)] #[allow(dead_code)] pub enum VkBlendOp {
	Add = 0,
	Subtract = 1,
	ReverseSubtract = 2,
	Min = 3,
	Max = 4,
}

#[repr(C)] #[allow(dead_code)] pub enum VkDynamicState {
	Viewport = 0,
	Scissor = 1,
	LineWidth = 2,
	DepthBias = 3,
	BlendConstants = 4,
	DepthBounds = 5,
	StencilCompareMask = 6,
	StencilWriteMask = 7,
	StencilReference = 8,
}

#[repr(C)] #[allow(dead_code)] pub enum VkBufferUsage {
	TransferSrcBit = 0x00000001,
	TransferDstBit = 0x00000002,
	UniformTexelBufferBit = 0x00000004,
	StorageTexelBufferBit = 0x00000008,
	UniformBufferBit = 0x00000010,
	StorageBufferBit = 0x00000020,
	IndexBufferBit = 0x00000040,
	VertexBufferBit = 0x00000080,
	IndirectBufferBit = 0x00000100,
	VertexIndexBufferBit = 0x00000040 | 0x00000080,
}

#[repr(C)] #[allow(dead_code)] pub enum VkDescriptorType {
	Sampler = 0,
	CombinedImageSampler = 1,
	SampledImage = 2,
	StorageImage = 3,
	UniformTexelBuffer = 4,
	StorageTexelBuffer = 5,
	UniformBuffer = 6,
	StorageBuffer = 7,
	UniformBufferDynamic = 8,
	StorageBufferDynamic = 9,
	InputAttachment = 10,
} 

#[repr(C)] #[allow(dead_code)] pub enum VkPipelineBindPoint {
	Graphics = 0,
	Compute = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkAttachmentStoreOp {
	Store = 0,
	DontCare = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkAttachmentLoadOp {
	Load = 0,
	Clear = 1,
	DontCare = 2,
}

#[repr(C)] #[allow(dead_code)] pub enum VkImageTiling {
	Optimal = 0,
	Linear = 1,
}

#[repr(C)] #[allow(dead_code)] pub enum VkSampleCount {
	Sc1 = 0x00000001,
	Sc2 = 0x00000002,
	Sc4 = 0x00000004,
	Sc8 = 0x00000008,
	Sc16 = 0x00000010,
	Sc32 = 0x00000020,
	Sc64 = 0x00000040,
}

#[repr(C)] #[allow(dead_code)] pub enum VkImageType {
	Dim1d = 0,
	Dim2d = 1,
	Dim3d = 2,
}

#[repr(C)] #[allow(dead_code)] pub enum VkAccess {
	NoFlags = 0x00000000,
	IndirectCommandReadBit = 0x00000001,
	IndexReadBit = 0x00000002,
	VertexAttributeReadBit = 0x00000004,
	UniformReadBit = 0x00000008,
	InputAttachmentReadBit = 0x00000010,
	ShaderReadBit = 0x00000020,
	ShaderWriteBit = 0x00000040,
	ColorAttachmentReadBit = 0x00000080,
	ColorAttachmentWriteBit = 0x00000100,
	DepthStencilAttachmentReadBit = 0x00000200,
	DepthStencilAttachmentWriteBit = 0x00000400,
	TransferReadBit = 0x00000800,
	TransferWriteBit = 0x00001000,
	HostReadBit = 0x00002000,
	HostWriteBit = 0x00004000,
	MemoryReadBit = 0x00008000,
	MemoryWriteBit = 0x00010000,
	// OR'D FLAGS
	DepthStencilAttachmentReadWrite = 0x00000200 | 0x00000400,
	ColorAttachmentReadWrite = 0x00000080 | 0x00000100,
}

#[repr(C)] #[allow(dead_code)] pub enum VkImageLayout {
	Undefined = 0,
	General = 1,
	ColorAttachmentOptimal = 2,
	DepthStencilAttachmentOptimal = 3,
	DepthStencilReadOnlyOptimal = 4,
	ShaderReadOnlyOptimal = 5,
	TransferSrcOptimal = 6,
	TransferDstOptimal = 7,
	Preinitialized = 8,
	PresentSrc = 1000001002,
}

#[repr(C)] #[allow(dead_code)] pub enum VkPipelineStage {
	TopOfPipe = 0x00000001,
	DrawIndirect = 0x00000002,
	VertexInput = 0x00000004,
	VertexShader = 0x00000008,
	TessellationControlShader = 0x00000010,
	TessellationEvaluationShader = 0x00000020,
	GeometryShader = 0x00000040,
	FragmentShader = 0x00000080,
	EarlyFragmentTests = 0x00000100,
	LateFragmentTests = 0x00000200,
	ColorAttachmentOutput = 0x00000400,
	ComputeShader = 0x00000800,
	Transfer = 0x00001000,
	BottomOfPipe = 0x00002000,
	Host = 0x00004000,
	AllGraphics = 0x00008000,
	AllCommands = 0x00010000,
	TopOfPipeAndColorAttachmentOutput = 0x00000401,
	TopOfPipeAndEarlyFragmentTests = 0x00000101,
}

#[repr(C)] #[allow(dead_code)] pub enum VkCommandBufferUsage {
	OneTimeSubmitBit = 0x00000001,
	RenderPassContinueBit = 0x00000002,
	SimultaneousUseBit = 0x00000004,
}

#[repr(C)] #[allow(dead_code)] pub enum VkImageAspectFlags {
	Color = 0x00000001,
	Depth = 0x00000002,
	Stencil = 0x00000004,
	Metadata = 0x00000008,
}

#[repr(C)] #[allow(dead_code)] pub enum VkImageViewType {
	SingleLayer1d = 0,
	SingleLayer2d = 1,
	SingleLayer3d = 2,
	Cube = 3,
	LayerArray1d = 4,
	LayerArray2d = 5,
	LayerArrayCube = 6,
}

#[repr(C)] #[allow(dead_code)] pub enum VkComponentSwizzle {
	Identity = 0,
	Zero = 1,
	One = 2,
	R = 3,
	G = 4,
	B = 5,
	A = 6,
}

#[repr(C)] #[allow(dead_code)] pub enum VkSharingMode {
	Exclusive = 0,
	Concurrent = 1,
}

#[repr(C)] #[allow(dead_code)] #[derive(Copy, Clone, PartialEq)] pub enum VkImageUsage {
	TransferSrcBit = 0x00000001,
	TransferDstBit = 0x00000002,
	SampledBit = 0x00000004,
	StorageBit = 0x00000008,
	ColorAttachmentBit = 0x00000010,
	DepthStencilAttachmentBit = 0x00000020,
	TransientAttachmentBit = 0x00000040,
	InputAttachmentBit = 0x00000080,
	TransferDstAndUsage = 0x00000006,
	TransientColorAttachment = 0x00000040 | 0x00000010,
}

#[repr(C)] #[allow(dead_code)] #[derive(PartialEq, Clone)]
pub enum VkPresentModeKHR {
	Immediate = 0,
	Mailbox = 1,
	Fifo = 2,
	FifoRelaxed = 3,
}

#[repr(C)] #[allow(dead_code)] pub enum VkCompositeAlphaFlagBitsKHR {
	Opaque = 0x00000001,
	PreMultiplied = 0x00000002,
	PostMultiplied = 0x00000004,
	Inherit = 0x00000008,
}

#[repr(C)] #[allow(dead_code)] pub enum VkSurfaceTransformFlagBitsKHR {
	Identity = 0x00000001,
	Rotate90 = 0x00000002,
	Rotate180 = 0x00000004,
	Rotate270 = 0x00000008,
	HorizontalMirror = 0x00000010,
	HorizontalMirrorRotate90 = 0x00000020,
	HorizontalMirrorRotate180 = 0x00000040,
	HorizontalMirrorRotate270 = 0x00000080,
	Inherit = 0x00000100,
}

#[repr(C)] #[allow(dead_code)] pub enum VkColorSpaceKHR {
	SrgbNonlinearKhr = 0,
}

#[repr(C)] #[allow(dead_code)] #[derive(PartialEq, Clone)] pub enum VkFormat {
	Undefined = 0,
	R4g4UnormPack8 = 1,
	R4g4b4a4UnormPack16 = 2,
	B4g4r4a4UnormPack16 = 3,
	R5g6b5UnormPack16 = 4,
	B5g6r5UnormPack16 = 5,
	R5g5b5a1UnormPack16 = 6,
	B5g5r5a1UnormPack16 = 7,
	A1r5g5b5UnormPack16 = 8,
	R8Unorm = 9,
	R8Snorm = 10,
	R8Uscaled = 11,
	R8Sscaled = 12,
	R8Uint = 13,
	R8Sint = 14,
	R8Srgb = 15,
	R8g8Unorm = 16,
	R8g8Snorm = 17,
	R8g8Uscaled = 18,
	R8g8Sscaled = 19,
	R8g8Uint = 20,
	R8g8Sint = 21,
	R8g8Srgb = 22,
	R8g8b8Unorm = 23,
	R8g8b8Snorm = 24,
	R8g8b8Uscaled = 25,
	R8g8b8Sscaled = 26,
	R8g8b8Uint = 27,
	R8g8b8Sint = 28,
	R8g8b8Srgb = 29,
	B8g8r8Unorm = 30,
	B8g8r8Snorm = 31,
	B8g8r8Uscaled = 32,
	B8g8r8Sscaled = 33,
	B8g8r8Uint = 34,
	B8g8r8Sint = 35,
	B8g8r8Srgb = 36,
	R8g8b8a8Unorm = 37,
	R8g8b8a8Snorm = 38,
	R8g8b8a8Uscaled = 39,
	R8g8b8a8Sscaled = 40,
	R8g8b8a8Uint = 41,
	R8g8b8a8Sint = 42,
	R8g8b8a8Srgb = 43,
	B8g8r8a8Unorm = 44,
	B8g8r8a8Snorm = 45,
	B8g8r8a8Uscaled = 46,
	B8g8r8a8Sscaled = 47,
	B8g8r8a8Uint = 48,
	B8g8r8a8Sint = 49,
	B8g8r8a8Srgb = 50,
	A8b8g8r8UnormPack32 = 51,
	A8b8g8r8SnormPack32 = 52,
	A8b8g8r8UscaledPack32 = 53,
	A8b8g8r8SscaledPack32 = 54,
	A8b8g8r8UintPack32 = 55,
	A8b8g8r8SintPack32 = 56,
	A8b8g8r8SrgbPack32 = 57,
	A2r10g10b10UnormPack32 = 58,
	A2r10g10b10SnormPack32 = 59,
	A2r10g10b10UscaledPack32 = 60,
	A2r10g10b10SscaledPack32 = 61,
	A2r10g10b10UintPack32 = 62,
	A2r10g10b10SintPack32 = 63,
	A2b10g10r10UnormPack32 = 64,
	A2b10g10r10SnormPack32 = 65,
	A2b10g10r10UscaledPack32 = 66,
	A2b10g10r10SscaledPack32 = 67,
	A2b10g10r10UintPack32 = 68,
	A2b10g10r10SintPack32 = 69,
	R16Unorm = 70,
	R16Snorm = 71,
	R16Uscaled = 72,
	R16Sscaled = 73,
	R16Uint = 74,
	R16Sint = 75,
	R16Sfloat = 76,
	R16g16Unorm = 77,
	R16g16Snorm = 78,
	R16g16Uscaled = 79,
	R16g16Sscaled = 80,
	R16g16Uint = 81,
	R16g16Sint = 82,
	R16g16Sfloat = 83,
	R16g16b16Unorm = 84,
	R16g16b16Snorm = 85,
	R16g16b16Uscaled = 86,
	R16g16b16Sscaled = 87,
	R16g16b16Uint = 88,
	R16g16b16Sint = 89,
	R16g16b16Sfloat = 90,
	R16g16b16a16Unorm = 91,
	R16g16b16a16Snorm = 92,
	R16g16b16a16Uscaled = 93,
	R16g16b16a16Sscaled = 94,
	R16g16b16a16Uint = 95,
	R16g16b16a16Sint = 96,
	R16g16b16a16Sfloat = 97,
	R32Uint = 98,
	R32Sint = 99,
	R32Sfloat = 100,
	R32g32Uint = 101,
	R32g32Sint = 102,
	R32g32Sfloat = 103,
	R32g32b32Uint = 104,
	R32g32b32Sint = 105,
	R32g32b32Sfloat = 106,
	R32g32b32a32Uint = 107,
	R32g32b32a32Sint = 108,
	R32g32b32a32Sfloat = 109,
	R64Uint = 110,
	R64Sint = 111,
	R64Sfloat = 112,
	R64g64Uint = 113,
	R64g64Sint = 114,
	R64g64Sfloat = 115,
	R64g64b64Uint = 116,
	R64g64b64Sint = 117,
	R64g64b64Sfloat = 118,
	R64g64b64a64Uint = 119,
	R64g64b64a64Sint = 120,
	R64g64b64a64Sfloat = 121,
	B10g11r11UfloatPack32 = 122,
	E5b9g9r9UfloatPack32 = 123,
	D16Unorm = 124,
	X8D24UnormPack32 = 125,
	D32Sfloat = 126,
	S8Uint = 127,
	D16UnormS8Uint = 128,
	D24UnormS8Uint = 129,
	D32SfloatS8Uint = 130,
	Bc1RgbUnormBlock = 131,
	Bc1RgbSrgbBlock = 132,
	Bc1RgbaUnormBlock = 133,
	Bc1RgbaSrgbBlock = 134,
	Bc2UnormBlock = 135,
	Bc2SrgbBlock = 136,
	Bc3UnormBlock = 137,
	Bc3SrgbBlock = 138,
	Bc4UnormBlock = 139,
	Bc4SnormBlock = 140,
	Bc5UnormBlock = 141,
	Bc5SnormBlock = 142,
	Bc6hUfloatBlock = 143,
	Bc6hSfloatBlock = 144,
	Bc7UnormBlock = 145,
	Bc7SrgbBlock = 146,
	Etc2R8g8b8UnormBlock = 147,
	Etc2R8g8b8SrgbBlock = 148,
	Etc2R8g8b8a1UnormBlock = 149,
	Etc2R8g8b8a1SrgbBlock = 150,
	Etc2R8g8b8a8UnormBlock = 151,
	Etc2R8g8b8a8SrgbBlock = 152,
	EacR11UnormBlock = 153,
	EacR11SnormBlock = 154,
	EacR11g11UnormBlock = 155,
	EacR11g11SnormBlock = 156,
	Astc4x4UnormBlock = 157,
	Astc4x4SrgbBlock = 158,
	Astc5x4UnormBlock = 159,
	Astc5x4SrgbBlock = 160,
	Astc5x5UnormBlock = 161,
	Astc5x5SrgbBlock = 162,
	Astc6x5UnormBlock = 163,
	Astc6x5SrgbBlock = 164,
	Astc6x6UnormBlock = 165,
	Astc6x6SrgbBlock = 166,
	Astc8x5UnormBlock = 167,
	Astc8x5SrgbBlock = 168,
	Astc8x6UnormBlock = 169,
	Astc8x6SrgbBlock = 170,
	Astc8x8UnormBlock = 171,
	Astc8x8SrgbBlock = 172,
	Astc10x5UnormBlock = 173,
	Astc10x5SrgbBlock = 174,
	Astc10x6UnormBlock = 175,
	Astc10x6SrgbBlock = 176,
	Astc10x8UnormBlock = 177,
	Astc10x8SrgbBlock = 178,
	Astc10x10UnormBlock = 179,
	Astc10x10SrgbBlock = 180,
	Astc12x10UnormBlock = 181,
	Astc12x10SrgbBlock = 182,
	Astc12x12UnormBlock = 183,
	Astc12x12SrgbBlock = 184,
}

#[derive(Debug)] #[repr(C)] #[allow(dead_code)] pub enum VkStructureType {
	ApplicationInfo = 0,
	InstanceCreateInfo = 1,
	DeviceQueueCreateInfo = 2,
	DeviceCreateInfo = 3,
	SubmitInfo = 4,
	MemoryAllocateInfo = 5,
	MappedMemoryRange = 6,
	BindSparseInfo = 7,
	FenceCreateInfo = 8,
	SemaphoreCreateInfo = 9,
	EventCreateInfo = 10,
	QueryPoolCreateInfo = 11,
	BufferCreateInfo = 12,
	BufferViewCreateInfo = 13,
	ImageCreateInfo = 14,
	ImageViewCreateInfo = 15,
	ShaderModuleCreateInfo = 16,
	PipelineCacheCreateInfo = 17,
	PipelineShaderStageCreateInfo = 18,
	PipelineVertexInputStateCreateInfo = 19,
	PipelineInputAssemblyStateCreateInfo = 20,
	PipelineTessellationStateCreateInfo = 21,
	PipelineViewportStateCreateInfo = 22,
	PipelineRasterizationStateCreateInfo = 23,
	PipelineMultisampleStateCreateInfo = 24,
	PipelineDepthStencilStateCreateInfo = 25,
	PipelineColorBlendStateCreateInfo = 26,
	PipelineDynamicStateCreateInfo = 27,
	GraphicsPipelineCreateInfo = 28,
	ComputePipelineCreateInfo = 29,
	PipelineLayoutCreateInfo = 30,
	SamplerCreateInfo = 31,
	DescriptorSetLayoutCreateInfo = 32,
	DescriptorPoolCreateInfo = 33,
	DescriptorSetAllocateInfo = 34,
	WriteDescriptorSet = 35,
	FramebufferCreateInfo = 37,
	RenderPassCreateInfo = 38,
	CommandPoolCreateInfo = 39,
	CommandBufferAllocateInfo = 40,
	CommandBufferInheritanceInfo = 41,
	CommandBufferBeginInfo = 42,
	RenderPassBeginInfo = 43,
	BufferMemoryBarrier = 44,
	ImageMemoryBarrier = 45,
	MemoryBarrier = 46,
	LoaderInstanceCreateInfo = 47,
	LoaderDeviceCreateInfo = 48,
	SwapchainCreateInfo = 1000001000,
	SurfaceCreateInfoXcb = 1000005000,
	SurfaceCreateInfoWindows = 1000009000,
	SurfaceCreateInfoAndroid = 1000008000,
	PresentInfo = 1000001001,
}

#[repr(C)] #[allow(dead_code)] #[derive(PartialEq)]
#[must_use = "Vulkan Result may be an error"] pub enum VkResult {
	Success = 0,
	NotReady = 1,
	Timeout = 2,
	EventSet = 3,
	EventReset = 4,
	Incomplete = 5,
	OutOfHostMemory = -1,
	OutOfDeviceMemory = -2,
	InitFailed = -3,
	DeviceLost = -4,
	MemoryMapFailed = -5,
	LayerNotPresent = -6,
	ExtNotPresent = -7,
	FeatureNotPresent = -8,
	IncompatDriver = -9,
	TooManyObjects = -10,
	BadFormat = -11,
	FragmentedPool = -12,
	Other = -1024,
	SurfaceLostKhr = -1000000000,
	NativeWindowInUseKhr = -1000000001,
	SuboptimalKhr = 1000001003,
	OutOfDateKhr = -1000001004,
	IncompatibleDisplayKhr = -1000003001,
	OutOfPoolMemoryKhr = -1000069000,
	InvalidExternalHandleKhr = -1000072003,
}

// // //

impl fmt::Display for VkResult {
	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
		match *self {

		VkResult::Success => write!(f, "Success"),
		VkResult::NotReady => write!(f, "Not Ready"),
		VkResult::Timeout => write!(f, "Timeout"),
		VkResult::EventSet => write!(f, "Event Set"),
		VkResult::EventReset => write!(f, "Event Reset"),
		VkResult::Incomplete => write!(f, "Incomplete"),
		VkResult::OutOfHostMemory => write!(f, "Out Of Host Memory"),
		VkResult::OutOfDeviceMemory => write!(f, "Out Of GPU Memory"),
		VkResult::InitFailed => write!(f, "Init Failed"),
		VkResult::DeviceLost => write!(f, "Device Lost"),
		VkResult::MemoryMapFailed => write!(f, "Memory Map Failed"),
		VkResult::LayerNotPresent => write!(f, "Layer Not Present"),
		VkResult::ExtNotPresent => write!(f, "Extension Not Present"),
		VkResult::FeatureNotPresent => write!(f, "Feature Not Present"),
		VkResult::IncompatDriver => write!(f, "Incompatible Driver"),
		VkResult::TooManyObjects => write!(f, "Too Many Objects"),
		VkResult::BadFormat => write!(f, "Format Not Supported"),
		VkResult::FragmentedPool => write!(f, "Fragmented Pool"),
		_ => write!(f, "Unknown Error"),

		}
	}
}

impl VkResult {
	/// Panic with error if not `VkResult::Success` or `VkResult::Incomplete`.
	pub fn unwrap(self) -> () {
		if self != VkResult::Success && self != VkResult::Incomplete {
			panic!("Failed: {}", self);
		}
	}
}