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
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
/* automatically generated by rust-bindgen 0.59.2 */

#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
use ash::vk::*;

pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __uint64_t = ::std::os::raw::c_ulong;
#[repr(u32)]
#[doc = " Flags for created #VmaAllocator."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaAllocatorCreateFlagBits {
    #[doc = " \\brief Allocator and all objects created from it will not be synchronized internally, so you must guarantee they are used from only one thread at a time or synchronized externally by you."]
    #[doc = ""]
    #[doc = "Using this flag may increase performance because internal mutexes are not used."]
    VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 1,
    #[doc = " \\brief Enables usage of VK_KHR_dedicated_allocation extension."]
    #[doc = ""]
    #[doc = "The flag works only if VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_0`."]
    #[doc = "When it is `VK_API_VERSION_1_1`, the flag is ignored because the extension has been promoted to Vulkan 1.1."]
    #[doc = ""]
    #[doc = "Using this extension will automatically allocate dedicated blocks of memory for"]
    #[doc = "some buffers and images instead of suballocating place for them out of bigger"]
    #[doc = "memory blocks (as if you explicitly used #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT"]
    #[doc = "flag) when it is recommended by the driver. It may improve performance on some"]
    #[doc = "GPUs."]
    #[doc = ""]
    #[doc = "You may set this flag only if you found out that following device extensions are"]
    #[doc = "supported, you enabled them while creating Vulkan device passed as"]
    #[doc = "VmaAllocatorCreateInfo::device, and you want them to be used internally by this"]
    #[doc = "library:"]
    #[doc = ""]
    #[doc = "- VK_KHR_get_memory_requirements2 (device extension)"]
    #[doc = "- VK_KHR_dedicated_allocation (device extension)"]
    #[doc = ""]
    #[doc = "When this flag is set, you can experience following warnings reported by Vulkan"]
    #[doc = "validation layer. You can ignore them."]
    #[doc = ""]
    #[doc = "> vkBindBufferMemory(): Binding memory to buffer 0x2d but vkGetBufferMemoryRequirements() has not been called on that buffer."]
    VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT = 2,
    #[doc = "Enables usage of VK_KHR_bind_memory2 extension."]
    #[doc = ""]
    #[doc = "The flag works only if VmaAllocatorCreateInfo::vulkanApiVersion `== VK_API_VERSION_1_0`."]
    #[doc = "When it is `VK_API_VERSION_1_1`, the flag is ignored because the extension has been promoted to Vulkan 1.1."]
    #[doc = ""]
    #[doc = "You may set this flag only if you found out that this device extension is supported,"]
    #[doc = "you enabled it while creating Vulkan device passed as VmaAllocatorCreateInfo::device,"]
    #[doc = "and you want it to be used internally by this library."]
    #[doc = ""]
    #[doc = "The extension provides functions `vkBindBufferMemory2KHR` and `vkBindImageMemory2KHR`,"]
    #[doc = "which allow to pass a chain of `pNext` structures while binding."]
    #[doc = "This flag is required if you use `pNext` parameter in vmaBindBufferMemory2() or vmaBindImageMemory2()."]
    VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT = 4,
    #[doc = "Enables usage of VK_EXT_memory_budget extension."]
    #[doc = ""]
    #[doc = "You may set this flag only if you found out that this device extension is supported,"]
    #[doc = "you enabled it while creating Vulkan device passed as VmaAllocatorCreateInfo::device,"]
    #[doc = "and you want it to be used internally by this library, along with another instance extension"]
    #[doc = "VK_KHR_get_physical_device_properties2, which is required by it (or Vulkan 1.1, where this extension is promoted)."]
    #[doc = ""]
    #[doc = "The extension provides query for current memory usage and budget, which will probably"]
    #[doc = "be more accurate than an estimation used by the library otherwise."]
    VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT = 8,
    #[doc = "Enables usage of VK_AMD_device_coherent_memory extension."]
    #[doc = ""]
    #[doc = "You may set this flag only if you:"]
    #[doc = ""]
    #[doc = "- found out that this device extension is supported and enabled it while creating Vulkan device passed as VmaAllocatorCreateInfo::device,"]
    #[doc = "- checked that `VkPhysicalDeviceCoherentMemoryFeaturesAMD::deviceCoherentMemory` is true and set it while creating the Vulkan device,"]
    #[doc = "- want it to be used internally by this library."]
    #[doc = ""]
    #[doc = "The extension and accompanying device feature provide access to memory types with"]
    #[doc = "`VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD` and `VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD` flags."]
    #[doc = "They are useful mostly for writing breadcrumb markers - a common method for debugging GPU crash/hang/TDR."]
    #[doc = ""]
    #[doc = "When the extension is not enabled, such memory types are still enumerated, but their usage is illegal."]
    #[doc = "To protect from this error, if you don't create the allocator with this flag, it will refuse to allocate any memory or create a custom pool in such memory type,"]
    #[doc = "returning `VK_ERROR_FEATURE_NOT_PRESENT`."]
    VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT = 16,
    #[doc = "Enables usage of \"buffer device address\" feature, which allows you to use function"]
    #[doc = "`vkGetBufferDeviceAddress*` to get raw GPU pointer to a buffer and pass it for usage inside a shader."]
    #[doc = ""]
    #[doc = "You may set this flag only if you:"]
    #[doc = ""]
    #[doc = "1. (For Vulkan version < 1.2) Found as available and enabled device extension"]
    #[doc = "VK_KHR_buffer_device_address."]
    #[doc = "This extension is promoted to core Vulkan 1.2."]
    #[doc = "2. Found as available and enabled device feature `VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress`."]
    #[doc = ""]
    #[doc = "When this flag is set, you can create buffers with `VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT` using VMA."]
    #[doc = "The library automatically adds `VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT` to"]
    #[doc = "allocated memory blocks wherever it might be needed."]
    #[doc = ""]
    #[doc = "For more information, see documentation chapter \\ref enabling_buffer_device_address."]
    VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT = 32,
    #[doc = "Enables usage of VK_EXT_memory_priority extension in the library."]
    #[doc = ""]
    #[doc = "You may set this flag only if you found available and enabled this device extension,"]
    #[doc = "along with `VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority == VK_TRUE`,"]
    #[doc = "while creating Vulkan device passed as VmaAllocatorCreateInfo::device."]
    #[doc = ""]
    #[doc = "When this flag is used, VmaAllocationCreateInfo::priority and VmaPoolCreateInfo::priority"]
    #[doc = "are used to set priorities of allocated Vulkan memory. Without it, these variables are ignored."]
    #[doc = ""]
    #[doc = "A priority must be a floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations."]
    #[doc = "Larger values are higher priority. The granularity of the priorities is implementation-dependent."]
    #[doc = "It is automatically passed to every call to `vkAllocateMemory` done by the library using structure `VkMemoryPriorityAllocateInfoEXT`."]
    #[doc = "The value to be used for default priority is 0.5."]
    #[doc = "For more details, see the documentation of the VK_EXT_memory_priority extension."]
    VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT = 64,
    #[doc = "Enables usage of VK_EXT_memory_priority extension in the library."]
    #[doc = ""]
    #[doc = "You may set this flag only if you found available and enabled this device extension,"]
    #[doc = "along with `VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority == VK_TRUE`,"]
    #[doc = "while creating Vulkan device passed as VmaAllocatorCreateInfo::device."]
    #[doc = ""]
    #[doc = "When this flag is used, VmaAllocationCreateInfo::priority and VmaPoolCreateInfo::priority"]
    #[doc = "are used to set priorities of allocated Vulkan memory. Without it, these variables are ignored."]
    #[doc = ""]
    #[doc = "A priority must be a floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations."]
    #[doc = "Larger values are higher priority. The granularity of the priorities is implementation-dependent."]
    #[doc = "It is automatically passed to every call to `vkAllocateMemory` done by the library using structure `VkMemoryPriorityAllocateInfoEXT`."]
    #[doc = "The value to be used for default priority is 0.5."]
    #[doc = "For more details, see the documentation of the VK_EXT_memory_priority extension."]
    VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
#[doc = " See #VmaAllocatorCreateFlagBits."]
pub type VmaAllocatorCreateFlags = Flags;
#[repr(u32)]
#[doc = " \\brief Intended usage of the allocated memory."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaMemoryUsage {
    #[doc = " No intended memory usage specified."]
    #[doc = "Use other members of VmaAllocationCreateInfo to specify your requirements."]
    VMA_MEMORY_USAGE_UNKNOWN = 0,
    #[doc = "\\deprecated Obsolete, preserved for backward compatibility."]
    #[doc = "Prefers `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`."]
    VMA_MEMORY_USAGE_GPU_ONLY = 1,
    #[doc = "\\deprecated Obsolete, preserved for backward compatibility."]
    #[doc = "Guarantees `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` and `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT`."]
    VMA_MEMORY_USAGE_CPU_ONLY = 2,
    #[doc = "\\deprecated Obsolete, preserved for backward compatibility."]
    #[doc = "Guarantees `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`, prefers `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`."]
    VMA_MEMORY_USAGE_CPU_TO_GPU = 3,
    #[doc = "\\deprecated Obsolete, preserved for backward compatibility."]
    #[doc = "Guarantees `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT`, prefers `VK_MEMORY_PROPERTY_HOST_CACHED_BIT`."]
    VMA_MEMORY_USAGE_GPU_TO_CPU = 4,
    #[doc = "\\deprecated Obsolete, preserved for backward compatibility."]
    #[doc = "Prefers not `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`."]
    VMA_MEMORY_USAGE_CPU_COPY = 5,
    #[doc = "Lazily allocated GPU memory having `VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT`."]
    #[doc = "Exists mostly on mobile platforms. Using it on desktop PC or other GPUs with no such memory type present will fail the allocation."]
    #[doc = ""]
    #[doc = "Usage: Memory for transient attachment images (color attachments, depth attachments etc.), created with `VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT`."]
    #[doc = ""]
    #[doc = "Allocations with this usage are always created as dedicated - it implies #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT."]
    VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED = 6,
    #[doc = "Selects best memory type automatically."]
    #[doc = "This flag is recommended for most common use cases."]
    #[doc = ""]
    #[doc = "When using this flag, if you want to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT),"]
    #[doc = "you must pass one of the flags: #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT"]
    #[doc = "in VmaAllocationCreateInfo::flags."]
    #[doc = ""]
    #[doc = "It can be used only with functions that let the library know `VkBufferCreateInfo` or `VkImageCreateInfo`, e.g."]
    #[doc = "vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo()"]
    #[doc = "and not with generic memory allocation functions."]
    VMA_MEMORY_USAGE_AUTO = 7,
    #[doc = "Selects best memory type automatically with preference for GPU (device) memory."]
    #[doc = ""]
    #[doc = "When using this flag, if you want to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT),"]
    #[doc = "you must pass one of the flags: #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT"]
    #[doc = "in VmaAllocationCreateInfo::flags."]
    #[doc = ""]
    #[doc = "It can be used only with functions that let the library know `VkBufferCreateInfo` or `VkImageCreateInfo`, e.g."]
    #[doc = "vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo()"]
    #[doc = "and not with generic memory allocation functions."]
    VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE = 8,
    #[doc = "Selects best memory type automatically with preference for CPU (host) memory."]
    #[doc = ""]
    #[doc = "When using this flag, if you want to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT),"]
    #[doc = "you must pass one of the flags: #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT"]
    #[doc = "in VmaAllocationCreateInfo::flags."]
    #[doc = ""]
    #[doc = "It can be used only with functions that let the library know `VkBufferCreateInfo` or `VkImageCreateInfo`, e.g."]
    #[doc = "vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo()"]
    #[doc = "and not with generic memory allocation functions."]
    VMA_MEMORY_USAGE_AUTO_PREFER_HOST = 9,
    #[doc = "Selects best memory type automatically with preference for CPU (host) memory."]
    #[doc = ""]
    #[doc = "When using this flag, if you want to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT),"]
    #[doc = "you must pass one of the flags: #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT"]
    #[doc = "in VmaAllocationCreateInfo::flags."]
    #[doc = ""]
    #[doc = "It can be used only with functions that let the library know `VkBufferCreateInfo` or `VkImageCreateInfo`, e.g."]
    #[doc = "vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo()"]
    #[doc = "and not with generic memory allocation functions."]
    VMA_MEMORY_USAGE_MAX_ENUM = 2147483647,
}
impl VmaAllocationCreateFlagBits {
    pub const VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT: VmaAllocationCreateFlagBits =
        VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT;
}
impl VmaAllocationCreateFlagBits {
    pub const VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT: VmaAllocationCreateFlagBits =
        VmaAllocationCreateFlagBits::VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT;
}
#[repr(u32)]
#[doc = " Flags to be passed as VmaAllocationCreateInfo::flags."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaAllocationCreateFlagBits {
    #[doc = " \\brief Set this flag if the allocation should have its own memory block."]
    #[doc = ""]
    #[doc = "Use it for special, big resources, like fullscreen images used as attachments."]
    VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 1,
    #[doc = " \\brief Set this flag to only try to allocate from existing `VkDeviceMemory` blocks and never create new such block."]
    #[doc = ""]
    #[doc = "If new allocation cannot be placed in any of the existing blocks, allocation"]
    #[doc = "fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY` error."]
    #[doc = ""]
    #[doc = "You should not use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT and"]
    #[doc = "#VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT at the same time. It makes no sense."]
    VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 2,
    #[doc = " \\brief Set this flag to use a memory that will be persistently mapped and retrieve pointer to it."]
    #[doc = ""]
    #[doc = "Pointer to mapped memory will be returned through VmaAllocationInfo::pMappedData."]
    #[doc = ""]
    #[doc = "It is valid to use this flag for allocation made from memory type that is not"]
    #[doc = "`HOST_VISIBLE`. This flag is then ignored and memory is not mapped. This is"]
    #[doc = "useful if you need an allocation that is efficient to use on GPU"]
    #[doc = "(`DEVICE_LOCAL`) and still want to map it directly if possible on platforms that"]
    #[doc = "support it (e.g. Intel GPU)."]
    VMA_ALLOCATION_CREATE_MAPPED_BIT = 4,
    #[doc = " \\deprecated Preserved for backward compatibility. Consider using vmaSetAllocationName() instead."]
    #[doc = ""]
    #[doc = "Set this flag to treat VmaAllocationCreateInfo::pUserData as pointer to a"]
    #[doc = "null-terminated string. Instead of copying pointer value, a local copy of the"]
    #[doc = "string is made and stored in allocation's `pName`. The string is automatically"]
    #[doc = "freed together with the allocation. It is also used in vmaBuildStatsString()."]
    VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 32,
    #[doc = " Allocation will be created from upper stack in a double stack pool."]
    #[doc = ""]
    #[doc = "This flag is only allowed for custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT flag."]
    VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 64,
    #[doc = " Create both buffer/image and allocation, but don't bind them together."]
    #[doc = "It is useful when you want to bind yourself to do some more advanced binding, e.g. using some extensions."]
    #[doc = "The flag is meaningful only with functions that bind by default: vmaCreateBuffer(), vmaCreateImage()."]
    #[doc = "Otherwise it is ignored."]
    #[doc = ""]
    #[doc = "If you want to make sure the new buffer/image is not tied to the new memory allocation"]
    #[doc = "through `VkMemoryDedicatedAllocateInfoKHR` structure in case the allocation ends up in its own memory block,"]
    #[doc = "use also flag #VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT."]
    VMA_ALLOCATION_CREATE_DONT_BIND_BIT = 128,
    #[doc = " Create allocation only if additional device memory required for it, if any, won't exceed"]
    #[doc = "memory budget. Otherwise return `VK_ERROR_OUT_OF_DEVICE_MEMORY`."]
    VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT = 256,
    #[doc = " \\brief Set this flag if the allocated memory will have aliasing resources."]
    #[doc = ""]
    #[doc = "Usage of this flag prevents supplying `VkMemoryDedicatedAllocateInfoKHR` when #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is specified."]
    #[doc = "Otherwise created dedicated memory will not be suitable for aliasing resources, resulting in Vulkan Validation Layer errors."]
    VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT = 512,
    #[doc = "Requests possibility to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT)."]
    #[doc = ""]
    #[doc = "- If you use #VMA_MEMORY_USAGE_AUTO or other `VMA_MEMORY_USAGE_AUTO*` value,"]
    #[doc = "you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect."]
    #[doc = "- If you use other value of #VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are `HOST_VISIBLE`."]
    #[doc = "This includes allocations created in \\ref custom_memory_pools."]
    #[doc = ""]
    #[doc = "Declares that mapped memory will only be written sequentially, e.g. using `memcpy()` or a loop writing number-by-number,"]
    #[doc = "never read or accessed randomly, so a memory type can be selected that is uncached and write-combined."]
    #[doc = ""]
    #[doc = "\\warning Violating this declaration may work correctly, but will likely be very slow."]
    #[doc = "Watch out for implicit reads introduced by doing e.g. `pMappedData[i] += x;`"]
    #[doc = "Better prepare your data in a local variable and `memcpy()` it to the mapped pointer all at once."]
    VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT = 1024,
    #[doc = "Requests possibility to map the allocation (using vmaMapMemory() or #VMA_ALLOCATION_CREATE_MAPPED_BIT)."]
    #[doc = ""]
    #[doc = "- If you use #VMA_MEMORY_USAGE_AUTO or other `VMA_MEMORY_USAGE_AUTO*` value,"]
    #[doc = "you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect."]
    #[doc = "- If you use other value of #VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are `HOST_VISIBLE`."]
    #[doc = "This includes allocations created in \\ref custom_memory_pools."]
    #[doc = ""]
    #[doc = "Declares that mapped memory can be read, written, and accessed in random order,"]
    #[doc = "so a `HOST_CACHED` memory type is required."]
    VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT = 2048,
    #[doc = "Together with #VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or #VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,"]
    #[doc = "it says that despite request for host access, a not-`HOST_VISIBLE` memory type can be selected"]
    #[doc = "if it may improve performance."]
    #[doc = ""]
    #[doc = "By using this flag, you declare that you will check if the allocation ended up in a `HOST_VISIBLE` memory type"]
    #[doc = "(e.g. using vmaGetAllocationMemoryProperties()) and if not, you will create some \"staging\" buffer and"]
    #[doc = "issue an explicit transfer to write/read your data."]
    #[doc = "To prepare for this possibility, don't forget to add appropriate flags like"]
    #[doc = "`VK_BUFFER_USAGE_TRANSFER_DST_BIT`, `VK_BUFFER_USAGE_TRANSFER_SRC_BIT` to the parameters of created buffer or image."]
    VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT = 4096,
    #[doc = " Allocation strategy that chooses smallest possible free range for the allocation"]
    #[doc = "to minimize memory usage and fragmentation, possibly at the expense of allocation time."]
    VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = 65536,
    #[doc = " Allocation strategy that chooses first suitable free range for the allocation -"]
    #[doc = "not necessarily in terms of the smallest offset but the one that is easiest and fastest to find"]
    #[doc = "to minimize allocation time, possibly at the expense of allocation quality."]
    VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = 131072,
    #[doc = " Allocation strategy that chooses always the lowest offset in available space."]
    #[doc = "This is not the most efficient strategy but achieves highly packed data."]
    #[doc = "Used internally by defragmentation, not recommended in typical usage."]
    VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT = 262144,
    #[doc = " A bit mask to extract only `STRATEGY` bits from entire set of flags."]
    VMA_ALLOCATION_CREATE_STRATEGY_MASK = 458752,
    #[doc = " A bit mask to extract only `STRATEGY` bits from entire set of flags."]
    VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
#[doc = " See #VmaAllocationCreateFlagBits."]
pub type VmaAllocationCreateFlags = Flags;
impl VmaPoolCreateFlagBits {
    pub const VMA_POOL_CREATE_ALGORITHM_MASK: VmaPoolCreateFlagBits =
        VmaPoolCreateFlagBits::VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT;
}
#[repr(u32)]
#[doc = " Flags to be passed as VmaPoolCreateInfo::flags."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaPoolCreateFlagBits {
    #[doc = " \\brief Use this flag if you always allocate only buffers and linear images or only optimal images out of this pool and so Buffer-Image Granularity can be ignored."]
    #[doc = ""]
    #[doc = "This is an optional optimization flag."]
    #[doc = ""]
    #[doc = "If you always allocate using vmaCreateBuffer(), vmaCreateImage(),"]
    #[doc = "vmaAllocateMemoryForBuffer(), then you don't need to use it because allocator"]
    #[doc = "knows exact type of your allocations so it can handle Buffer-Image Granularity"]
    #[doc = "in the optimal way."]
    #[doc = ""]
    #[doc = "If you also allocate using vmaAllocateMemoryForImage() or vmaAllocateMemory(),"]
    #[doc = "exact type of such allocations is not known, so allocator must be conservative"]
    #[doc = "in handling Buffer-Image Granularity, which can lead to suboptimal allocation"]
    #[doc = "(wasted memory). In that case, if you can make sure you always allocate only"]
    #[doc = "buffers and linear images or only optimal images out of this pool, use this flag"]
    #[doc = "to make allocator disregard Buffer-Image Granularity and so make allocations"]
    #[doc = "faster and more optimal."]
    VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 2,
    #[doc = " \\brief Enables alternative, linear allocation algorithm in this pool."]
    #[doc = ""]
    #[doc = "Specify this flag to enable linear allocation algorithm, which always creates"]
    #[doc = "new allocations after last one and doesn't reuse space from allocations freed in"]
    #[doc = "between. It trades memory consumption for simplified algorithm and data"]
    #[doc = "structure, which has better performance and uses less memory for metadata."]
    #[doc = ""]
    #[doc = "By using this flag, you can achieve behavior of free-at-once, stack,"]
    #[doc = "ring buffer, and double stack."]
    #[doc = "For details, see documentation chapter \\ref linear_algorithm."]
    VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 4,
    #[doc = " Bit mask to extract only `ALGORITHM` bits from entire set of flags."]
    VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
#[doc = " Flags to be passed as VmaPoolCreateInfo::flags. See #VmaPoolCreateFlagBits."]
pub type VmaPoolCreateFlags = Flags;
#[repr(u32)]
#[doc = " Flags to be passed as VmaDefragmentationInfo::flags."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaDefragmentationFlagBits {
    VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT = 1,
    VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT = 2,
    VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT = 4,
    #[doc = " \\brief Use the most roboust algorithm at the cost of time to compute and number of copies to make."]
    #[doc = "Only available when bufferImageGranularity is greater than 1, since it aims to reduce"]
    #[doc = "alignment issues between different types of resources."]
    #[doc = "Otherwise falls back to same behavior as #VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT."]
    VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT = 8,
    #[doc = " A bit mask to extract only `ALGORITHM` bits from entire set of flags."]
    VMA_DEFRAGMENTATION_FLAG_ALGORITHM_MASK = 15,
    #[doc = " A bit mask to extract only `ALGORITHM` bits from entire set of flags."]
    VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM = 2147483647,
}
#[doc = " See #VmaDefragmentationFlagBits."]
pub type VmaDefragmentationFlags = Flags;
#[repr(u32)]
#[doc = " Operation performed on single defragmentation move. See structure #VmaDefragmentationMove."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaDefragmentationMoveOperation {
    #[doc = " Buffer/image has been recreated at `dstTmpAllocation`, data has been copied, old buffer/image has been destroyed. `srcAllocation` should be changed to point to the new place. This is the default value set by vmaBeginDefragmentationPass()."]
    VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY = 0,
    #[doc = " Set this value if you cannot move the allocation. New place reserved at `dstTmpAllocation` will be freed. `srcAllocation` will remain unchanged."]
    VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE = 1,
    #[doc = " Set this value if you decide to abandon the allocation and you destroyed the buffer/image. New place reserved at `dstTmpAllocation` will be freed, along with `srcAllocation`, which will be destroyed."]
    VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY = 2,
}
impl VmaVirtualBlockCreateFlagBits {
    pub const VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK: VmaVirtualBlockCreateFlagBits =
        VmaVirtualBlockCreateFlagBits::VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT;
}
#[repr(u32)]
#[doc = " Flags to be passed as VmaVirtualBlockCreateInfo::flags."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaVirtualBlockCreateFlagBits {
    #[doc = " \\brief Enables alternative, linear allocation algorithm in this virtual block."]
    #[doc = ""]
    #[doc = "Specify this flag to enable linear allocation algorithm, which always creates"]
    #[doc = "new allocations after last one and doesn't reuse space from allocations freed in"]
    #[doc = "between. It trades memory consumption for simplified algorithm and data"]
    #[doc = "structure, which has better performance and uses less memory for metadata."]
    #[doc = ""]
    #[doc = "By using this flag, you can achieve behavior of free-at-once, stack,"]
    #[doc = "ring buffer, and double stack."]
    #[doc = "For details, see documentation chapter \\ref linear_algorithm."]
    VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 1,
    #[doc = " \\brief Bit mask to extract only `ALGORITHM` bits from entire set of flags."]
    VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
#[doc = " Flags to be passed as VmaVirtualBlockCreateInfo::flags. See #VmaVirtualBlockCreateFlagBits."]
pub type VmaVirtualBlockCreateFlags = Flags;
#[repr(u32)]
#[doc = " Flags to be passed as VmaVirtualAllocationCreateInfo::flags."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum VmaVirtualAllocationCreateFlagBits {
    #[doc = " \\brief Allocation will be created from upper stack in a double stack pool."]
    #[doc = ""]
    #[doc = "This flag is only allowed for virtual blocks created with #VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT flag."]
    VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 64,
    #[doc = " \\brief Allocation strategy that tries to minimize memory usage."]
    VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = 65536,
    #[doc = " \\brief Allocation strategy that tries to minimize allocation time."]
    VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = 131072,
    #[doc = " Allocation strategy that chooses always the lowest offset in available space."]
    #[doc = "This is not the most efficient strategy but achieves highly packed data."]
    VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT = 262144,
    #[doc = " \\brief A bit mask to extract only `STRATEGY` bits from entire set of flags."]
    #[doc = ""]
    #[doc = "These strategy flags are binary compatible with equivalent flags in #VmaAllocationCreateFlagBits."]
    VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK = 458752,
    #[doc = " \\brief A bit mask to extract only `STRATEGY` bits from entire set of flags."]
    #[doc = ""]
    #[doc = "These strategy flags are binary compatible with equivalent flags in #VmaAllocationCreateFlagBits."]
    VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 2147483647,
}
#[doc = " Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See #VmaVirtualAllocationCreateFlagBits."]
pub type VmaVirtualAllocationCreateFlags = Flags;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocator_T {
    _unused: [u8; 0],
}
pub type VmaAllocator = *mut VmaAllocator_T;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaPool_T {
    _unused: [u8; 0],
}
pub type VmaPool = *mut VmaPool_T;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocation_T {
    _unused: [u8; 0],
}
pub type VmaAllocation = *mut VmaAllocation_T;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationContext_T {
    _unused: [u8; 0],
}
pub type VmaDefragmentationContext = *mut VmaDefragmentationContext_T;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaVirtualAllocation_T {
    _unused: [u8; 0],
}
pub type VmaVirtualAllocation = *mut VmaVirtualAllocation_T;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaVirtualBlock_T {
    _unused: [u8; 0],
}
pub type VmaVirtualBlock = *mut VmaVirtualBlock_T;
#[doc = " Callback function called after successful vkAllocateMemory."]
pub type PFN_vmaAllocateDeviceMemoryFunction = ::std::option::Option<
    unsafe extern "C" fn(
        allocator: VmaAllocator,
        memoryType: u32,
        memory: DeviceMemory,
        size: DeviceSize,
        pUserData: *mut ::std::os::raw::c_void,
    ),
>;
#[doc = " Callback function called before vkFreeMemory."]
pub type PFN_vmaFreeDeviceMemoryFunction = ::std::option::Option<
    unsafe extern "C" fn(
        allocator: VmaAllocator,
        memoryType: u32,
        memory: DeviceMemory,
        size: DeviceSize,
        pUserData: *mut ::std::os::raw::c_void,
    ),
>;
#[doc = " \\brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`."]
#[doc = ""]
#[doc = "Provided for informative purpose, e.g. to gather statistics about number of"]
#[doc = "allocations or total amount of memory allocated in Vulkan."]
#[doc = ""]
#[doc = "Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDeviceMemoryCallbacks {
    #[doc = " Optional, can be null."]
    pub pfnAllocate: PFN_vmaAllocateDeviceMemoryFunction,
    #[doc = " Optional, can be null."]
    pub pfnFree: PFN_vmaFreeDeviceMemoryFunction,
    #[doc = " Optional, can be null."]
    pub pUserData: *mut ::std::os::raw::c_void,
}
#[doc = " \\brief Pointers to some Vulkan functions - a subset used by the library."]
#[doc = ""]
#[doc = "Used in VmaAllocatorCreateInfo::pVulkanFunctions."]
#[repr(C)]
pub struct VmaVulkanFunctions {
    #[doc = " Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS."]
    pub vkGetInstanceProcAddr: PFN_vkGetInstanceProcAddr,
    #[doc = " Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS."]
    pub vkGetDeviceProcAddr: PFN_vkGetDeviceProcAddr,
    pub vkGetPhysicalDeviceProperties: PFN_vkGetPhysicalDeviceProperties,
    pub vkGetPhysicalDeviceMemoryProperties: PFN_vkGetPhysicalDeviceMemoryProperties,
    pub vkAllocateMemory: PFN_vkAllocateMemory,
    pub vkFreeMemory: PFN_vkFreeMemory,
    pub vkMapMemory: PFN_vkMapMemory,
    pub vkUnmapMemory: PFN_vkUnmapMemory,
    pub vkFlushMappedMemoryRanges: PFN_vkFlushMappedMemoryRanges,
    pub vkInvalidateMappedMemoryRanges: PFN_vkInvalidateMappedMemoryRanges,
    pub vkBindBufferMemory: PFN_vkBindBufferMemory,
    pub vkBindImageMemory: PFN_vkBindImageMemory,
    pub vkGetBufferMemoryRequirements: PFN_vkGetBufferMemoryRequirements,
    pub vkGetImageMemoryRequirements: PFN_vkGetImageMemoryRequirements,
    pub vkCreateBuffer: PFN_vkCreateBuffer,
    pub vkDestroyBuffer: PFN_vkDestroyBuffer,
    pub vkCreateImage: PFN_vkCreateImage,
    pub vkDestroyImage: PFN_vkDestroyImage,
    pub vkCmdCopyBuffer: PFN_vkCmdCopyBuffer,
    #[doc = " Fetch \"vkGetBufferMemoryRequirements2\" on Vulkan >= 1.1, fetch \"vkGetBufferMemoryRequirements2KHR\" when using VK_KHR_dedicated_allocation extension."]
    pub vkGetBufferMemoryRequirements2KHR: PFN_vkGetBufferMemoryRequirements2,
    #[doc = " Fetch \"vkGetImageMemoryRequirements2\" on Vulkan >= 1.1, fetch \"vkGetImageMemoryRequirements2KHR\" when using VK_KHR_dedicated_allocation extension."]
    pub vkGetImageMemoryRequirements2KHR: PFN_vkGetImageMemoryRequirements2,
    #[doc = " Fetch \"vkBindBufferMemory2\" on Vulkan >= 1.1, fetch \"vkBindBufferMemory2KHR\" when using VK_KHR_bind_memory2 extension."]
    pub vkBindBufferMemory2KHR: PFN_vkBindBufferMemory2,
    #[doc = " Fetch \"vkBindImageMemory2\" on Vulkan >= 1.1, fetch \"vkBindImageMemory2KHR\" when using VK_KHR_bind_memory2 extension."]
    pub vkBindImageMemory2KHR: PFN_vkBindImageMemory2,
    pub vkGetPhysicalDeviceMemoryProperties2KHR: PFN_vkGetPhysicalDeviceMemoryProperties2,
    #[doc = " Fetch from \"vkGetDeviceBufferMemoryRequirements\" on Vulkan >= 1.3, but you can also fetch it from \"vkGetDeviceBufferMemoryRequirementsKHR\" if you enabled extension VK_KHR_maintenance4."]
    pub vkGetDeviceBufferMemoryRequirements: PFN_vkGetDeviceBufferMemoryRequirements,
    #[doc = " Fetch from \"vkGetDeviceImageMemoryRequirements\" on Vulkan >= 1.3, but you can also fetch it from \"vkGetDeviceImageMemoryRequirementsKHR\" if you enabled extension VK_KHR_maintenance4."]
    pub vkGetDeviceImageMemoryRequirements: PFN_vkGetDeviceImageMemoryRequirements,
}
#[doc = " Description of a Allocator to be created."]
#[repr(C)]
pub struct VmaAllocatorCreateInfo {
    #[doc = " Flags for created allocator. Use #VmaAllocatorCreateFlagBits enum."]
    pub flags: VmaAllocatorCreateFlags,
    #[doc = " Vulkan physical device."]
    #[doc = "** It must be valid throughout whole lifetime of created allocator. */"]
    pub physicalDevice: PhysicalDevice,
    #[doc = " Vulkan device."]
    #[doc = "** It must be valid throughout whole lifetime of created allocator. */"]
    pub device: Device,
    #[doc = " Preferred size of a single `VkDeviceMemory` block to be allocated from large heaps > 1 GiB. Optional."]
    #[doc = "** Set to 0 to use default, which is currently 256 MiB. */"]
    pub preferredLargeHeapBlockSize: DeviceSize,
    #[doc = " Custom CPU memory allocation callbacks. Optional."]
    #[doc = "** Optional, can be null. When specified, will also be used for all CPU-side memory allocations. */"]
    pub pAllocationCallbacks: *const AllocationCallbacks,
    #[doc = " Informative callbacks for `vkAllocateMemory`, `vkFreeMemory`. Optional."]
    #[doc = "** Optional, can be null. */"]
    pub pDeviceMemoryCallbacks: *const VmaDeviceMemoryCallbacks,
    #[doc = " \\brief Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap."]
    #[doc = ""]
    #[doc = "If not NULL, it must be a pointer to an array of"]
    #[doc = "`VkPhysicalDeviceMemoryProperties::memoryHeapCount` elements, defining limit on"]
    #[doc = "maximum number of bytes that can be allocated out of particular Vulkan memory"]
    #[doc = "heap."]
    #[doc = ""]
    #[doc = "Any of the elements may be equal to `VK_WHOLE_SIZE`, which means no limit on that"]
    #[doc = "heap. This is also the default in case of `pHeapSizeLimit` = NULL."]
    #[doc = ""]
    #[doc = "If there is a limit defined for a heap:"]
    #[doc = ""]
    #[doc = "- If user tries to allocate more memory from that heap using this allocator,"]
    #[doc = "the allocation fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY`."]
    #[doc = "- If the limit is smaller than heap size reported in `VkMemoryHeap::size`, the"]
    #[doc = "value of this limit will be reported instead when using vmaGetMemoryProperties()."]
    #[doc = ""]
    #[doc = "Warning! Using this feature may not be equivalent to installing a GPU with"]
    #[doc = "smaller amount of memory, because graphics driver doesn't necessary fail new"]
    #[doc = "allocations with `VK_ERROR_OUT_OF_DEVICE_MEMORY` result when memory capacity is"]
    #[doc = "exceeded. It may return success and just silently migrate some device memory"]
    #[doc = "blocks to system RAM. This driver behavior can also be controlled using"]
    #[doc = "VK_AMD_memory_overallocation_behavior extension."]
    pub pHeapSizeLimit: *const DeviceSize,
    #[doc = " \\brief Pointers to Vulkan functions. Can be null."]
    #[doc = ""]
    #[doc = "For details see [Pointers to Vulkan functions](@ref config_Vulkan_functions)."]
    pub pVulkanFunctions: *const VmaVulkanFunctions,
    #[doc = " \\brief Handle to Vulkan instance object."]
    #[doc = ""]
    #[doc = "Starting from version 3.0.0 this member is no longer optional, it must be set!"]
    pub instance: Instance,
    #[doc = " \\brief Optional. The highest version of Vulkan that the application is designed to use."]
    #[doc = ""]
    #[doc = "It must be a value in the format as created by macro `VK_MAKE_VERSION` or a constant like: `VK_API_VERSION_1_1`, `VK_API_VERSION_1_0`."]
    #[doc = "The patch version number specified is ignored. Only the major and minor versions are considered."]
    #[doc = "It must be less or equal (preferably equal) to value as passed to `vkCreateInstance` as `VkApplicationInfo::apiVersion`."]
    #[doc = "Only versions 1.0, 1.1, 1.2, 1.3 are supported by the current implementation."]
    #[doc = "Leaving it initialized to zero is equivalent to `VK_API_VERSION_1_0`."]
    pub vulkanApiVersion: u32,
    #[doc = " \\brief Either null or a pointer to an array of external memory handle types for each Vulkan memory type."]
    #[doc = ""]
    #[doc = "If not NULL, it must be a pointer to an array of `VkPhysicalDeviceMemoryProperties::memoryTypeCount`"]
    #[doc = "elements, defining external memory handle types of particular Vulkan memory type,"]
    #[doc = "to be passed using `VkExportMemoryAllocateInfoKHR`."]
    #[doc = ""]
    #[doc = "Any of the elements may be equal to 0, which means not to use `VkExportMemoryAllocateInfoKHR` on this memory type."]
    #[doc = "This is also the default in case of `pTypeExternalMemoryHandleTypes` = NULL."]
    pub pTypeExternalMemoryHandleTypes: *const ExternalMemoryHandleTypeFlagsKHR,
}
#[doc = " Information about existing #VmaAllocator object."]
#[repr(C)]
pub struct VmaAllocatorInfo {
    #[doc = " \\brief Handle to Vulkan instance object."]
    #[doc = ""]
    #[doc = "This is the same value as has been passed through VmaAllocatorCreateInfo::instance."]
    pub instance: Instance,
    #[doc = " \\brief Handle to Vulkan physical device object."]
    #[doc = ""]
    #[doc = "This is the same value as has been passed through VmaAllocatorCreateInfo::physicalDevice."]
    pub physicalDevice: PhysicalDevice,
    #[doc = " \\brief Handle to Vulkan device object."]
    #[doc = ""]
    #[doc = "This is the same value as has been passed through VmaAllocatorCreateInfo::device."]
    pub device: Device,
}
#[doc = " \\brief Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total."]
#[doc = ""]
#[doc = "These are fast to calculate."]
#[doc = "See functions: vmaGetHeapBudgets(), vmaGetPoolStatistics()."]
#[repr(C)]
pub struct VmaStatistics {
    #[doc = " \\brief Number of `VkDeviceMemory` objects - Vulkan memory blocks allocated."]
    pub blockCount: u32,
    #[doc = " \\brief Number of #VmaAllocation objects allocated."]
    #[doc = ""]
    #[doc = "Dedicated allocations have their own blocks, so each one adds 1 to `allocationCount` as well as `blockCount`."]
    pub allocationCount: u32,
    #[doc = " \\brief Number of bytes allocated in `VkDeviceMemory` blocks."]
    #[doc = ""]
    #[doc = "\\note To avoid confusion, please be aware that what Vulkan calls an \"allocation\" - a whole `VkDeviceMemory` object"]
    #[doc = "(e.g. as in `VkPhysicalDeviceLimits::maxMemoryAllocationCount`) is called a \"block\" in VMA, while VMA calls"]
    #[doc = "\"allocation\" a #VmaAllocation object that represents a memory region sub-allocated from such block, usually for a single buffer or image."]
    pub blockBytes: DeviceSize,
    #[doc = " \\brief Total number of bytes occupied by all #VmaAllocation objects."]
    #[doc = ""]
    #[doc = "Always less or equal than `blockBytes`."]
    #[doc = "Difference `(blockBytes - allocationBytes)` is the amount of memory allocated from Vulkan"]
    #[doc = "but unused by any #VmaAllocation."]
    pub allocationBytes: DeviceSize,
}
#[doc = " \\brief More detailed statistics than #VmaStatistics."]
#[doc = ""]
#[doc = "These are slower to calculate. Use for debugging purposes."]
#[doc = "See functions: vmaCalculateStatistics(), vmaCalculatePoolStatistics()."]
#[doc = ""]
#[doc = "Previous version of the statistics API provided averages, but they have been removed"]
#[doc = "because they can be easily calculated as:"]
#[doc = ""]
#[doc = "\\code"]
#[doc = "VkDeviceSize allocationSizeAvg = detailedStats.statistics.allocationBytes / detailedStats.statistics.allocationCount;"]
#[doc = "VkDeviceSize unusedBytes = detailedStats.statistics.blockBytes - detailedStats.statistics.allocationBytes;"]
#[doc = "VkDeviceSize unusedRangeSizeAvg = unusedBytes / detailedStats.unusedRangeCount;"]
#[doc = "\\endcode"]
#[repr(C)]
pub struct VmaDetailedStatistics {
    #[doc = " Basic statistics."]
    pub statistics: VmaStatistics,
    #[doc = " Number of free ranges of memory between allocations."]
    pub unusedRangeCount: u32,
    #[doc = " Smallest allocation size. `VK_WHOLE_SIZE` if there are 0 allocations."]
    pub allocationSizeMin: DeviceSize,
    #[doc = " Largest allocation size. 0 if there are 0 allocations."]
    pub allocationSizeMax: DeviceSize,
    #[doc = " Smallest empty range size. `VK_WHOLE_SIZE` if there are 0 empty ranges."]
    pub unusedRangeSizeMin: DeviceSize,
    #[doc = " Largest empty range size. 0 if there are 0 empty ranges."]
    pub unusedRangeSizeMax: DeviceSize,
}
#[doc = " \\brief  General statistics from current state of the Allocator -"]
#[doc = "total memory usage across all memory heaps and types."]
#[doc = ""]
#[doc = "These are slower to calculate. Use for debugging purposes."]
#[doc = "See function vmaCalculateStatistics()."]
#[repr(C)]
pub struct VmaTotalStatistics {
    pub memoryType: [VmaDetailedStatistics; 32usize],
    pub memoryHeap: [VmaDetailedStatistics; 16usize],
    pub total: VmaDetailedStatistics,
}
#[doc = " \\brief Statistics of current memory usage and available budget for a specific memory heap."]
#[doc = ""]
#[doc = "These are fast to calculate."]
#[doc = "See function vmaGetHeapBudgets()."]
#[repr(C)]
pub struct VmaBudget {
    #[doc = " \\brief Statistics fetched from the library."]
    pub statistics: VmaStatistics,
    #[doc = " \\brief Estimated current memory usage of the program, in bytes."]
    #[doc = ""]
    #[doc = "Fetched from system using VK_EXT_memory_budget extension if enabled."]
    #[doc = ""]
    #[doc = "It might be different than `statistics.blockBytes` (usually higher) due to additional implicit objects"]
    #[doc = "also occupying the memory, like swapchain, pipelines, descriptor heaps, command buffers, or"]
    #[doc = "`VkDeviceMemory` blocks allocated outside of this library, if any."]
    pub usage: DeviceSize,
    #[doc = " \\brief Estimated amount of memory available to the program, in bytes."]
    #[doc = ""]
    #[doc = "Fetched from system using VK_EXT_memory_budget extension if enabled."]
    #[doc = ""]
    #[doc = "It might be different (most probably smaller) than `VkMemoryHeap::size[heapIndex]` due to factors"]
    #[doc = "external to the program, decided by the operating system."]
    #[doc = "Difference `budget - usage` is the amount of additional memory that can probably"]
    #[doc = "be allocated without problems. Exceeding the budget may result in various problems."]
    pub budget: DeviceSize,
}
#[doc = " \\brief Parameters of new #VmaAllocation."]
#[doc = ""]
#[doc = "To be used with functions like vmaCreateBuffer(), vmaCreateImage(), and many others."]
#[repr(C)]
pub struct VmaAllocationCreateInfo {
    #[doc = " Use #VmaAllocationCreateFlagBits enum."]
    pub flags: VmaAllocationCreateFlags,
    #[doc = " \\brief Intended usage of memory."]
    #[doc = ""]
    #[doc = "You can leave #VMA_MEMORY_USAGE_UNKNOWN if you specify memory requirements in other way. \\n"]
    #[doc = "If `pool` is not null, this member is ignored."]
    pub usage: VmaMemoryUsage,
    #[doc = " \\brief Flags that must be set in a Memory Type chosen for an allocation."]
    #[doc = ""]
    #[doc = "Leave 0 if you specify memory requirements in other way. \\n"]
    #[doc = "If `pool` is not null, this member is ignored."]
    pub requiredFlags: MemoryPropertyFlags,
    #[doc = " \\brief Flags that preferably should be set in a memory type chosen for an allocation."]
    #[doc = ""]
    #[doc = "Set to 0 if no additional flags are preferred. \\n"]
    #[doc = "If `pool` is not null, this member is ignored."]
    pub preferredFlags: MemoryPropertyFlags,
    #[doc = " \\brief Bitmask containing one bit set for every memory type acceptable for this allocation."]
    #[doc = ""]
    #[doc = "Value 0 is equivalent to `UINT32_MAX` - it means any memory type is accepted if"]
    #[doc = "it meets other requirements specified by this structure, with no further"]
    #[doc = "restrictions on memory type index. \\n"]
    #[doc = "If `pool` is not null, this member is ignored."]
    pub memoryTypeBits: u32,
    #[doc = " \\brief Pool that this allocation should be created in."]
    #[doc = ""]
    #[doc = "Leave `VK_NULL_HANDLE` to allocate from default pool. If not null, members:"]
    #[doc = "`usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits` are ignored."]
    pub pool: VmaPool,
    #[doc = " \\brief Custom general-purpose pointer that will be stored in #VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData()."]
    #[doc = ""]
    #[doc = "If #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is used, it must be either"]
    #[doc = "null or pointer to a null-terminated string. The string will be then copied to"]
    #[doc = "internal buffer, so it doesn't need to be valid after allocation call."]
    pub pUserData: *mut ::std::os::raw::c_void,
    #[doc = " \\brief A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations."]
    #[doc = ""]
    #[doc = "It is used only when #VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT flag was used during creation of the #VmaAllocator object"]
    #[doc = "and this allocation ends up as dedicated or is explicitly forced as dedicated using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT."]
    #[doc = "Otherwise, it has the priority of a memory block where it is placed and this variable is ignored."]
    pub priority: f32,
}
#[doc = " Describes parameter of created #VmaPool."]
#[repr(C)]
pub struct VmaPoolCreateInfo {
    #[doc = " \\brief Vulkan memory type index to allocate this pool from."]
    pub memoryTypeIndex: u32,
    #[doc = " \\brief Use combination of #VmaPoolCreateFlagBits."]
    pub flags: VmaPoolCreateFlags,
    #[doc = " \\brief Size of a single `VkDeviceMemory` block to be allocated as part of this pool, in bytes. Optional."]
    #[doc = ""]
    #[doc = "Specify nonzero to set explicit, constant size of memory blocks used by this"]
    #[doc = "pool."]
    #[doc = ""]
    #[doc = "Leave 0 to use default and let the library manage block sizes automatically."]
    #[doc = "Sizes of particular blocks may vary."]
    #[doc = "In this case, the pool will also support dedicated allocations."]
    pub blockSize: DeviceSize,
    #[doc = " \\brief Minimum number of blocks to be always allocated in this pool, even if they stay empty."]
    #[doc = ""]
    #[doc = "Set to 0 to have no preallocated blocks and allow the pool be completely empty."]
    pub minBlockCount: usize,
    #[doc = " \\brief Maximum number of blocks that can be allocated in this pool. Optional."]
    #[doc = ""]
    #[doc = "Set to 0 to use default, which is `SIZE_MAX`, which means no limit."]
    #[doc = ""]
    #[doc = "Set to same value as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated"]
    #[doc = "throughout whole lifetime of this pool."]
    pub maxBlockCount: usize,
    #[doc = " \\brief A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations."]
    #[doc = ""]
    #[doc = "It is used only when #VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT flag was used during creation of the #VmaAllocator object."]
    #[doc = "Otherwise, this variable is ignored."]
    pub priority: f32,
    #[doc = " \\brief Additional minimum alignment to be used for all allocations created from this pool. Can be 0."]
    #[doc = ""]
    #[doc = "Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two."]
    #[doc = "It can be useful in cases where alignment returned by Vulkan by functions like `vkGetBufferMemoryRequirements` is not enough,"]
    #[doc = "e.g. when doing interop with OpenGL."]
    pub minAllocationAlignment: DeviceSize,
    #[doc = " \\brief Additional `pNext` chain to be attached to `VkMemoryAllocateInfo` used for every allocation made by this pool. Optional."]
    #[doc = ""]
    #[doc = "Optional, can be null. If not null, it must point to a `pNext` chain of structures that can be attached to `VkMemoryAllocateInfo`."]
    #[doc = "It can be useful for special needs such as adding `VkExportMemoryAllocateInfoKHR`."]
    #[doc = "Structures pointed by this member must remain alive and unchanged for the whole lifetime of the custom pool."]
    #[doc = ""]
    #[doc = "Please note that some structures, e.g. `VkMemoryPriorityAllocateInfoEXT`, `VkMemoryDedicatedAllocateInfoKHR`,"]
    #[doc = "can be attached automatically by this library when using other, more convenient of its features."]
    pub pMemoryAllocateNext: *mut ::std::os::raw::c_void,
}
#[doc = " Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo()."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaAllocationInfo {
    #[doc = " \\brief Memory type index that this allocation was allocated from."]
    #[doc = ""]
    #[doc = "It never changes."]
    pub memoryType: u32,
    #[doc = " \\brief Handle to Vulkan memory object."]
    #[doc = ""]
    #[doc = "Same memory object can be shared by multiple allocations."]
    #[doc = ""]
    #[doc = "It can change after the allocation is moved during \\ref defragmentation."]
    pub deviceMemory: DeviceMemory,
    #[doc = " \\brief Offset in `VkDeviceMemory` object to the beginning of this allocation, in bytes. `(deviceMemory, offset)` pair is unique to this allocation."]
    #[doc = ""]
    #[doc = "You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function"]
    #[doc = "vmaCreateBuffer(), vmaCreateImage(), functions that operate on these resources refer to the beginning of the buffer or image,"]
    #[doc = "not entire device memory block. Functions like vmaMapMemory(), vmaBindBufferMemory() also refer to the beginning of the allocation"]
    #[doc = "and apply this offset automatically."]
    #[doc = ""]
    #[doc = "It can change after the allocation is moved during \\ref defragmentation."]
    pub offset: DeviceSize,
    #[doc = " \\brief Size of this allocation, in bytes."]
    #[doc = ""]
    #[doc = "It never changes."]
    #[doc = ""]
    #[doc = "\\note Allocation size returned in this variable may be greater than the size"]
    #[doc = "requested for the resource e.g. as `VkBufferCreateInfo::size`. Whole size of the"]
    #[doc = "allocation is accessible for operations on memory e.g. using a pointer after"]
    #[doc = "mapping with vmaMapMemory(), but operations on the resource e.g. using"]
    #[doc = "`vkCmdCopyBuffer` must be limited to the size of the resource."]
    pub size: DeviceSize,
    #[doc = " \\brief Pointer to the beginning of this allocation as mapped data."]
    #[doc = ""]
    #[doc = "If the allocation hasn't been mapped using vmaMapMemory() and hasn't been"]
    #[doc = "created with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag, this value is null."]
    #[doc = ""]
    #[doc = "It can change after call to vmaMapMemory(), vmaUnmapMemory()."]
    #[doc = "It can also change after the allocation is moved during \\ref defragmentation."]
    pub pMappedData: *mut ::std::os::raw::c_void,
    #[doc = " \\brief Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData()."]
    #[doc = ""]
    #[doc = "It can change after call to vmaSetAllocationUserData() for this allocation."]
    pub pUserData: *mut ::std::os::raw::c_void,
    #[doc = " \\brief Custom allocation name that was set with vmaSetAllocationName()."]
    #[doc = ""]
    #[doc = "It can change after call to vmaSetAllocationName() for this allocation."]
    #[doc = ""]
    #[doc = "Another way to set custom name is to pass it in VmaAllocationCreateInfo::pUserData with"]
    #[doc = "additional flag #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT set [DEPRECATED]."]
    pub pName: *const ::std::os::raw::c_char,
}
#[doc = " \\brief Parameters for defragmentation."]
#[doc = ""]
#[doc = "To be used with function vmaBeginDefragmentation()."]
#[repr(C)]
pub struct VmaDefragmentationInfo {
    #[doc = " \\brief Use combination of #VmaDefragmentationFlagBits."]
    pub flags: VmaDefragmentationFlags,
    #[doc = " \\brief Custom pool to be defragmented."]
    #[doc = ""]
    #[doc = "If null then default pools will undergo defragmentation process."]
    pub pool: VmaPool,
    #[doc = " \\brief Maximum numbers of bytes that can be copied during single pass, while moving allocations to different places."]
    #[doc = ""]
    #[doc = "`0` means no limit."]
    pub maxBytesPerPass: DeviceSize,
    #[doc = " \\brief Maximum number of allocations that can be moved during single pass to a different place."]
    #[doc = ""]
    #[doc = "`0` means no limit."]
    pub maxAllocationsPerPass: u32,
}
#[doc = " Single move of an allocation to be done for defragmentation."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationMove {
    #[doc = " Operation to be performed on the allocation by vmaEndDefragmentationPass(). Default value is #VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY. You can modify it."]
    pub operation: VmaDefragmentationMoveOperation,
    #[doc = " Allocation that should be moved."]
    pub srcAllocation: VmaAllocation,
    #[doc = " \\brief Temporary allocation pointing to destination memory that will replace `srcAllocation`."]
    #[doc = ""]
    #[doc = "\\warning Do not store this allocation in your data structures! It exists only temporarily, for the duration of the defragmentation pass,"]
    #[doc = "to be used for binding new buffer/image to the destination memory using e.g. vmaBindBufferMemory()."]
    #[doc = "vmaEndDefragmentationPass() will destroy it and make `srcAllocation` point to this memory."]
    pub dstTmpAllocation: VmaAllocation,
}
#[doc = " \\brief Parameters for incremental defragmentation steps."]
#[doc = ""]
#[doc = "To be used with function vmaBeginDefragmentationPass()."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationPassMoveInfo {
    #[doc = " Number of elements in the `pMoves` array."]
    pub moveCount: u32,
    #[doc = " \\brief Array of moves to be performed by the user in the current defragmentation pass."]
    #[doc = ""]
    #[doc = "Pointer to an array of `moveCount` elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass()."]
    #[doc = ""]
    #[doc = "For each element, you should:"]
    #[doc = ""]
    #[doc = "1. Create a new buffer/image in the place pointed by VmaDefragmentationMove::dstMemory + VmaDefragmentationMove::dstOffset."]
    #[doc = "2. Copy data from the VmaDefragmentationMove::srcAllocation e.g. using `vkCmdCopyBuffer`, `vkCmdCopyImage`."]
    #[doc = "3. Make sure these commands finished executing on the GPU."]
    #[doc = "4. Destroy the old buffer/image."]
    #[doc = ""]
    #[doc = "Only then you can finish defragmentation pass by calling vmaEndDefragmentationPass()."]
    #[doc = "After this call, the allocation will point to the new place in memory."]
    #[doc = ""]
    #[doc = "Alternatively, if you cannot move specific allocation, you can set VmaDefragmentationMove::operation to #VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE."]
    #[doc = ""]
    #[doc = "Alternatively, if you decide you want to completely remove the allocation:"]
    #[doc = ""]
    #[doc = "1. Destroy its buffer/image."]
    #[doc = "2. Set VmaDefragmentationMove::operation to #VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY."]
    #[doc = ""]
    #[doc = "Then, after vmaEndDefragmentationPass() the allocation will be freed."]
    pub pMoves: *mut VmaDefragmentationMove,
}
#[doc = " Statistics returned for defragmentation process in function vmaEndDefragmentation()."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VmaDefragmentationStats {
    #[doc = " Total number of bytes that have been copied while moving allocations to different places."]
    pub bytesMoved: DeviceSize,
    #[doc = " Total number of bytes that have been released to the system by freeing empty `VkDeviceMemory` objects."]
    pub bytesFreed: DeviceSize,
    #[doc = " Number of allocations that have been moved to different places."]
    pub allocationsMoved: u32,
    #[doc = " Number of empty `VkDeviceMemory` objects that have been released to the system."]
    pub deviceMemoryBlocksFreed: u32,
}
#[doc = " Parameters of created #VmaVirtualBlock object to be passed to vmaCreateVirtualBlock()."]
#[repr(C)]
pub struct VmaVirtualBlockCreateInfo {
    #[doc = " \\brief Total size of the virtual block."]
    #[doc = ""]
    #[doc = "Sizes can be expressed in bytes or any units you want as long as you are consistent in using them."]
    #[doc = "For example, if you allocate from some array of structures, 1 can mean single instance of entire structure."]
    pub size: DeviceSize,
    #[doc = " \\brief Use combination of #VmaVirtualBlockCreateFlagBits."]
    pub flags: VmaVirtualBlockCreateFlags,
    #[doc = " \\brief Custom CPU memory allocation callbacks. Optional."]
    #[doc = ""]
    #[doc = "Optional, can be null. When specified, they will be used for all CPU-side memory allocations."]
    pub pAllocationCallbacks: *const AllocationCallbacks,
}
#[doc = " Parameters of created virtual allocation to be passed to vmaVirtualAllocate()."]
#[repr(C)]
pub struct VmaVirtualAllocationCreateInfo {
    #[doc = " \\brief Size of the allocation."]
    #[doc = ""]
    #[doc = "Cannot be zero."]
    pub size: DeviceSize,
    #[doc = " \\brief Required alignment of the allocation. Optional."]
    #[doc = ""]
    #[doc = "Must be power of two. Special value 0 has the same meaning as 1 - means no special alignment is required, so allocation can start at any offset."]
    pub alignment: DeviceSize,
    #[doc = " \\brief Use combination of #VmaVirtualAllocationCreateFlagBits."]
    pub flags: VmaVirtualAllocationCreateFlags,
    #[doc = " \\brief Custom pointer to be associated with the allocation. Optional."]
    #[doc = ""]
    #[doc = "It can be any value and can be used for user-defined purposes. It can be fetched or changed later."]
    pub pUserData: *mut ::std::os::raw::c_void,
}
#[doc = " Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo()."]
#[repr(C)]
pub struct VmaVirtualAllocationInfo {
    #[doc = " \\brief Offset of the allocation."]
    #[doc = ""]
    #[doc = "Offset at which the allocation was made."]
    pub offset: DeviceSize,
    #[doc = " \\brief Size of the allocation."]
    #[doc = ""]
    #[doc = "Same value as passed in VmaVirtualAllocationCreateInfo::size."]
    pub size: DeviceSize,
    #[doc = " \\brief Custom pointer associated with the allocation."]
    #[doc = ""]
    #[doc = "Same value as passed in VmaVirtualAllocationCreateInfo::pUserData or to vmaSetVirtualAllocationUserData()."]
    pub pUserData: *mut ::std::os::raw::c_void,
}
extern "C" {
    #[doc = " Creates #VmaAllocator object."]
    pub fn vmaCreateAllocator(
        pCreateInfo: *const VmaAllocatorCreateInfo,
        pAllocator: *mut VmaAllocator,
    ) -> Result;
}
extern "C" {
    #[doc = " Destroys allocator object."]
    pub fn vmaDestroyAllocator(allocator: VmaAllocator);
}
extern "C" {
    #[doc = " \\brief Returns information about existing #VmaAllocator object - handle to Vulkan device etc."]
    #[doc = ""]
    #[doc = "It might be useful if you want to keep just the #VmaAllocator handle and fetch other required handles to"]
    #[doc = "`VkPhysicalDevice`, `VkDevice` etc. every time using this function."]
    pub fn vmaGetAllocatorInfo(allocator: VmaAllocator, pAllocatorInfo: *mut VmaAllocatorInfo);
}
extern "C" {
    #[doc = "PhysicalDeviceProperties are fetched from physicalDevice by the allocator."]
    #[doc = "You can access it here, without fetching it again on your own."]
    pub fn vmaGetPhysicalDeviceProperties(
        allocator: VmaAllocator,
        ppPhysicalDeviceProperties: *mut *const PhysicalDeviceProperties,
    );
}
extern "C" {
    #[doc = "PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator."]
    #[doc = "You can access it here, without fetching it again on your own."]
    pub fn vmaGetMemoryProperties(
        allocator: VmaAllocator,
        ppPhysicalDeviceMemoryProperties: *mut *const PhysicalDeviceMemoryProperties,
    );
}
extern "C" {
    #[doc = "\\brief Given Memory Type Index, returns Property Flags of this memory type."]
    #[doc = ""]
    #[doc = "This is just a convenience function. Same information can be obtained using"]
    #[doc = "vmaGetMemoryProperties()."]
    pub fn vmaGetMemoryTypeProperties(
        allocator: VmaAllocator,
        memoryTypeIndex: u32,
        pFlags: *mut MemoryPropertyFlags,
    );
}
extern "C" {
    #[doc = " \\brief Sets index of the current frame."]
    pub fn vmaSetCurrentFrameIndex(allocator: VmaAllocator, frameIndex: u32);
}
extern "C" {
    #[doc = " \\brief Retrieves statistics from current state of the Allocator."]
    #[doc = ""]
    #[doc = "This function is called \"calculate\" not \"get\" because it has to traverse all"]
    #[doc = "internal data structures, so it may be quite slow. Use it for debugging purposes."]
    #[doc = "For faster but more brief statistics suitable to be called every frame or every allocation,"]
    #[doc = "use vmaGetHeapBudgets()."]
    #[doc = ""]
    #[doc = "Note that when using allocator from multiple threads, returned information may immediately"]
    #[doc = "become outdated."]
    pub fn vmaCalculateStatistics(allocator: VmaAllocator, pStats: *mut VmaTotalStatistics);
}
extern "C" {
    #[doc = " \\brief Retrieves information about current memory usage and budget for all memory heaps."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param[out] pBudgets Must point to array with number of elements at least equal to number of memory heaps in physical device used."]
    #[doc = ""]
    #[doc = "This function is called \"get\" not \"calculate\" because it is very fast, suitable to be called"]
    #[doc = "every frame or every allocation. For more detailed statistics use vmaCalculateStatistics()."]
    #[doc = ""]
    #[doc = "Note that when using allocator from multiple threads, returned information may immediately"]
    #[doc = "become outdated."]
    pub fn vmaGetHeapBudgets(allocator: VmaAllocator, pBudgets: *mut VmaBudget);
}
extern "C" {
    #[doc = "\\brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo."]
    #[doc = ""]
    #[doc = "This algorithm tries to find a memory type that:"]
    #[doc = ""]
    #[doc = "- Is allowed by memoryTypeBits."]
    #[doc = "- Contains all the flags from pAllocationCreateInfo->requiredFlags."]
    #[doc = "- Matches intended usage."]
    #[doc = "- Has as many flags from pAllocationCreateInfo->preferredFlags as possible."]
    #[doc = ""]
    #[doc = "\\return Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result"]
    #[doc = "from this function or any other allocating function probably means that your"]
    #[doc = "device doesn't support any memory type with requested features for the specific"]
    #[doc = "type of resource you want to use it for. Please check parameters of your"]
    #[doc = "resource, like image layout (OPTIMAL versus LINEAR) or mip level count."]
    pub fn vmaFindMemoryTypeIndex(
        allocator: VmaAllocator,
        memoryTypeBits: u32,
        pAllocationCreateInfo: *const VmaAllocationCreateInfo,
        pMemoryTypeIndex: *mut u32,
    ) -> Result;
}
extern "C" {
    #[doc = "\\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo."]
    #[doc = ""]
    #[doc = "It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex."]
    #[doc = "It internally creates a temporary, dummy buffer that never has memory bound."]
    pub fn vmaFindMemoryTypeIndexForBufferInfo(
        allocator: VmaAllocator,
        pBufferCreateInfo: *const BufferCreateInfo,
        pAllocationCreateInfo: *const VmaAllocationCreateInfo,
        pMemoryTypeIndex: *mut u32,
    ) -> Result;
}
extern "C" {
    #[doc = "\\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo."]
    #[doc = ""]
    #[doc = "It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex."]
    #[doc = "It internally creates a temporary, dummy image that never has memory bound."]
    pub fn vmaFindMemoryTypeIndexForImageInfo(
        allocator: VmaAllocator,
        pImageCreateInfo: *const ImageCreateInfo,
        pAllocationCreateInfo: *const VmaAllocationCreateInfo,
        pMemoryTypeIndex: *mut u32,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Allocates Vulkan device memory and creates #VmaPool object."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param pCreateInfo Parameters of pool to create."]
    #[doc = "\\param[out] pPool Handle to created pool."]
    pub fn vmaCreatePool(
        allocator: VmaAllocator,
        pCreateInfo: *const VmaPoolCreateInfo,
        pPool: *mut VmaPool,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Destroys #VmaPool object and frees Vulkan device memory."]
    pub fn vmaDestroyPool(allocator: VmaAllocator, pool: VmaPool);
}
extern "C" {
    #[doc = " \\brief Retrieves statistics of existing #VmaPool object."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param pool Pool object."]
    #[doc = "\\param[out] pPoolStats Statistics of specified pool."]
    pub fn vmaGetPoolStatistics(
        allocator: VmaAllocator,
        pool: VmaPool,
        pPoolStats: *mut VmaStatistics,
    );
}
extern "C" {
    #[doc = " \\brief Retrieves detailed statistics of existing #VmaPool object."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param pool Pool object."]
    #[doc = "\\param[out] pPoolStats Statistics of specified pool."]
    pub fn vmaCalculatePoolStatistics(
        allocator: VmaAllocator,
        pool: VmaPool,
        pPoolStats: *mut VmaDetailedStatistics,
    );
}
extern "C" {
    #[doc = " \\brief Checks magic number in margins around all allocations in given memory pool in search for corruptions."]
    #[doc = ""]
    #[doc = "Corruption detection is enabled only when `VMA_DEBUG_DETECT_CORRUPTION` macro is defined to nonzero,"]
    #[doc = "`VMA_DEBUG_MARGIN` is defined to nonzero and the pool is created in memory type that is"]
    #[doc = "`HOST_VISIBLE` and `HOST_COHERENT`. For more information, see [Corruption detection](@ref debugging_memory_usage_corruption_detection)."]
    #[doc = ""]
    #[doc = "Possible return values:"]
    #[doc = ""]
    #[doc = "- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for specified pool."]
    #[doc = "- `VK_SUCCESS` - corruption detection has been performed and succeeded."]
    #[doc = "- `VK_ERROR_UNKNOWN` - corruption detection has been performed and found memory corruptions around one of the allocations."]
    #[doc = "`VMA_ASSERT` is also fired in that case."]
    #[doc = "- Other value: Error returned by Vulkan, e.g. memory mapping failure."]
    pub fn vmaCheckPoolCorruption(allocator: VmaAllocator, pool: VmaPool) -> Result;
}
extern "C" {
    #[doc = " \\brief Retrieves name of a custom pool."]
    #[doc = ""]
    #[doc = "After the call `ppName` is either null or points to an internally-owned null-terminated string"]
    #[doc = "containing name of the pool that was previously set. The pointer becomes invalid when the pool is"]
    #[doc = "destroyed or its name is changed using vmaSetPoolName()."]
    pub fn vmaGetPoolName(
        allocator: VmaAllocator,
        pool: VmaPool,
        ppName: *mut *const ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = " \\brief Sets name of a custom pool."]
    #[doc = ""]
    #[doc = "`pName` can be either null or pointer to a null-terminated string with new name for the pool."]
    #[doc = "Function makes internal copy of the string, so it can be changed or freed immediately after this call."]
    pub fn vmaSetPoolName(
        allocator: VmaAllocator,
        pool: VmaPool,
        pName: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = " \\brief General purpose memory allocation."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param pVkMemoryRequirements"]
    #[doc = "\\param pCreateInfo"]
    #[doc = "\\param[out] pAllocation Handle to allocated memory."]
    #[doc = "\\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo()."]
    #[doc = ""]
    #[doc = "You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages()."]
    #[doc = ""]
    #[doc = "It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(),"]
    #[doc = "vmaCreateBuffer(), vmaCreateImage() instead whenever possible."]
    pub fn vmaAllocateMemory(
        allocator: VmaAllocator,
        pVkMemoryRequirements: *const MemoryRequirements,
        pCreateInfo: *const VmaAllocationCreateInfo,
        pAllocation: *mut VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief General purpose memory allocation for multiple allocation objects at once."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param pVkMemoryRequirements Memory requirements for each allocation."]
    #[doc = "\\param pCreateInfo Creation parameters for each allocation."]
    #[doc = "\\param allocationCount Number of allocations to make."]
    #[doc = "\\param[out] pAllocations Pointer to array that will be filled with handles to created allocations."]
    #[doc = "\\param[out] pAllocationInfo Optional. Pointer to array that will be filled with parameters of created allocations."]
    #[doc = ""]
    #[doc = "You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages()."]
    #[doc = ""]
    #[doc = "Word \"pages\" is just a suggestion to use this function to allocate pieces of memory needed for sparse binding."]
    #[doc = "It is just a general purpose allocation function able to make multiple allocations at once."]
    #[doc = "It may be internally optimized to be more efficient than calling vmaAllocateMemory() `allocationCount` times."]
    #[doc = ""]
    #[doc = "All allocations are made using same parameters. All of them are created out of the same memory pool and type."]
    #[doc = "If any allocation fails, all allocations already made within this function call are also freed, so that when"]
    #[doc = "returned result is not `VK_SUCCESS`, `pAllocation` array is always entirely filled with `VK_NULL_HANDLE`."]
    pub fn vmaAllocateMemoryPages(
        allocator: VmaAllocator,
        pVkMemoryRequirements: *const MemoryRequirements,
        pCreateInfo: *const VmaAllocationCreateInfo,
        allocationCount: usize,
        pAllocations: *mut VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Allocates memory suitable for given `VkBuffer`."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param buffer"]
    #[doc = "\\param pCreateInfo"]
    #[doc = "\\param[out] pAllocation Handle to allocated memory."]
    #[doc = "\\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo()."]
    #[doc = ""]
    #[doc = "It only creates #VmaAllocation. To bind the memory to the buffer, use vmaBindBufferMemory()."]
    #[doc = ""]
    #[doc = "This is a special-purpose function. In most cases you should use vmaCreateBuffer()."]
    #[doc = ""]
    #[doc = "You must free the allocation using vmaFreeMemory() when no longer needed."]
    pub fn vmaAllocateMemoryForBuffer(
        allocator: VmaAllocator,
        buffer: Buffer,
        pCreateInfo: *const VmaAllocationCreateInfo,
        pAllocation: *mut VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Allocates memory suitable for given `VkImage`."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param image"]
    #[doc = "\\param pCreateInfo"]
    #[doc = "\\param[out] pAllocation Handle to allocated memory."]
    #[doc = "\\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo()."]
    #[doc = ""]
    #[doc = "It only creates #VmaAllocation. To bind the memory to the buffer, use vmaBindImageMemory()."]
    #[doc = ""]
    #[doc = "This is a special-purpose function. In most cases you should use vmaCreateImage()."]
    #[doc = ""]
    #[doc = "You must free the allocation using vmaFreeMemory() when no longer needed."]
    pub fn vmaAllocateMemoryForImage(
        allocator: VmaAllocator,
        image: Image,
        pCreateInfo: *const VmaAllocationCreateInfo,
        pAllocation: *mut VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage()."]
    #[doc = ""]
    #[doc = "Passing `VK_NULL_HANDLE` as `allocation` is valid. Such function call is just skipped."]
    pub fn vmaFreeMemory(allocator: VmaAllocator, allocation: VmaAllocation);
}
extern "C" {
    #[doc = " \\brief Frees memory and destroys multiple allocations."]
    #[doc = ""]
    #[doc = "Word \"pages\" is just a suggestion to use this function to free pieces of memory used for sparse binding."]
    #[doc = "It is just a general purpose function to free memory and destroy allocations made using e.g. vmaAllocateMemory(),"]
    #[doc = "vmaAllocateMemoryPages() and other functions."]
    #[doc = "It may be internally optimized to be more efficient than calling vmaFreeMemory() `allocationCount` times."]
    #[doc = ""]
    #[doc = "Allocations in `pAllocations` array can come from any memory pools and types."]
    #[doc = "Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entries are just skipped."]
    pub fn vmaFreeMemoryPages(
        allocator: VmaAllocator,
        allocationCount: usize,
        pAllocations: *mut VmaAllocation,
    );
}
extern "C" {
    #[doc = " \\brief Returns current information about specified allocation."]
    #[doc = ""]
    #[doc = "Current parameters of given allocation are returned in `pAllocationInfo`."]
    #[doc = ""]
    #[doc = "Although this function doesn't lock any mutex, so it should be quite efficient,"]
    #[doc = "you should avoid calling it too often."]
    #[doc = "You can retrieve same VmaAllocationInfo structure while creating your resource, from function"]
    #[doc = "vmaCreateBuffer(), vmaCreateImage(). You can remember it if you are sure parameters don't change"]
    #[doc = "(e.g. due to defragmentation)."]
    pub fn vmaGetAllocationInfo(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    );
}
extern "C" {
    #[doc = " \\brief Sets pUserData in given allocation to new value."]
    #[doc = ""]
    #[doc = "The value of pointer `pUserData` is copied to allocation's `pUserData`."]
    #[doc = "It is opaque, so you can use it however you want - e.g."]
    #[doc = "as a pointer, ordinal number or some handle to you own data."]
    pub fn vmaSetAllocationUserData(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        pUserData: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " \\brief Sets pName in given allocation to new value."]
    #[doc = ""]
    #[doc = "`pName` must be either null, or pointer to a null-terminated string. The function"]
    #[doc = "makes local copy of the string and sets it as allocation's `pName`. String"]
    #[doc = "passed as pName doesn't need to be valid for whole lifetime of the allocation -"]
    #[doc = "you can free it after this call. String previously pointed by allocation's"]
    #[doc = "`pName` is freed from memory."]
    pub fn vmaSetAllocationName(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        pName: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = "\\brief Given an allocation, returns Property Flags of its memory type."]
    #[doc = ""]
    #[doc = "This is just a convenience function. Same information can be obtained using"]
    #[doc = "vmaGetAllocationInfo() + vmaGetMemoryProperties()."]
    pub fn vmaGetAllocationMemoryProperties(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        pFlags: *mut MemoryPropertyFlags,
    );
}
extern "C" {
    #[doc = " \\brief Maps memory represented by given allocation and returns pointer to it."]
    #[doc = ""]
    #[doc = "Maps memory represented by given allocation to make it accessible to CPU code."]
    #[doc = "When succeeded, `*ppData` contains pointer to first byte of this memory."]
    #[doc = ""]
    #[doc = "\\warning"]
    #[doc = "If the allocation is part of a bigger `VkDeviceMemory` block, returned pointer is"]
    #[doc = "correctly offsetted to the beginning of region assigned to this particular allocation."]
    #[doc = "Unlike the result of `vkMapMemory`, it points to the allocation, not to the beginning of the whole block."]
    #[doc = "You should not add VmaAllocationInfo::offset to it!"]
    #[doc = ""]
    #[doc = "Mapping is internally reference-counted and synchronized, so despite raw Vulkan"]
    #[doc = "function `vkMapMemory()` cannot be used to map same block of `VkDeviceMemory`"]
    #[doc = "multiple times simultaneously, it is safe to call this function on allocations"]
    #[doc = "assigned to the same memory block. Actual Vulkan memory will be mapped on first"]
    #[doc = "mapping and unmapped on last unmapping."]
    #[doc = ""]
    #[doc = "If the function succeeded, you must call vmaUnmapMemory() to unmap the"]
    #[doc = "allocation when mapping is no longer needed or before freeing the allocation, at"]
    #[doc = "the latest."]
    #[doc = ""]
    #[doc = "It also safe to call this function multiple times on the same allocation. You"]
    #[doc = "must call vmaUnmapMemory() same number of times as you called vmaMapMemory()."]
    #[doc = ""]
    #[doc = "It is also safe to call this function on allocation created with"]
    #[doc = "#VMA_ALLOCATION_CREATE_MAPPED_BIT flag. Its memory stays mapped all the time."]
    #[doc = "You must still call vmaUnmapMemory() same number of times as you called"]
    #[doc = "vmaMapMemory(). You must not call vmaUnmapMemory() additional time to free the"]
    #[doc = "\"0-th\" mapping made automatically due to #VMA_ALLOCATION_CREATE_MAPPED_BIT flag."]
    #[doc = ""]
    #[doc = "This function fails when used on allocation made in memory type that is not"]
    #[doc = "`HOST_VISIBLE`."]
    #[doc = ""]
    #[doc = "This function doesn't automatically flush or invalidate caches."]
    #[doc = "If the allocation is made from a memory types that is not `HOST_COHERENT`,"]
    #[doc = "you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification."]
    pub fn vmaMapMemory(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        ppData: *mut *mut ::std::os::raw::c_void,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory()."]
    #[doc = ""]
    #[doc = "For details, see description of vmaMapMemory()."]
    #[doc = ""]
    #[doc = "This function doesn't automatically flush or invalidate caches."]
    #[doc = "If the allocation is made from a memory types that is not `HOST_COHERENT`,"]
    #[doc = "you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification."]
    pub fn vmaUnmapMemory(allocator: VmaAllocator, allocation: VmaAllocation);
}
extern "C" {
    #[doc = " \\brief Flushes memory of given allocation."]
    #[doc = ""]
    #[doc = "Calls `vkFlushMappedMemoryRanges()` for memory associated with given range of given allocation."]
    #[doc = "It needs to be called after writing to a mapped memory for memory types that are not `HOST_COHERENT`."]
    #[doc = "Unmap operation doesn't do that automatically."]
    #[doc = ""]
    #[doc = "- `offset` must be relative to the beginning of allocation."]
    #[doc = "- `size` can be `VK_WHOLE_SIZE`. It means all memory from `offset` the the end of given allocation."]
    #[doc = "- `offset` and `size` don't have to be aligned."]
    #[doc = "They are internally rounded down/up to multiply of `nonCoherentAtomSize`."]
    #[doc = "- If `size` is 0, this call is ignored."]
    #[doc = "- If memory type that the `allocation` belongs to is not `HOST_VISIBLE` or it is `HOST_COHERENT`,"]
    #[doc = "this call is ignored."]
    #[doc = ""]
    #[doc = "Warning! `offset` and `size` are relative to the contents of given `allocation`."]
    #[doc = "If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively."]
    #[doc = "Do not pass allocation's offset as `offset`!!!"]
    #[doc = ""]
    #[doc = "This function returns the `VkResult` from `vkFlushMappedMemoryRanges` if it is"]
    #[doc = "called, otherwise `VK_SUCCESS`."]
    pub fn vmaFlushAllocation(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        offset: DeviceSize,
        size: DeviceSize,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Invalidates memory of given allocation."]
    #[doc = ""]
    #[doc = "Calls `vkInvalidateMappedMemoryRanges()` for memory associated with given range of given allocation."]
    #[doc = "It needs to be called before reading from a mapped memory for memory types that are not `HOST_COHERENT`."]
    #[doc = "Map operation doesn't do that automatically."]
    #[doc = ""]
    #[doc = "- `offset` must be relative to the beginning of allocation."]
    #[doc = "- `size` can be `VK_WHOLE_SIZE`. It means all memory from `offset` the the end of given allocation."]
    #[doc = "- `offset` and `size` don't have to be aligned."]
    #[doc = "They are internally rounded down/up to multiply of `nonCoherentAtomSize`."]
    #[doc = "- If `size` is 0, this call is ignored."]
    #[doc = "- If memory type that the `allocation` belongs to is not `HOST_VISIBLE` or it is `HOST_COHERENT`,"]
    #[doc = "this call is ignored."]
    #[doc = ""]
    #[doc = "Warning! `offset` and `size` are relative to the contents of given `allocation`."]
    #[doc = "If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively."]
    #[doc = "Do not pass allocation's offset as `offset`!!!"]
    #[doc = ""]
    #[doc = "This function returns the `VkResult` from `vkInvalidateMappedMemoryRanges` if"]
    #[doc = "it is called, otherwise `VK_SUCCESS`."]
    pub fn vmaInvalidateAllocation(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        offset: DeviceSize,
        size: DeviceSize,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Flushes memory of given set of allocations."]
    #[doc = ""]
    #[doc = "Calls `vkFlushMappedMemoryRanges()` for memory associated with given ranges of given allocations."]
    #[doc = "For more information, see documentation of vmaFlushAllocation()."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param allocationCount"]
    #[doc = "\\param allocations"]
    #[doc = "\\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all ofsets are zero."]
    #[doc = "\\param sizes If not null, it must point to an array of sizes of regions to flush in respective allocations. Null means `VK_WHOLE_SIZE` for all allocations."]
    #[doc = ""]
    #[doc = "This function returns the `VkResult` from `vkFlushMappedMemoryRanges` if it is"]
    #[doc = "called, otherwise `VK_SUCCESS`."]
    pub fn vmaFlushAllocations(
        allocator: VmaAllocator,
        allocationCount: u32,
        allocations: *mut VmaAllocation,
        offsets: *const DeviceSize,
        sizes: *const DeviceSize,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Invalidates memory of given set of allocations."]
    #[doc = ""]
    #[doc = "Calls `vkInvalidateMappedMemoryRanges()` for memory associated with given ranges of given allocations."]
    #[doc = "For more information, see documentation of vmaInvalidateAllocation()."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param allocationCount"]
    #[doc = "\\param allocations"]
    #[doc = "\\param offsets If not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all ofsets are zero."]
    #[doc = "\\param sizes If not null, it must point to an array of sizes of regions to flush in respective allocations. Null means `VK_WHOLE_SIZE` for all allocations."]
    #[doc = ""]
    #[doc = "This function returns the `VkResult` from `vkInvalidateMappedMemoryRanges` if it is"]
    #[doc = "called, otherwise `VK_SUCCESS`."]
    pub fn vmaInvalidateAllocations(
        allocator: VmaAllocator,
        allocationCount: u32,
        allocations: *mut VmaAllocation,
        offsets: *const DeviceSize,
        sizes: *const DeviceSize,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param memoryTypeBits Bit mask, where each bit set means that a memory type with that index should be checked."]
    #[doc = ""]
    #[doc = "Corruption detection is enabled only when `VMA_DEBUG_DETECT_CORRUPTION` macro is defined to nonzero,"]
    #[doc = "`VMA_DEBUG_MARGIN` is defined to nonzero and only for memory types that are"]
    #[doc = "`HOST_VISIBLE` and `HOST_COHERENT`. For more information, see [Corruption detection](@ref debugging_memory_usage_corruption_detection)."]
    #[doc = ""]
    #[doc = "Possible return values:"]
    #[doc = ""]
    #[doc = "- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for any of specified memory types."]
    #[doc = "- `VK_SUCCESS` - corruption detection has been performed and succeeded."]
    #[doc = "- `VK_ERROR_UNKNOWN` - corruption detection has been performed and found memory corruptions around one of the allocations."]
    #[doc = "`VMA_ASSERT` is also fired in that case."]
    #[doc = "- Other value: Error returned by Vulkan, e.g. memory mapping failure."]
    pub fn vmaCheckCorruption(allocator: VmaAllocator, memoryTypeBits: u32) -> Result;
}
extern "C" {
    #[doc = " \\brief Begins defragmentation process."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param pInfo Structure filled with parameters of defragmentation."]
    #[doc = "\\param[out] pContext Context object that must be passed to vmaEndDefragmentation() to finish defragmentation."]
    #[doc = "\\returns"]
    #[doc = "- `VK_SUCCESS` if defragmentation can begin."]
    #[doc = "- `VK_ERROR_FEATURE_NOT_PRESENT` if defragmentation is not supported."]
    #[doc = ""]
    #[doc = "For more information about defragmentation, see documentation chapter:"]
    #[doc = "[Defragmentation](@ref defragmentation)."]
    pub fn vmaBeginDefragmentation(
        allocator: VmaAllocator,
        pInfo: *const VmaDefragmentationInfo,
        pContext: *mut VmaDefragmentationContext,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Ends defragmentation process."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param context Context object that has been created by vmaBeginDefragmentation()."]
    #[doc = "\\param[out] pStats Optional stats for the defragmentation. Can be null."]
    #[doc = ""]
    #[doc = "Use this function to finish defragmentation started by vmaBeginDefragmentation()."]
    pub fn vmaEndDefragmentation(
        allocator: VmaAllocator,
        context: VmaDefragmentationContext,
        pStats: *mut VmaDefragmentationStats,
    );
}
extern "C" {
    #[doc = " \\brief Starts single defragmentation pass."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param context Context object that has been created by vmaBeginDefragmentation()."]
    #[doc = "\\param[out] pPassInfo Computed information for current pass."]
    #[doc = "\\returns"]
    #[doc = "- `VK_SUCCESS` if no more moves are possible. Then you can omit call to vmaEndDefragmentationPass() and simply end whole defragmentation."]
    #[doc = "- `VK_INCOMPLETE` if there are pending moves returned in `pPassInfo`. You need to perform them, call vmaEndDefragmentationPass(),"]
    #[doc = "and then preferably try another pass with vmaBeginDefragmentationPass()."]
    pub fn vmaBeginDefragmentationPass(
        allocator: VmaAllocator,
        context: VmaDefragmentationContext,
        pPassInfo: *mut VmaDefragmentationPassMoveInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Ends single defragmentation pass."]
    #[doc = ""]
    #[doc = "\\param allocator Allocator object."]
    #[doc = "\\param context Context object that has been created by vmaBeginDefragmentation()."]
    #[doc = "\\param pPassInfo Computed information for current pass filled by vmaBeginDefragmentationPass() and possibly modified by you."]
    #[doc = ""]
    #[doc = "Returns `VK_SUCCESS` if no more moves are possible or `VK_INCOMPLETE` if more defragmentations are possible."]
    #[doc = ""]
    #[doc = "Ends incremental defragmentation pass and commits all defragmentation moves from `pPassInfo`."]
    #[doc = "After this call:"]
    #[doc = ""]
    #[doc = "- Allocations at `pPassInfo[i].srcAllocation` that had `pPassInfo[i].operation ==` #VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY"]
    #[doc = "(which is the default) will be pointing to the new destination place."]
    #[doc = "- Allocation at `pPassInfo[i].srcAllocation` that had `pPassInfo[i].operation ==` #VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY"]
    #[doc = "will be freed."]
    #[doc = ""]
    #[doc = "If no more moves are possible you can end whole defragmentation."]
    pub fn vmaEndDefragmentationPass(
        allocator: VmaAllocator,
        context: VmaDefragmentationContext,
        pPassInfo: *mut VmaDefragmentationPassMoveInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Binds buffer to allocation."]
    #[doc = ""]
    #[doc = "Binds specified buffer to region of memory represented by specified allocation."]
    #[doc = "Gets `VkDeviceMemory` handle and offset from the allocation."]
    #[doc = "If you want to create a buffer, allocate memory for it and bind them together separately,"]
    #[doc = "you should use this function for binding instead of standard `vkBindBufferMemory()`,"]
    #[doc = "because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple"]
    #[doc = "allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously"]
    #[doc = "(which is illegal in Vulkan)."]
    #[doc = ""]
    #[doc = "It is recommended to use function vmaCreateBuffer() instead of this one."]
    pub fn vmaBindBufferMemory(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        buffer: Buffer,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Binds buffer to allocation with additional parameters."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param allocation"]
    #[doc = "\\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0."]
    #[doc = "\\param buffer"]
    #[doc = "\\param pNext A chain of structures to be attached to `VkBindBufferMemoryInfoKHR` structure used internally. Normally it should be null."]
    #[doc = ""]
    #[doc = "This function is similar to vmaBindBufferMemory(), but it provides additional parameters."]
    #[doc = ""]
    #[doc = "If `pNext` is not null, #VmaAllocator object must have been created with #VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag"]
    #[doc = "or with VmaAllocatorCreateInfo::vulkanApiVersion `>= VK_API_VERSION_1_1`. Otherwise the call fails."]
    pub fn vmaBindBufferMemory2(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        allocationLocalOffset: DeviceSize,
        buffer: Buffer,
        pNext: *const ::std::os::raw::c_void,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Binds image to allocation."]
    #[doc = ""]
    #[doc = "Binds specified image to region of memory represented by specified allocation."]
    #[doc = "Gets `VkDeviceMemory` handle and offset from the allocation."]
    #[doc = "If you want to create an image, allocate memory for it and bind them together separately,"]
    #[doc = "you should use this function for binding instead of standard `vkBindImageMemory()`,"]
    #[doc = "because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple"]
    #[doc = "allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously"]
    #[doc = "(which is illegal in Vulkan)."]
    #[doc = ""]
    #[doc = "It is recommended to use function vmaCreateImage() instead of this one."]
    pub fn vmaBindImageMemory(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        image: Image,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Binds image to allocation with additional parameters."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param allocation"]
    #[doc = "\\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the `allocation`. Normally it should be 0."]
    #[doc = "\\param image"]
    #[doc = "\\param pNext A chain of structures to be attached to `VkBindImageMemoryInfoKHR` structure used internally. Normally it should be null."]
    #[doc = ""]
    #[doc = "This function is similar to vmaBindImageMemory(), but it provides additional parameters."]
    #[doc = ""]
    #[doc = "If `pNext` is not null, #VmaAllocator object must have been created with #VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag"]
    #[doc = "or with VmaAllocatorCreateInfo::vulkanApiVersion `>= VK_API_VERSION_1_1`. Otherwise the call fails."]
    pub fn vmaBindImageMemory2(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        allocationLocalOffset: DeviceSize,
        image: Image,
        pNext: *const ::std::os::raw::c_void,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Creates a new `VkBuffer`, allocates and binds memory for it."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param pBufferCreateInfo"]
    #[doc = "\\param pAllocationCreateInfo"]
    #[doc = "\\param[out] pBuffer Buffer that was created."]
    #[doc = "\\param[out] pAllocation Allocation that was created."]
    #[doc = "\\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo()."]
    #[doc = ""]
    #[doc = "This function automatically:"]
    #[doc = ""]
    #[doc = "-# Creates buffer."]
    #[doc = "-# Allocates appropriate memory for it."]
    #[doc = "-# Binds the buffer with the memory."]
    #[doc = ""]
    #[doc = "If any of these operations fail, buffer and allocation are not created,"]
    #[doc = "returned value is negative error code, `*pBuffer` and `*pAllocation` are null."]
    #[doc = ""]
    #[doc = "If the function succeeded, you must destroy both buffer and allocation when you"]
    #[doc = "no longer need them using either convenience function vmaDestroyBuffer() or"]
    #[doc = "separately, using `vkDestroyBuffer()` and vmaFreeMemory()."]
    #[doc = ""]
    #[doc = "If #VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag was used,"]
    #[doc = "VK_KHR_dedicated_allocation extension is used internally to query driver whether"]
    #[doc = "it requires or prefers the new buffer to have dedicated allocation. If yes,"]
    #[doc = "and if dedicated allocation is possible"]
    #[doc = "(#VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated"]
    #[doc = "allocation for this buffer, just like when using"]
    #[doc = "#VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT."]
    #[doc = ""]
    #[doc = "\\note This function creates a new `VkBuffer`. Sub-allocation of parts of one large buffer,"]
    #[doc = "although recommended as a good practice, is out of scope of this library and could be implemented"]
    #[doc = "by the user as a higher-level logic on top of VMA."]
    pub fn vmaCreateBuffer(
        allocator: VmaAllocator,
        pBufferCreateInfo: *const BufferCreateInfo,
        pAllocationCreateInfo: *const VmaAllocationCreateInfo,
        pBuffer: *mut Buffer,
        pAllocation: *mut VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Creates a buffer with additional minimum alignment."]
    #[doc = ""]
    #[doc = "Similar to vmaCreateBuffer() but provides additional parameter `minAlignment` which allows to specify custom,"]
    #[doc = "minimum alignment to be used when placing the buffer inside a larger memory block, which may be needed e.g."]
    #[doc = "for interop with OpenGL."]
    pub fn vmaCreateBufferWithAlignment(
        allocator: VmaAllocator,
        pBufferCreateInfo: *const BufferCreateInfo,
        pAllocationCreateInfo: *const VmaAllocationCreateInfo,
        minAlignment: DeviceSize,
        pBuffer: *mut Buffer,
        pAllocation: *mut VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Creates a new `VkBuffer`, binds already created memory for it."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param allocation Allocation that provides memory to be used for binding new buffer to it."]
    #[doc = "\\param pBufferCreateInfo"]
    #[doc = "\\param[out] pBuffer Buffer that was created."]
    #[doc = ""]
    #[doc = "This function automatically:"]
    #[doc = ""]
    #[doc = "-# Creates buffer."]
    #[doc = "-# Binds the buffer with the supplied memory."]
    #[doc = ""]
    #[doc = "If any of these operations fail, buffer is not created,"]
    #[doc = "returned value is negative error code and `*pBuffer` is null."]
    #[doc = ""]
    #[doc = "If the function succeeded, you must destroy the buffer when you"]
    #[doc = "no longer need it using `vkDestroyBuffer()`. If you want to also destroy the corresponding"]
    #[doc = "allocation you can use convenience function vmaDestroyBuffer()."]
    #[doc = ""]
    #[doc = "\\note There is a new version of this function augmented with parameter `allocationLocalOffset` - see vmaCreateAliasingBuffer2()."]
    pub fn vmaCreateAliasingBuffer(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        pBufferCreateInfo: *const BufferCreateInfo,
        pBuffer: *mut Buffer,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Creates a new `VkBuffer`, binds already created memory for it."]
    #[doc = ""]
    #[doc = "\\param allocator"]
    #[doc = "\\param allocation Allocation that provides memory to be used for binding new buffer to it."]
    #[doc = "\\param allocationLocalOffset Additional offset to be added while binding, relative to the beginning of the allocation. Normally it should be 0."]
    #[doc = "\\param pBufferCreateInfo"]
    #[doc = "\\param[out] pBuffer Buffer that was created."]
    #[doc = ""]
    #[doc = "This function automatically:"]
    #[doc = ""]
    #[doc = "-# Creates buffer."]
    #[doc = "-# Binds the buffer with the supplied memory."]
    #[doc = ""]
    #[doc = "If any of these operations fail, buffer is not created,"]
    #[doc = "returned value is negative error code and `*pBuffer` is null."]
    #[doc = ""]
    #[doc = "If the function succeeded, you must destroy the buffer when you"]
    #[doc = "no longer need it using `vkDestroyBuffer()`. If you want to also destroy the corresponding"]
    #[doc = "allocation you can use convenience function vmaDestroyBuffer()."]
    #[doc = ""]
    #[doc = "\\note This is a new version of the function augmented with parameter `allocationLocalOffset`."]
    pub fn vmaCreateAliasingBuffer2(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        allocationLocalOffset: DeviceSize,
        pBufferCreateInfo: *const BufferCreateInfo,
        pBuffer: *mut Buffer,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Destroys Vulkan buffer and frees allocated memory."]
    #[doc = ""]
    #[doc = "This is just a convenience function equivalent to:"]
    #[doc = ""]
    #[doc = "\\code"]
    #[doc = "vkDestroyBuffer(device, buffer, allocationCallbacks);"]
    #[doc = "vmaFreeMemory(allocator, allocation);"]
    #[doc = "\\endcode"]
    #[doc = ""]
    #[doc = "It is safe to pass null as buffer and/or allocation."]
    pub fn vmaDestroyBuffer(allocator: VmaAllocator, buffer: Buffer, allocation: VmaAllocation);
}
extern "C" {
    #[doc = " Function similar to vmaCreateBuffer()."]
    pub fn vmaCreateImage(
        allocator: VmaAllocator,
        pImageCreateInfo: *const ImageCreateInfo,
        pAllocationCreateInfo: *const VmaAllocationCreateInfo,
        pImage: *mut Image,
        pAllocation: *mut VmaAllocation,
        pAllocationInfo: *mut VmaAllocationInfo,
    ) -> Result;
}
extern "C" {
    #[doc = " Function similar to vmaCreateAliasingBuffer() but for images."]
    pub fn vmaCreateAliasingImage(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        pImageCreateInfo: *const ImageCreateInfo,
        pImage: *mut Image,
    ) -> Result;
}
extern "C" {
    #[doc = " Function similar to vmaCreateAliasingBuffer2() but for images."]
    pub fn vmaCreateAliasingImage2(
        allocator: VmaAllocator,
        allocation: VmaAllocation,
        allocationLocalOffset: DeviceSize,
        pImageCreateInfo: *const ImageCreateInfo,
        pImage: *mut Image,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Destroys Vulkan image and frees allocated memory."]
    #[doc = ""]
    #[doc = "This is just a convenience function equivalent to:"]
    #[doc = ""]
    #[doc = "\\code"]
    #[doc = "vkDestroyImage(device, image, allocationCallbacks);"]
    #[doc = "vmaFreeMemory(allocator, allocation);"]
    #[doc = "\\endcode"]
    #[doc = ""]
    #[doc = "It is safe to pass null as image and/or allocation."]
    pub fn vmaDestroyImage(allocator: VmaAllocator, image: Image, allocation: VmaAllocation);
}
extern "C" {
    #[doc = " \\brief Creates new #VmaVirtualBlock object."]
    #[doc = ""]
    #[doc = "\\param pCreateInfo Parameters for creation."]
    #[doc = "\\param[out] pVirtualBlock Returned virtual block object or `VMA_NULL` if creation failed."]
    pub fn vmaCreateVirtualBlock(
        pCreateInfo: *const VmaVirtualBlockCreateInfo,
        pVirtualBlock: *mut VmaVirtualBlock,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Destroys #VmaVirtualBlock object."]
    #[doc = ""]
    #[doc = "Please note that you should consciously handle virtual allocations that could remain unfreed in the block."]
    #[doc = "You should either free them individually using vmaVirtualFree() or call vmaClearVirtualBlock()"]
    #[doc = "if you are sure this is what you want. If you do neither, an assert is called."]
    #[doc = ""]
    #[doc = "If you keep pointers to some additional metadata associated with your virtual allocations in their `pUserData`,"]
    #[doc = "don't forget to free them."]
    pub fn vmaDestroyVirtualBlock(virtualBlock: VmaVirtualBlock);
}
extern "C" {
    #[doc = " \\brief Returns true of the #VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations."]
    pub fn vmaIsVirtualBlockEmpty(virtualBlock: VmaVirtualBlock) -> Bool32;
}
extern "C" {
    #[doc = " \\brief Returns information about a specific virtual allocation within a virtual block, like its size and `pUserData` pointer."]
    pub fn vmaGetVirtualAllocationInfo(
        virtualBlock: VmaVirtualBlock,
        allocation: VmaVirtualAllocation,
        pVirtualAllocInfo: *mut VmaVirtualAllocationInfo,
    );
}
extern "C" {
    #[doc = " \\brief Allocates new virtual allocation inside given #VmaVirtualBlock."]
    #[doc = ""]
    #[doc = "If the allocation fails due to not enough free space available, `VK_ERROR_OUT_OF_DEVICE_MEMORY` is returned"]
    #[doc = "(despite the function doesn't ever allocate actual GPU memory)."]
    #[doc = "`pAllocation` is then set to `VK_NULL_HANDLE` and `pOffset`, if not null, it set to `UINT64_MAX`."]
    #[doc = ""]
    #[doc = "\\param virtualBlock Virtual block"]
    #[doc = "\\param pCreateInfo Parameters for the allocation"]
    #[doc = "\\param[out] pAllocation Returned handle of the new allocation"]
    #[doc = "\\param[out] pOffset Returned offset of the new allocation. Optional, can be null."]
    pub fn vmaVirtualAllocate(
        virtualBlock: VmaVirtualBlock,
        pCreateInfo: *const VmaVirtualAllocationCreateInfo,
        pAllocation: *mut VmaVirtualAllocation,
        pOffset: *mut DeviceSize,
    ) -> Result;
}
extern "C" {
    #[doc = " \\brief Frees virtual allocation inside given #VmaVirtualBlock."]
    #[doc = ""]
    #[doc = "It is correct to call this function with `allocation == VK_NULL_HANDLE` - it does nothing."]
    pub fn vmaVirtualFree(virtualBlock: VmaVirtualBlock, allocation: VmaVirtualAllocation);
}
extern "C" {
    #[doc = " \\brief Frees all virtual allocations inside given #VmaVirtualBlock."]
    #[doc = ""]
    #[doc = "You must either call this function or free each virtual allocation individually with vmaVirtualFree()"]
    #[doc = "before destroying a virtual block. Otherwise, an assert is called."]
    #[doc = ""]
    #[doc = "If you keep pointer to some additional metadata associated with your virtual allocation in its `pUserData`,"]
    #[doc = "don't forget to free it as well."]
    pub fn vmaClearVirtualBlock(virtualBlock: VmaVirtualBlock);
}
extern "C" {
    #[doc = " \\brief Changes custom pointer associated with given virtual allocation."]
    pub fn vmaSetVirtualAllocationUserData(
        virtualBlock: VmaVirtualBlock,
        allocation: VmaVirtualAllocation,
        pUserData: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " \\brief Calculates and returns statistics about virtual allocations and memory usage in given #VmaVirtualBlock."]
    #[doc = ""]
    #[doc = "This function is fast to call. For more detailed statistics, see vmaCalculateVirtualBlockStatistics()."]
    pub fn vmaGetVirtualBlockStatistics(virtualBlock: VmaVirtualBlock, pStats: *mut VmaStatistics);
}
extern "C" {
    #[doc = " \\brief Calculates and returns detailed statistics about virtual allocations and memory usage in given #VmaVirtualBlock."]
    #[doc = ""]
    #[doc = "This function is slow to call. Use for debugging purposes."]
    #[doc = "For less detailed statistics, see vmaGetVirtualBlockStatistics()."]
    pub fn vmaCalculateVirtualBlockStatistics(
        virtualBlock: VmaVirtualBlock,
        pStats: *mut VmaDetailedStatistics,
    );
}
extern "C" {
    #[doc = " \\brief Builds and returns a null-terminated string in JSON format with information about given #VmaVirtualBlock."]
    #[doc = "\\param virtualBlock Virtual block."]
    #[doc = "\\param[out] ppStatsString Returned string."]
    #[doc = "\\param detailedMap Pass `VK_FALSE` to only obtain statistics as returned by vmaCalculateVirtualBlockStatistics(). Pass `VK_TRUE` to also obtain full list of allocations and free spaces."]
    #[doc = ""]
    #[doc = "Returned string must be freed using vmaFreeVirtualBlockStatsString()."]
    pub fn vmaBuildVirtualBlockStatsString(
        virtualBlock: VmaVirtualBlock,
        ppStatsString: *mut *mut ::std::os::raw::c_char,
        detailedMap: Bool32,
    );
}
extern "C" {
    #[doc = " Frees a string returned by vmaBuildVirtualBlockStatsString()."]
    pub fn vmaFreeVirtualBlockStatsString(
        virtualBlock: VmaVirtualBlock,
        pStatsString: *mut ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = " \\brief Builds and returns statistics as a null-terminated string in JSON format."]
    #[doc = "\\param allocator"]
    #[doc = "\\param[out] ppStatsString Must be freed using vmaFreeStatsString() function."]
    #[doc = "\\param detailedMap"]
    pub fn vmaBuildStatsString(
        allocator: VmaAllocator,
        ppStatsString: *mut *mut ::std::os::raw::c_char,
        detailedMap: Bool32,
    );
}
extern "C" {
    pub fn vmaFreeStatsString(allocator: VmaAllocator, pStatsString: *mut ::std::os::raw::c_char);
}