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
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
|
//
// File: vulkan.h
//
/*
** Copyright (c) 2014-2015 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#ifndef __VULKAN_H__
#define __VULKAN_H__
#define VK_MAKE_VERSION(major, minor, patch) \
((major << 22) | (minor << 12) | patch)
#include "vk_platform.h"
// Vulkan API version supported by this file
#define VK_API_VERSION VK_MAKE_VERSION(0, 91, 0)
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
/*
***************************************************************************************************
* Core Vulkan API
***************************************************************************************************
*/
#if defined (__cplusplus) && (VK_UINTPTRLEAST64_MAX == UINTPTR_MAX)
#define VK_TYPE_SAFE_COMPATIBLE_HANDLES 1
#endif
#if defined(VK_TYPE_SAFE_COMPATIBLE_HANDLES) && !defined(VK_DISABLE_TYPE_SAFE_HANDLES)
#define VK_DEFINE_PTR_HANDLE(_obj) struct _obj##_T { char _dummy; }; typedef _obj##_T* _obj;
#define VK_DEFINE_PTR_SUBCLASS_HANDLE(_obj, _base) struct _obj##_T : public _base##_T {}; typedef _obj##_T* _obj;
#define VK_DEFINE_BASE_HANDLE(_obj) VK_DEFINE_PTR_HANDLE(_obj)
#define VK_DEFINE_DISP_SUBCLASS_HANDLE(_obj, _base) VK_DEFINE_PTR_SUBCLASS_HANDLE(_obj, _base)
#define VK_DEFINE_NONDISP_SUBCLASS_HANDLE(_obj, _base) VK_DEFINE_PTR_SUBCLASS_HANDLE(_obj, _base)
#else
#define VK_DEFINE_BASE_HANDLE(_obj) typedef VkUintPtrLeast64 _obj;
#define VK_DEFINE_DISP_SUBCLASS_HANDLE(_obj, _base) typedef uintptr_t _obj;
#define VK_DEFINE_NONDISP_SUBCLASS_HANDLE(_obj, _base) typedef VkUintPtrLeast64 _obj;
#endif
VK_DEFINE_BASE_HANDLE(VkObject)
VK_DEFINE_DISP_SUBCLASS_HANDLE(VkInstance, VkObject)
VK_DEFINE_DISP_SUBCLASS_HANDLE(VkPhysicalDevice, VkObject)
VK_DEFINE_DISP_SUBCLASS_HANDLE(VkDevice, VkObject)
VK_DEFINE_DISP_SUBCLASS_HANDLE(VkQueue, VkObject)
VK_DEFINE_DISP_SUBCLASS_HANDLE(VkCmdBuffer, VkObject)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkNonDispatchable, VkObject)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDeviceMemory, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkBuffer, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkBufferView, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkImage, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkImageView, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkColorAttachmentView, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDepthStencilView, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkShader, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkPipeline, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkPipelineLayout, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkSampler, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDescriptorSet, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDescriptorSetLayout, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDescriptorPool, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDynamicStateObject, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDynamicVpState, VkDynamicStateObject)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDynamicRsState, VkDynamicStateObject)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDynamicCbState, VkDynamicStateObject)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDynamicDsState, VkDynamicStateObject)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkFence, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkSemaphore, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkEvent, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkQueryPool, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkFramebuffer, VkNonDispatchable)
VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkRenderPass, VkNonDispatchable)
#define VK_MAX_PHYSICAL_DEVICE_NAME 256
#define VK_MAX_EXTENSION_NAME 256
#define VK_LOD_CLAMP_NONE MAX_FLOAT
#define VK_WHOLE_SIZE UINT64_MAX
#define VK_TRUE 1
#define VK_FALSE 0
#define VK_NULL_HANDLE 0
// This macro defines INT_MAX in enumerations to force compilers to use 32 bits
// to represent them. This may or may not be necessary on some compilers. The
// option to compile it out may allow compilers that warn about missing enumerants
// in switch statements to be silenced.
// Using this macro is not needed for flag bit enums because those aren't used
// as storage type anywhere.
#define VK_MAX_ENUM(Prefix) VK_##Prefix##_MAX_ENUM = 0x7FFFFFFF
// This macro defines the BEGIN_RANGE, END_RANGE, NUM, and MAX_ENUM constants for
// the enumerations.
#define VK_ENUM_RANGE(Prefix, First, Last) \
VK_##Prefix##_BEGIN_RANGE = VK_##Prefix##_##First, \
VK_##Prefix##_END_RANGE = VK_##Prefix##_##Last, \
VK_NUM_##Prefix = (VK_##Prefix##_END_RANGE - VK_##Prefix##_BEGIN_RANGE + 1), \
VK_MAX_ENUM(Prefix)
// This is a helper macro to define the value of flag bit enum values.
#define VK_BIT(bit) (1 << (bit))
// ------------------------------------------------------------------------------------------------
// Enumerations
typedef enum VkMemoryPriority_
{
VK_MEMORY_PRIORITY_UNUSED = 0x00000000,
VK_MEMORY_PRIORITY_VERY_LOW = 0x00000001,
VK_MEMORY_PRIORITY_LOW = 0x00000002,
VK_MEMORY_PRIORITY_NORMAL = 0x00000003,
VK_MEMORY_PRIORITY_HIGH = 0x00000004,
VK_MEMORY_PRIORITY_VERY_HIGH = 0x00000005,
VK_ENUM_RANGE(MEMORY_PRIORITY, UNUSED, VERY_HIGH)
} VkMemoryPriority;
typedef enum VkImageLayout_
{
VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, // Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
VK_IMAGE_LAYOUT_GENERAL = 0x00000001, // General layout when image can be used for any kind of access
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, // Optimal layout when image is only used for color attachment read/write
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, // Optimal layout when image is only used for depth/stencil attachment read/write
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, // Optimal layout when image is used for read only depth/stencil attachment and shader access
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, // Optimal layout when image is used for read only shader access
VK_IMAGE_LAYOUT_CLEAR_OPTIMAL = 0x00000006, // Optimal layout when image is used only for clear operations
VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL = 0x00000007, // Optimal layout when image is used only as source of transfer operations
VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL = 0x00000008, // Optimal layout when image is used only as destination of transfer operations
VK_ENUM_RANGE(IMAGE_LAYOUT, UNDEFINED, TRANSFER_DESTINATION_OPTIMAL)
} VkImageLayout;
typedef enum VkPipeEvent_
{
VK_PIPE_EVENT_TOP_OF_PIPE = 0x00000001, // Set event before the device starts processing subsequent command
VK_PIPE_EVENT_VERTEX_PROCESSING_COMPLETE = 0x00000002, // Set event when all pending vertex processing is complete
VK_PIPE_EVENT_LOCAL_FRAGMENT_PROCESSING_COMPLETE = 0x00000003, // Set event when all pending fragment shader executions are complete, within each fragment location
VK_PIPE_EVENT_FRAGMENT_PROCESSING_COMPLETE = 0x00000004, // Set event when all pending fragment shader executions are complete
VK_PIPE_EVENT_GRAPHICS_PIPELINE_COMPLETE = 0x00000005, // Set event when all pending graphics operations are complete
VK_PIPE_EVENT_COMPUTE_PIPELINE_COMPLETE = 0x00000006, // Set event when all pending compute operations are complete
VK_PIPE_EVENT_TRANSFER_COMPLETE = 0x00000007, // Set event when all pending transfer operations are complete
VK_PIPE_EVENT_COMMANDS_COMPLETE = 0x00000008, // Set event when all pending work is complete
VK_ENUM_RANGE(PIPE_EVENT, TOP_OF_PIPE, COMMANDS_COMPLETE)
} VkPipeEvent;
typedef enum VkWaitEvent_
{
VK_WAIT_EVENT_TOP_OF_PIPE = 0x00000001, // Wait event before the device starts processing subsequent commands
VK_WAIT_EVENT_BEFORE_RASTERIZATION = 0x00000002, // Wait event before rasterizing subsequent primitives
VK_ENUM_RANGE(WAIT_EVENT, TOP_OF_PIPE, BEFORE_RASTERIZATION)
} VkWaitEvent;
typedef enum VkAttachmentLoadOp_
{
VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
VK_ENUM_RANGE(ATTACHMENT_LOAD_OP, LOAD, DONT_CARE)
} VkAttachmentLoadOp;
typedef enum VkAttachmentStoreOp_
{
VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
VK_ATTACHMENT_STORE_OP_RESOLVE_MSAA = 0x00000001,
VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000002,
VK_ENUM_RANGE(ATTACHMENT_STORE_OP, STORE, DONT_CARE)
} VkAttachmentStoreOp;
typedef enum VkImageType_
{
VK_IMAGE_TYPE_1D = 0x00000000,
VK_IMAGE_TYPE_2D = 0x00000001,
VK_IMAGE_TYPE_3D = 0x00000002,
VK_ENUM_RANGE(IMAGE_TYPE, 1D, 3D)
} VkImageType;
typedef enum VkImageTiling_
{
VK_IMAGE_TILING_LINEAR = 0x00000000,
VK_IMAGE_TILING_OPTIMAL = 0x00000001,
VK_ENUM_RANGE(IMAGE_TILING, LINEAR, OPTIMAL)
} VkImageTiling;
typedef enum VkImageViewType_
{
VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
VK_ENUM_RANGE(IMAGE_VIEW_TYPE, 1D, CUBE)
} VkImageViewType;
typedef enum VkImageAspect_
{
VK_IMAGE_ASPECT_COLOR = 0x00000000,
VK_IMAGE_ASPECT_DEPTH = 0x00000001,
VK_IMAGE_ASPECT_STENCIL = 0x00000002,
VK_ENUM_RANGE(IMAGE_ASPECT, COLOR, STENCIL)
} VkImageAspect;
typedef enum VkBufferViewType_
{
VK_BUFFER_VIEW_TYPE_RAW = 0x00000000, // Raw buffer without special structure (UBO, SSBO)
VK_BUFFER_VIEW_TYPE_FORMATTED = 0x00000001, // Buffer with format (TBO, IBO)
VK_ENUM_RANGE(BUFFER_VIEW_TYPE, RAW, FORMATTED)
} VkBufferViewType;
typedef enum VkChannelSwizzle_
{
VK_CHANNEL_SWIZZLE_ZERO = 0x00000000,
VK_CHANNEL_SWIZZLE_ONE = 0x00000001,
VK_CHANNEL_SWIZZLE_R = 0x00000002,
VK_CHANNEL_SWIZZLE_G = 0x00000003,
VK_CHANNEL_SWIZZLE_B = 0x00000004,
VK_CHANNEL_SWIZZLE_A = 0x00000005,
VK_ENUM_RANGE(CHANNEL_SWIZZLE, ZERO, A)
} VkChannelSwizzle;
typedef enum VkDescriptorType_
{
VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
VK_ENUM_RANGE(DESCRIPTOR_TYPE, SAMPLER, STORAGE_BUFFER_DYNAMIC)
} VkDescriptorType;
typedef enum VkDescriptorPoolUsage_
{
VK_DESCRIPTOR_POOL_USAGE_ONE_SHOT = 0x00000000,
VK_DESCRIPTOR_POOL_USAGE_DYNAMIC = 0x00000001,
VK_ENUM_RANGE(DESCRIPTOR_POOL_USAGE, ONE_SHOT, DYNAMIC)
} VkDescriptorPoolUsage;
typedef enum VkDescriptorUpdateMode_
{
VK_DESCRIPTOR_UPDATE_MODE_COPY = 0x00000000,
VK_DESCRIPTOR_UPDATE_MODE_FASTEST = 0x00000001,
VK_ENUM_RANGE(DESCRIPTOR_UPDATE_MODE, COPY, FASTEST)
} VkDescriptorUpdateMode;
typedef enum VkDescriptorSetUsage_
{
VK_DESCRIPTOR_SET_USAGE_ONE_SHOT = 0x00000000,
VK_DESCRIPTOR_SET_USAGE_STATIC = 0x00000001,
VK_ENUM_RANGE(DESCRIPTOR_SET_USAGE, ONE_SHOT, STATIC)
} VkDescriptorSetUsage;
typedef enum VkQueryType_
{
VK_QUERY_TYPE_OCCLUSION = 0x00000000,
VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, // Optional
VK_ENUM_RANGE(QUERY_TYPE, OCCLUSION, PIPELINE_STATISTICS)
} VkQueryType;
typedef enum VkTimestampType_
{
VK_TIMESTAMP_TYPE_TOP = 0x00000000,
VK_TIMESTAMP_TYPE_BOTTOM = 0x00000001,
VK_ENUM_RANGE(TIMESTAMP_TYPE, TOP, BOTTOM)
} VkTimestampType;
typedef enum VkBorderColor_
{
VK_BORDER_COLOR_OPAQUE_WHITE = 0x00000000,
VK_BORDER_COLOR_TRANSPARENT_BLACK = 0x00000001,
VK_BORDER_COLOR_OPAQUE_BLACK = 0x00000002,
VK_ENUM_RANGE(BORDER_COLOR, OPAQUE_WHITE, OPAQUE_BLACK)
} VkBorderColor;
typedef enum VkPipelineBindPoint_
{
VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000000,
VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000001,
VK_ENUM_RANGE(PIPELINE_BIND_POINT, COMPUTE, GRAPHICS)
} VkPipelineBindPoint;
typedef enum VkStateBindPoint_
{
VK_STATE_BIND_POINT_VIEWPORT = 0x00000000,
VK_STATE_BIND_POINT_RASTER = 0x00000001,
VK_STATE_BIND_POINT_COLOR_BLEND = 0x00000002,
VK_STATE_BIND_POINT_DEPTH_STENCIL = 0x00000003,
VK_ENUM_RANGE(STATE_BIND_POINT, VIEWPORT, DEPTH_STENCIL)
} VkStateBindPoint;
typedef enum VkPrimitiveTopology_
{
VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
VK_PRIMITIVE_TOPOLOGY_LINE_LIST_ADJ = 0x00000006,
VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_ADJ = 0x00000007,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_ADJ = 0x00000008,
VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_ADJ = 0x00000009,
VK_PRIMITIVE_TOPOLOGY_PATCH = 0x0000000a,
VK_ENUM_RANGE(PRIMITIVE_TOPOLOGY, POINT_LIST, PATCH)
} VkPrimitiveTopology;
typedef enum VkIndexType_
{
VK_INDEX_TYPE_UINT8 = 0x00000000,
VK_INDEX_TYPE_UINT16 = 0x00000001,
VK_INDEX_TYPE_UINT32 = 0x00000002,
VK_ENUM_RANGE(INDEX_TYPE, UINT8, UINT32)
} VkIndexType;
typedef enum VkTexFilter_
{
VK_TEX_FILTER_NEAREST = 0x00000000,
VK_TEX_FILTER_LINEAR = 0x00000001,
VK_ENUM_RANGE(TEX_FILTER, NEAREST, LINEAR)
} VkTexFilter;
typedef enum VkTexMipmapMode_
{
VK_TEX_MIPMAP_MODE_BASE = 0x00000000, // Always choose base level
VK_TEX_MIPMAP_MODE_NEAREST = 0x00000001, // Choose nearest mip level
VK_TEX_MIPMAP_MODE_LINEAR = 0x00000002, // Linear filter between mip levels
VK_ENUM_RANGE(TEX_MIPMAP_MODE, BASE, LINEAR)
} VkTexMipmapMode;
typedef enum VkTexAddress_
{
VK_TEX_ADDRESS_WRAP = 0x00000000,
VK_TEX_ADDRESS_MIRROR = 0x00000001,
VK_TEX_ADDRESS_CLAMP = 0x00000002,
VK_TEX_ADDRESS_MIRROR_ONCE = 0x00000003,
VK_TEX_ADDRESS_CLAMP_BORDER = 0x00000004,
VK_ENUM_RANGE(TEX_ADDRESS, WRAP, CLAMP_BORDER)
} VkTexAddress;
typedef enum VkCompareOp_
{
VK_COMPARE_OP_NEVER = 0x00000000,
VK_COMPARE_OP_LESS = 0x00000001,
VK_COMPARE_OP_EQUAL = 0x00000002,
VK_COMPARE_OP_LESS_EQUAL = 0x00000003,
VK_COMPARE_OP_GREATER = 0x00000004,
VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
VK_COMPARE_OP_GREATER_EQUAL = 0x00000006,
VK_COMPARE_OP_ALWAYS = 0x00000007,
VK_ENUM_RANGE(COMPARE_OP, NEVER, ALWAYS)
} VkCompareOp;
typedef enum VkFillMode_
{
VK_FILL_MODE_POINTS = 0x00000000,
VK_FILL_MODE_WIREFRAME = 0x00000001,
VK_FILL_MODE_SOLID = 0x00000002,
VK_ENUM_RANGE(FILL_MODE, POINTS, SOLID)
} VkFillMode;
typedef enum VkCullMode_
{
VK_CULL_MODE_NONE = 0x00000000,
VK_CULL_MODE_FRONT = 0x00000001,
VK_CULL_MODE_BACK = 0x00000002,
VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
VK_ENUM_RANGE(CULL_MODE, NONE, FRONT_AND_BACK)
} VkCullMode;
typedef enum VkFrontFace_
{
VK_FRONT_FACE_CCW = 0x00000000,
VK_FRONT_FACE_CW = 0x00000001,
VK_ENUM_RANGE(FRONT_FACE, CCW, CW)
} VkFrontFace;
typedef enum VkProvokingVertex_
{
VK_PROVOKING_VERTEX_FIRST = 0x00000000,
VK_PROVOKING_VERTEX_LAST = 0x00000001,
VK_ENUM_RANGE(PROVOKING_VERTEX, FIRST, LAST)
} VkProvokingVertex;
typedef enum VkCoordinateOrigin_
{
VK_COORDINATE_ORIGIN_UPPER_LEFT = 0x00000000,
VK_COORDINATE_ORIGIN_LOWER_LEFT = 0x00000001,
VK_ENUM_RANGE(COORDINATE_ORIGIN, UPPER_LEFT, LOWER_LEFT)
} VkCoordinateOrigin;
typedef enum VkDepthMode_
{
VK_DEPTH_MODE_ZERO_TO_ONE = 0x00000000,
VK_DEPTH_MODE_NEGATIVE_ONE_TO_ONE = 0x00000001,
VK_ENUM_RANGE(DEPTH_MODE, ZERO_TO_ONE, NEGATIVE_ONE_TO_ONE)
} VkDepthMode;
typedef enum VkBlend_
{
VK_BLEND_ZERO = 0x00000000,
VK_BLEND_ONE = 0x00000001,
VK_BLEND_SRC_COLOR = 0x00000002,
VK_BLEND_ONE_MINUS_SRC_COLOR = 0x00000003,
VK_BLEND_DEST_COLOR = 0x00000004,
VK_BLEND_ONE_MINUS_DEST_COLOR = 0x00000005,
VK_BLEND_SRC_ALPHA = 0x00000006,
VK_BLEND_ONE_MINUS_SRC_ALPHA = 0x00000007,
VK_BLEND_DEST_ALPHA = 0x00000008,
VK_BLEND_ONE_MINUS_DEST_ALPHA = 0x00000009,
VK_BLEND_CONSTANT_COLOR = 0x0000000a,
VK_BLEND_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
VK_BLEND_CONSTANT_ALPHA = 0x0000000c,
VK_BLEND_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
VK_BLEND_SRC_ALPHA_SATURATE = 0x0000000e,
VK_BLEND_SRC1_COLOR = 0x0000000f,
VK_BLEND_ONE_MINUS_SRC1_COLOR = 0x00000010,
VK_BLEND_SRC1_ALPHA = 0x00000011,
VK_BLEND_ONE_MINUS_SRC1_ALPHA = 0x00000012,
VK_ENUM_RANGE(BLEND, ZERO, ONE_MINUS_SRC1_ALPHA)
} VkBlend;
typedef enum VkBlendOp_
{
VK_BLEND_OP_ADD = 0x00000000,
VK_BLEND_OP_SUBTRACT = 0x00000001,
VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
VK_BLEND_OP_MIN = 0x00000003,
VK_BLEND_OP_MAX = 0x00000004,
VK_ENUM_RANGE(BLEND_OP, ADD, MAX)
} VkBlendOp;
typedef enum VkStencilOp_
{
VK_STENCIL_OP_KEEP = 0x00000000,
VK_STENCIL_OP_ZERO = 0x00000001,
VK_STENCIL_OP_REPLACE = 0x00000002,
VK_STENCIL_OP_INC_CLAMP = 0x00000003,
VK_STENCIL_OP_DEC_CLAMP = 0x00000004,
VK_STENCIL_OP_INVERT = 0x00000005,
VK_STENCIL_OP_INC_WRAP = 0x00000006,
VK_STENCIL_OP_DEC_WRAP = 0x00000007,
VK_ENUM_RANGE(STENCIL_OP, KEEP, DEC_WRAP)
} VkStencilOp;
typedef enum VkLogicOp_
{
VK_LOGIC_OP_COPY = 0x00000000,
VK_LOGIC_OP_CLEAR = 0x00000001,
VK_LOGIC_OP_AND = 0x00000002,
VK_LOGIC_OP_AND_REVERSE = 0x00000003,
VK_LOGIC_OP_AND_INVERTED = 0x00000004,
VK_LOGIC_OP_NOOP = 0x00000005,
VK_LOGIC_OP_XOR = 0x00000006,
VK_LOGIC_OP_OR = 0x00000007,
VK_LOGIC_OP_NOR = 0x00000008,
VK_LOGIC_OP_EQUIV = 0x00000009,
VK_LOGIC_OP_INVERT = 0x0000000a,
VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
VK_LOGIC_OP_NAND = 0x0000000e,
VK_LOGIC_OP_SET = 0x0000000f,
VK_ENUM_RANGE(LOGIC_OP, COPY, SET)
} VkLogicOp;
typedef enum VkSystemAllocType_
{
VK_SYSTEM_ALLOC_TYPE_API_OBJECT = 0x00000000,
VK_SYSTEM_ALLOC_TYPE_INTERNAL = 0x00000001,
VK_SYSTEM_ALLOC_TYPE_INTERNAL_TEMP = 0x00000002,
VK_SYSTEM_ALLOC_TYPE_INTERNAL_SHADER = 0x00000003,
VK_SYSTEM_ALLOC_TYPE_DEBUG = 0x00000004,
VK_ENUM_RANGE(SYSTEM_ALLOC_TYPE, API_OBJECT, DEBUG)
} VkSystemAllocType;
typedef enum VkPhysicalDeviceType_
{
VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
VK_ENUM_RANGE(PHYSICAL_DEVICE_TYPE, OTHER, CPU)
} VkPhysicalDeviceType;
typedef enum VkPhysicalDeviceInfoType_
{
// Info type for vkGetPhysicalDeviceInfo()
VK_PHYSICAL_DEVICE_INFO_TYPE_PROPERTIES = 0x00000000,
VK_PHYSICAL_DEVICE_INFO_TYPE_PERFORMANCE = 0x00000001,
VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES = 0x00000002,
VK_PHYSICAL_DEVICE_INFO_TYPE_MEMORY_PROPERTIES = 0x00000003,
VK_ENUM_RANGE(PHYSICAL_DEVICE_INFO_TYPE, PROPERTIES, MEMORY_PROPERTIES)
} VkPhysicalDeviceInfoType;
typedef enum VkExtensionInfoType_
{
// Info type for vkGetGlobalExtensionInfo() and vkGetPhysicalDeviceExtensionInfo()
VK_EXTENSION_INFO_TYPE_COUNT = 0x00000000,
VK_EXTENSION_INFO_TYPE_PROPERTIES = 0x00000001,
VK_ENUM_RANGE(EXTENSION_INFO_TYPE, COUNT, PROPERTIES)
} VkExtensionInfoType;
typedef enum VkFormatInfoType_
{
// Info type for vkGetFormatInfo()
VK_FORMAT_INFO_TYPE_PROPERTIES = 0x00000000,
VK_ENUM_RANGE(FORMAT_INFO_TYPE, PROPERTIES, PROPERTIES)
} VkFormatInfoType;
typedef enum VkSubresourceInfoType_
{
// Info type for vkGetImageSubresourceInfo()
VK_SUBRESOURCE_INFO_TYPE_LAYOUT = 0x00000000,
VK_ENUM_RANGE(SUBRESOURCE_INFO_TYPE, LAYOUT, LAYOUT)
} VkSubresourceInfoType;
typedef enum VkObjectInfoType_
{
// Info type for vkGetObjectInfo()
VK_OBJECT_INFO_TYPE_MEMORY_ALLOCATION_COUNT = 0x00000000,
VK_OBJECT_INFO_TYPE_MEMORY_REQUIREMENTS = 0x00000001,
VK_ENUM_RANGE(OBJECT_INFO_TYPE, MEMORY_ALLOCATION_COUNT, MEMORY_REQUIREMENTS)
} VkObjectInfoType;
typedef enum VkVertexInputStepRate_
{
VK_VERTEX_INPUT_STEP_RATE_VERTEX = 0x0,
VK_VERTEX_INPUT_STEP_RATE_INSTANCE = 0x1,
VK_VERTEX_INPUT_STEP_RATE_DRAW = 0x2, //Optional
VK_ENUM_RANGE(VERTEX_INPUT_STEP_RATE, VERTEX, DRAW)
} VkVertexInputStepRate;
// Vulkan format definitions
typedef enum VkFormat_
{
VK_FORMAT_UNDEFINED = 0x00000000,
VK_FORMAT_R4G4_UNORM = 0x00000001,
VK_FORMAT_R4G4_USCALED = 0x00000002,
VK_FORMAT_R4G4B4A4_UNORM = 0x00000003,
VK_FORMAT_R4G4B4A4_USCALED = 0x00000004,
VK_FORMAT_R5G6B5_UNORM = 0x00000005,
VK_FORMAT_R5G6B5_USCALED = 0x00000006,
VK_FORMAT_R5G5B5A1_UNORM = 0x00000007,
VK_FORMAT_R5G5B5A1_USCALED = 0x00000008,
VK_FORMAT_R8_UNORM = 0x00000009,
VK_FORMAT_R8_SNORM = 0x0000000A,
VK_FORMAT_R8_USCALED = 0x0000000B,
VK_FORMAT_R8_SSCALED = 0x0000000C,
VK_FORMAT_R8_UINT = 0x0000000D,
VK_FORMAT_R8_SINT = 0x0000000E,
VK_FORMAT_R8_SRGB = 0x0000000F,
VK_FORMAT_R8G8_UNORM = 0x00000010,
VK_FORMAT_R8G8_SNORM = 0x00000011,
VK_FORMAT_R8G8_USCALED = 0x00000012,
VK_FORMAT_R8G8_SSCALED = 0x00000013,
VK_FORMAT_R8G8_UINT = 0x00000014,
VK_FORMAT_R8G8_SINT = 0x00000015,
VK_FORMAT_R8G8_SRGB = 0x00000016,
VK_FORMAT_R8G8B8_UNORM = 0x00000017,
VK_FORMAT_R8G8B8_SNORM = 0x00000018,
VK_FORMAT_R8G8B8_USCALED = 0x00000019,
VK_FORMAT_R8G8B8_SSCALED = 0x0000001A,
VK_FORMAT_R8G8B8_UINT = 0x0000001B,
VK_FORMAT_R8G8B8_SINT = 0x0000001C,
VK_FORMAT_R8G8B8_SRGB = 0x0000001D,
VK_FORMAT_R8G8B8A8_UNORM = 0x0000001E,
VK_FORMAT_R8G8B8A8_SNORM = 0x0000001F,
VK_FORMAT_R8G8B8A8_USCALED = 0x00000020,
VK_FORMAT_R8G8B8A8_SSCALED = 0x00000021,
VK_FORMAT_R8G8B8A8_UINT = 0x00000022,
VK_FORMAT_R8G8B8A8_SINT = 0x00000023,
VK_FORMAT_R8G8B8A8_SRGB = 0x00000024,
VK_FORMAT_R10G10B10A2_UNORM = 0x00000025,
VK_FORMAT_R10G10B10A2_SNORM = 0x00000026,
VK_FORMAT_R10G10B10A2_USCALED = 0x00000027,
VK_FORMAT_R10G10B10A2_SSCALED = 0x00000028,
VK_FORMAT_R10G10B10A2_UINT = 0x00000029,
VK_FORMAT_R10G10B10A2_SINT = 0x0000002A,
VK_FORMAT_R16_UNORM = 0x0000002B,
VK_FORMAT_R16_SNORM = 0x0000002C,
VK_FORMAT_R16_USCALED = 0x0000002D,
VK_FORMAT_R16_SSCALED = 0x0000002E,
VK_FORMAT_R16_UINT = 0x0000002F,
VK_FORMAT_R16_SINT = 0x00000030,
VK_FORMAT_R16_SFLOAT = 0x00000031,
VK_FORMAT_R16G16_UNORM = 0x00000032,
VK_FORMAT_R16G16_SNORM = 0x00000033,
VK_FORMAT_R16G16_USCALED = 0x00000034,
VK_FORMAT_R16G16_SSCALED = 0x00000035,
VK_FORMAT_R16G16_UINT = 0x00000036,
VK_FORMAT_R16G16_SINT = 0x00000037,
VK_FORMAT_R16G16_SFLOAT = 0x00000038,
VK_FORMAT_R16G16B16_UNORM = 0x00000039,
VK_FORMAT_R16G16B16_SNORM = 0x0000003A,
VK_FORMAT_R16G16B16_USCALED = 0x0000003B,
VK_FORMAT_R16G16B16_SSCALED = 0x0000003C,
VK_FORMAT_R16G16B16_UINT = 0x0000003D,
VK_FORMAT_R16G16B16_SINT = 0x0000003E,
VK_FORMAT_R16G16B16_SFLOAT = 0x0000003F,
VK_FORMAT_R16G16B16A16_UNORM = 0x00000040,
VK_FORMAT_R16G16B16A16_SNORM = 0x00000041,
VK_FORMAT_R16G16B16A16_USCALED = 0x00000042,
VK_FORMAT_R16G16B16A16_SSCALED = 0x00000043,
VK_FORMAT_R16G16B16A16_UINT = 0x00000044,
VK_FORMAT_R16G16B16A16_SINT = 0x00000045,
VK_FORMAT_R16G16B16A16_SFLOAT = 0x00000046,
VK_FORMAT_R32_UINT = 0x00000047,
VK_FORMAT_R32_SINT = 0x00000048,
VK_FORMAT_R32_SFLOAT = 0x00000049,
VK_FORMAT_R32G32_UINT = 0x0000004A,
VK_FORMAT_R32G32_SINT = 0x0000004B,
VK_FORMAT_R32G32_SFLOAT = 0x0000004C,
VK_FORMAT_R32G32B32_UINT = 0x0000004D,
VK_FORMAT_R32G32B32_SINT = 0x0000004E,
VK_FORMAT_R32G32B32_SFLOAT = 0x0000004F,
VK_FORMAT_R32G32B32A32_UINT = 0x00000050,
VK_FORMAT_R32G32B32A32_SINT = 0x00000051,
VK_FORMAT_R32G32B32A32_SFLOAT = 0x00000052,
VK_FORMAT_R64_SFLOAT = 0x00000053,
VK_FORMAT_R64G64_SFLOAT = 0x00000054,
VK_FORMAT_R64G64B64_SFLOAT = 0x00000055,
VK_FORMAT_R64G64B64A64_SFLOAT = 0x00000056,
VK_FORMAT_R11G11B10_UFLOAT = 0x00000057,
VK_FORMAT_R9G9B9E5_UFLOAT = 0x00000058,
VK_FORMAT_D16_UNORM = 0x00000059,
VK_FORMAT_D24_UNORM = 0x0000005A,
VK_FORMAT_D32_SFLOAT = 0x0000005B,
VK_FORMAT_S8_UINT = 0x0000005C,
VK_FORMAT_D16_UNORM_S8_UINT = 0x0000005D,
VK_FORMAT_D24_UNORM_S8_UINT = 0x0000005E,
VK_FORMAT_D32_SFLOAT_S8_UINT = 0x0000005F,
VK_FORMAT_BC1_RGB_UNORM = 0x00000060,
VK_FORMAT_BC1_RGB_SRGB = 0x00000061,
VK_FORMAT_BC1_RGBA_UNORM = 0x00000062,
VK_FORMAT_BC1_RGBA_SRGB = 0x00000063,
VK_FORMAT_BC2_UNORM = 0x00000064,
VK_FORMAT_BC2_SRGB = 0x00000065,
VK_FORMAT_BC3_UNORM = 0x00000066,
VK_FORMAT_BC3_SRGB = 0x00000067,
VK_FORMAT_BC4_UNORM = 0x00000068,
VK_FORMAT_BC4_SNORM = 0x00000069,
VK_FORMAT_BC5_UNORM = 0x0000006A,
VK_FORMAT_BC5_SNORM = 0x0000006B,
VK_FORMAT_BC6H_UFLOAT = 0x0000006C,
VK_FORMAT_BC6H_SFLOAT = 0x0000006D,
VK_FORMAT_BC7_UNORM = 0x0000006E,
VK_FORMAT_BC7_SRGB = 0x0000006F,
VK_FORMAT_ETC2_R8G8B8_UNORM = 0x00000070,
VK_FORMAT_ETC2_R8G8B8_SRGB = 0x00000071,
VK_FORMAT_ETC2_R8G8B8A1_UNORM = 0x00000072,
VK_FORMAT_ETC2_R8G8B8A1_SRGB = 0x00000073,
VK_FORMAT_ETC2_R8G8B8A8_UNORM = 0x00000074,
VK_FORMAT_ETC2_R8G8B8A8_SRGB = 0x00000075,
VK_FORMAT_EAC_R11_UNORM = 0x00000076,
VK_FORMAT_EAC_R11_SNORM = 0x00000077,
VK_FORMAT_EAC_R11G11_UNORM = 0x00000078,
VK_FORMAT_EAC_R11G11_SNORM = 0x00000079,
VK_FORMAT_ASTC_4x4_UNORM = 0x0000007A,
VK_FORMAT_ASTC_4x4_SRGB = 0x0000007B,
VK_FORMAT_ASTC_5x4_UNORM = 0x0000007C,
VK_FORMAT_ASTC_5x4_SRGB = 0x0000007D,
VK_FORMAT_ASTC_5x5_UNORM = 0x0000007E,
VK_FORMAT_ASTC_5x5_SRGB = 0x0000007F,
VK_FORMAT_ASTC_6x5_UNORM = 0x00000080,
VK_FORMAT_ASTC_6x5_SRGB = 0x00000081,
VK_FORMAT_ASTC_6x6_UNORM = 0x00000082,
VK_FORMAT_ASTC_6x6_SRGB = 0x00000083,
VK_FORMAT_ASTC_8x5_UNORM = 0x00000084,
VK_FORMAT_ASTC_8x5_SRGB = 0x00000085,
VK_FORMAT_ASTC_8x6_UNORM = 0x00000086,
VK_FORMAT_ASTC_8x6_SRGB = 0x00000087,
VK_FORMAT_ASTC_8x8_UNORM = 0x00000088,
VK_FORMAT_ASTC_8x8_SRGB = 0x00000089,
VK_FORMAT_ASTC_10x5_UNORM = 0x0000008A,
VK_FORMAT_ASTC_10x5_SRGB = 0x0000008B,
VK_FORMAT_ASTC_10x6_UNORM = 0x0000008C,
VK_FORMAT_ASTC_10x6_SRGB = 0x0000008D,
VK_FORMAT_ASTC_10x8_UNORM = 0x0000008E,
VK_FORMAT_ASTC_10x8_SRGB = 0x0000008F,
VK_FORMAT_ASTC_10x10_UNORM = 0x00000090,
VK_FORMAT_ASTC_10x10_SRGB = 0x00000091,
VK_FORMAT_ASTC_12x10_UNORM = 0x00000092,
VK_FORMAT_ASTC_12x10_SRGB = 0x00000093,
VK_FORMAT_ASTC_12x12_UNORM = 0x00000094,
VK_FORMAT_ASTC_12x12_SRGB = 0x00000095,
VK_FORMAT_B4G4R4A4_UNORM = 0x00000096,
VK_FORMAT_B5G5R5A1_UNORM = 0x00000097,
VK_FORMAT_B5G6R5_UNORM = 0x00000098,
VK_FORMAT_B5G6R5_USCALED = 0x00000099,
VK_FORMAT_B8G8R8_UNORM = 0x0000009A,
VK_FORMAT_B8G8R8_SNORM = 0x0000009B,
VK_FORMAT_B8G8R8_USCALED = 0x0000009C,
VK_FORMAT_B8G8R8_SSCALED = 0x0000009D,
VK_FORMAT_B8G8R8_UINT = 0x0000009E,
VK_FORMAT_B8G8R8_SINT = 0x0000009F,
VK_FORMAT_B8G8R8_SRGB = 0x000000A0,
VK_FORMAT_B8G8R8A8_UNORM = 0x000000A1,
VK_FORMAT_B8G8R8A8_SNORM = 0x000000A2,
VK_FORMAT_B8G8R8A8_USCALED = 0x000000A3,
VK_FORMAT_B8G8R8A8_SSCALED = 0x000000A4,
VK_FORMAT_B8G8R8A8_UINT = 0x000000A5,
VK_FORMAT_B8G8R8A8_SINT = 0x000000A6,
VK_FORMAT_B8G8R8A8_SRGB = 0x000000A7,
VK_FORMAT_B10G10R10A2_UNORM = 0x000000A8,
VK_FORMAT_B10G10R10A2_SNORM = 0x000000A9,
VK_FORMAT_B10G10R10A2_USCALED = 0x000000AA,
VK_FORMAT_B10G10R10A2_SSCALED = 0x000000AB,
VK_FORMAT_B10G10R10A2_UINT = 0x000000AC,
VK_FORMAT_B10G10R10A2_SINT = 0x000000AD,
VK_ENUM_RANGE(FORMAT, UNDEFINED, B10G10R10A2_SINT)
} VkFormat;
// Shader stage enumerant
typedef enum VkShaderStage_
{
VK_SHADER_STAGE_VERTEX = 0,
VK_SHADER_STAGE_TESS_CONTROL = 1,
VK_SHADER_STAGE_TESS_EVALUATION = 2,
VK_SHADER_STAGE_GEOMETRY = 3,
VK_SHADER_STAGE_FRAGMENT = 4,
VK_SHADER_STAGE_COMPUTE = 5,
VK_ENUM_RANGE(SHADER_STAGE, VERTEX, COMPUTE)
} VkShaderStage;
// Structure type enumerant
typedef enum VkStructureType_
{
VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 1,
VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO = 2,
VK_STRUCTURE_TYPE_MEMORY_OPEN_INFO = 3,
VK_STRUCTURE_TYPE_PEER_MEMORY_OPEN_INFO = 4,
VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO = 5,
VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO = 6,
VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 7,
VK_STRUCTURE_TYPE_COLOR_ATTACHMENT_VIEW_CREATE_INFO = 8,
VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO = 9,
VK_STRUCTURE_TYPE_SHADER_CREATE_INFO = 10,
VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 11,
VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 12,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 13,
VK_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO = 14,
VK_STRUCTURE_TYPE_DYNAMIC_RS_STATE_CREATE_INFO = 15,
VK_STRUCTURE_TYPE_DYNAMIC_CB_STATE_CREATE_INFO = 16,
VK_STRUCTURE_TYPE_DYNAMIC_DS_STATE_CREATE_INFO = 17,
VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO = 18,
VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 19,
VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 20,
VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 21,
VK_STRUCTURE_TYPE_SEMAPHORE_OPEN_INFO = 22,
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 23,
VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 24,
VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 25,
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_CREATE_INFO = 26,
VK_STRUCTURE_TYPE_PIPELINE_IA_STATE_CREATE_INFO = 27,
VK_STRUCTURE_TYPE_PIPELINE_TESS_STATE_CREATE_INFO = 28,
VK_STRUCTURE_TYPE_PIPELINE_VP_STATE_CREATE_INFO = 29,
VK_STRUCTURE_TYPE_PIPELINE_RS_STATE_CREATE_INFO = 30,
VK_STRUCTURE_TYPE_PIPELINE_MS_STATE_CREATE_INFO = 31,
VK_STRUCTURE_TYPE_PIPELINE_CB_STATE_CREATE_INFO = 32,
VK_STRUCTURE_TYPE_PIPELINE_DS_STATE_CREATE_INFO = 33,
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 34,
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 35,
VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 36,
VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO = 38,
VK_STRUCTURE_TYPE_CMD_BUFFER_GRAPHICS_BEGIN_INFO = 39,
VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 40,
VK_STRUCTURE_TYPE_LAYER_CREATE_INFO = 41,
VK_STRUCTURE_TYPE_MEMORY_BARRIER = 42,
VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 43,
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 44,
VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 45,
VK_STRUCTURE_TYPE_UPDATE_SAMPLERS = 46,
VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES = 47,
VK_STRUCTURE_TYPE_UPDATE_IMAGES = 48,
VK_STRUCTURE_TYPE_UPDATE_BUFFERS = 49,
VK_STRUCTURE_TYPE_UPDATE_AS_COPY = 50,
VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 51,
VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 52,
VK_ENUM_RANGE(STRUCTURE_TYPE, APPLICATION_INFO, PIPELINE_LAYOUT_CREATE_INFO)
} VkStructureType;
// Object type enumerant
typedef enum VkObjectType_
{
VK_OBJECT_TYPE_INSTANCE = 0,
VK_OBJECT_TYPE_PHYSICAL_DEVICE = 1,
VK_OBJECT_TYPE_DEVICE = 2,
VK_OBJECT_TYPE_QUEUE = 3,
VK_OBJECT_TYPE_COMMAND_BUFFER = 4,
VK_OBJECT_TYPE_DEVICE_MEMORY = 5,
VK_OBJECT_TYPE_BUFFER = 6,
VK_OBJECT_TYPE_BUFFER_VIEW = 7,
VK_OBJECT_TYPE_IMAGE = 8,
VK_OBJECT_TYPE_IMAGE_VIEW = 9,
VK_OBJECT_TYPE_COLOR_ATTACHMENT_VIEW = 10,
VK_OBJECT_TYPE_DEPTH_STENCIL_VIEW = 11,
VK_OBJECT_TYPE_SHADER = 12,
VK_OBJECT_TYPE_PIPELINE = 13,
VK_OBJECT_TYPE_PIPELINE_LAYOUT = 14,
VK_OBJECT_TYPE_SAMPLER = 15,
VK_OBJECT_TYPE_DESCRIPTOR_SET = 16,
VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 17,
VK_OBJECT_TYPE_DESCRIPTOR_POOL = 18,
VK_OBJECT_TYPE_DYNAMIC_VP_STATE = 19,
VK_OBJECT_TYPE_DYNAMIC_RS_STATE = 20,
VK_OBJECT_TYPE_DYNAMIC_CB_STATE = 21,
VK_OBJECT_TYPE_DYNAMIC_DS_STATE = 22,
VK_OBJECT_TYPE_FENCE = 23,
VK_OBJECT_TYPE_SEMAPHORE = 24,
VK_OBJECT_TYPE_EVENT = 25,
VK_OBJECT_TYPE_QUERY_POOL = 26,
VK_OBJECT_TYPE_FRAMEBUFFER = 27,
VK_OBJECT_TYPE_RENDER_PASS = 28,
// Valid ranges for core Vulkan:
VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_INSTANCE,
VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_RENDER_PASS,
VK_NUM_OBJECT_TYPE = (VK_OBJECT_TYPE_END_RANGE - VK_OBJECT_TYPE_BEGIN_RANGE + 1),
VK_MAX_ENUM(VkObjectType)
} VkObjectType;
// ------------------------------------------------------------------------------------------------
// Error and return codes
typedef enum VkResult_
{
// Return codes for successful operation execution (> = 0)
VK_SUCCESS = 0x0000000,
VK_UNSUPPORTED = 0x0000001,
VK_NOT_READY = 0x0000002,
VK_TIMEOUT = 0x0000003,
VK_EVENT_SET = 0x0000004,
VK_EVENT_RESET = 0x0000005,
// Error codes (negative values)
VK_ERROR_UNKNOWN = -(0x00000001),
VK_ERROR_UNAVAILABLE = -(0x00000002),
VK_ERROR_INITIALIZATION_FAILED = -(0x00000003),
VK_ERROR_OUT_OF_HOST_MEMORY = -(0x00000004),
VK_ERROR_OUT_OF_DEVICE_MEMORY = -(0x00000005),
VK_ERROR_DEVICE_ALREADY_CREATED = -(0x00000006),
VK_ERROR_DEVICE_LOST = -(0x00000007),
VK_ERROR_INVALID_POINTER = -(0x00000008),
VK_ERROR_INVALID_VALUE = -(0x00000009),
VK_ERROR_INVALID_HANDLE = -(0x0000000A),
VK_ERROR_INVALID_ORDINAL = -(0x0000000B),
VK_ERROR_INVALID_MEMORY_SIZE = -(0x0000000C),
VK_ERROR_INVALID_EXTENSION = -(0x0000000D),
VK_ERROR_INVALID_FLAGS = -(0x0000000E),
VK_ERROR_INVALID_ALIGNMENT = -(0x0000000F),
VK_ERROR_INVALID_FORMAT = -(0x00000010),
VK_ERROR_INVALID_IMAGE = -(0x00000011),
VK_ERROR_INVALID_DESCRIPTOR_SET_DATA = -(0x00000012),
VK_ERROR_INVALID_QUEUE_TYPE = -(0x00000013),
VK_ERROR_INVALID_OBJECT_TYPE = -(0x00000014),
VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION = -(0x00000015),
VK_ERROR_BAD_SHADER_CODE = -(0x00000016),
VK_ERROR_BAD_PIPELINE_DATA = -(0x00000017),
VK_ERROR_TOO_MANY_MEMORY_REFERENCES = -(0x00000018),
VK_ERROR_NOT_MAPPABLE = -(0x00000019),
VK_ERROR_MEMORY_MAP_FAILED = -(0x0000001A),
VK_ERROR_MEMORY_UNMAP_FAILED = -(0x0000001B),
VK_ERROR_INCOMPATIBLE_DEVICE = -(0x0000001C),
VK_ERROR_INCOMPATIBLE_DRIVER = -(0x0000001D),
VK_ERROR_INCOMPLETE_COMMAND_BUFFER = -(0x0000001E),
VK_ERROR_BUILDING_COMMAND_BUFFER = -(0x0000001F),
VK_ERROR_MEMORY_NOT_BOUND = -(0x00000020),
VK_ERROR_INCOMPATIBLE_QUEUE = -(0x00000021),
VK_ERROR_NOT_SHAREABLE = -(0x00000022),
VK_MAX_ENUM(RESULT)
} VkResult;
// ------------------------------------------------------------------------------------------------
// Flags
// Device creation flags
typedef VkFlags VkDeviceCreateFlags;
typedef enum VkDeviceCreateFlagBits_
{
VK_DEVICE_CREATE_VALIDATION_BIT = VK_BIT(0),
VK_DEVICE_CREATE_MULTI_DEVICE_IQ_MATCH_BIT = VK_BIT(1),
} VkDeviceCreateFlagBits;
// Queue capabilities
typedef VkFlags VkQueueFlags;
typedef enum VkQueueFlagBits_
{
VK_QUEUE_GRAPHICS_BIT = VK_BIT(0), // Queue supports graphics operations
VK_QUEUE_COMPUTE_BIT = VK_BIT(1), // Queue supports compute operations
VK_QUEUE_DMA_BIT = VK_BIT(2), // Queue supports DMA operations
VK_QUEUE_MEMMGR_BIT = VK_BIT(3), // Queue supports memory management operations
VK_QUEUE_EXTENDED_BIT = VK_BIT(30), // Extended queue
} VkQueueFlagBits;
// Memory properties passed into vkAllocMemory().
typedef VkFlags VkMemoryPropertyFlags;
typedef enum VkMemoryPropertyFlagBits_
{
VK_MEMORY_PROPERTY_DEVICE_ONLY = 0, // If otherwise stated, then allocate memory on device
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = VK_BIT(0), // Memory should be mappable by host
VK_MEMORY_PROPERTY_HOST_DEVICE_COHERENT_BIT = VK_BIT(1), // Memory should be coherent between host and device accesses
VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT = VK_BIT(2), // Memory should not be cached by the host
VK_MEMORY_PROPERTY_HOST_WRITE_COMBINED_BIT = VK_BIT(3), // Memory should support host write combining
VK_MEMORY_PROPERTY_PREFER_HOST_LOCAL = VK_BIT(4), // If set, prefer host access
VK_MEMORY_PROPERTY_SHAREABLE_BIT = VK_BIT(5),
} VkMemoryPropertyFlagBits;
// Memory output flags passed to resource transition commands
typedef VkFlags VkMemoryOutputFlags;
typedef enum VkMemoryOutputFlagBits_
{
VK_MEMORY_OUTPUT_CPU_WRITE_BIT = VK_BIT(0), // Controls output coherency of CPU writes
VK_MEMORY_OUTPUT_SHADER_WRITE_BIT = VK_BIT(1), // Controls output coherency of generic shader writes
VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT = VK_BIT(2), // Controls output coherency of color attachment writes
VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT = VK_BIT(3), // Controls output coherency of depth/stencil attachment writes
VK_MEMORY_OUTPUT_TRANSFER_BIT = VK_BIT(4), // Controls output coherency of transfer operations
} VkMemoryOutputFlagBits;
// Memory input flags passed to resource transition commands
typedef VkFlags VkMemoryInputFlags;
typedef enum VkMemoryInputFlagBits_
{
VK_MEMORY_INPUT_CPU_READ_BIT = VK_BIT(0), // Controls input coherency of CPU reads
VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT = VK_BIT(1), // Controls input coherency of indirect command reads
VK_MEMORY_INPUT_INDEX_FETCH_BIT = VK_BIT(2), // Controls input coherency of index fetches
VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT = VK_BIT(3), // Controls input coherency of vertex attribute fetches
VK_MEMORY_INPUT_UNIFORM_READ_BIT = VK_BIT(4), // Controls input coherency of uniform buffer reads
VK_MEMORY_INPUT_SHADER_READ_BIT = VK_BIT(5), // Controls input coherency of generic shader reads
VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT = VK_BIT(6), // Controls input coherency of color attachment reads
VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT = VK_BIT(7), // Controls input coherency of depth/stencil attachment reads
VK_MEMORY_INPUT_TRANSFER_BIT = VK_BIT(8), // Controls input coherency of transfer operations
} VkMemoryInputFlagBits;
// Buffer usage flags
typedef VkFlags VkBufferUsageFlags;
typedef enum VkBufferUsageFlagBits_
{
VK_BUFFER_USAGE_GENERAL = 0, // No special usage
VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT = VK_BIT(0), // Can be used as a source of transfer operations
VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT = VK_BIT(1), // Can be used as a destination of transfer operations
VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = VK_BIT(2), // Can be used as TBO
VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = VK_BIT(3), // Can be used as IBO
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = VK_BIT(4), // Can be used as UBO
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = VK_BIT(5), // Can be used as SSBO
VK_BUFFER_USAGE_INDEX_BUFFER_BIT = VK_BIT(6), // Can be used as source of fixed function index fetch (index buffer)
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = VK_BIT(7), // Can be used as source of fixed function vertex fetch (VBO)
VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = VK_BIT(8), // Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
} VkBufferUsageFlagBits;
// Buffer creation flags
typedef VkFlags VkBufferCreateFlags;
typedef enum VkBufferCreateFlagBits_
{
VK_BUFFER_CREATE_SHAREABLE_BIT = VK_BIT(0), // Buffer should be shareable
VK_BUFFER_CREATE_SPARSE_BIT = VK_BIT(1), // Buffer should support sparse backing
} VkBufferCreateFlagBits;
// Shader stage flags
typedef VkFlags VkShaderStageFlags;
typedef enum VkShaderStageFlagBits_
{
VK_SHADER_STAGE_VERTEX_BIT = VK_BIT(0),
VK_SHADER_STAGE_TESS_CONTROL_BIT = VK_BIT(1),
VK_SHADER_STAGE_TESS_EVALUATION_BIT = VK_BIT(2),
VK_SHADER_STAGE_GEOMETRY_BIT = VK_BIT(3),
VK_SHADER_STAGE_FRAGMENT_BIT = VK_BIT(4),
VK_SHADER_STAGE_COMPUTE_BIT = VK_BIT(5),
VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
} VkShaderStageFlagBits;
// Image usage flags
typedef VkFlags VkImageUsageFlags;
typedef enum VkImageUsageFlagBits_
{
VK_IMAGE_USAGE_GENERAL = 0, // No special usage
VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT = VK_BIT(0), // Can be used as a source of transfer operations
VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT = VK_BIT(1), // Can be used as a destination of transfer operations
VK_IMAGE_USAGE_SAMPLED_BIT = VK_BIT(2), // Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
VK_IMAGE_USAGE_STORAGE_BIT = VK_BIT(3), // Can be used as storage image (STORAGE_IMAGE descriptor type)
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = VK_BIT(4), // Can be used as framebuffer color attachment
VK_IMAGE_USAGE_DEPTH_STENCIL_BIT = VK_BIT(5), // Can be used as framebuffer depth/stencil attachment
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = VK_BIT(6), // Image data not needed outside of rendering
} VkImageUsageFlagBits;
// Image creation flags
typedef VkFlags VkImageCreateFlags;
typedef enum VkImageCreateFlagBits_
{
VK_IMAGE_CREATE_INVARIANT_DATA_BIT = VK_BIT(0),
VK_IMAGE_CREATE_CLONEABLE_BIT = VK_BIT(1),
VK_IMAGE_CREATE_SHAREABLE_BIT = VK_BIT(2), // Image should be shareable
VK_IMAGE_CREATE_SPARSE_BIT = VK_BIT(3), // Image should support sparse backing
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = VK_BIT(4), // Allows image views to have different format than the base image
VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = VK_BIT(5), // Allows creating image views with cube type from the created image
} VkImageCreateFlagBits;
// Depth-stencil view creation flags
typedef VkFlags VkDepthStencilViewCreateFlags;
typedef enum VkDepthStencilViewCreateFlagBits_
{
VK_DEPTH_STENCIL_VIEW_CREATE_READ_ONLY_DEPTH_BIT = VK_BIT(0),
VK_DEPTH_STENCIL_VIEW_CREATE_READ_ONLY_STENCIL_BIT = VK_BIT(1),
} VkDepthStencilViewCreateFlagBits;
// Pipeline creation flags
typedef VkFlags VkPipelineCreateFlags;
typedef enum VkPipelineCreateFlagBits_
{
VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = VK_BIT(0),
VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = VK_BIT(1),
} VkPipelineCreateFlagBits;
// Channel flags
typedef VkFlags VkChannelFlags;
typedef enum VkChannelFlagBits_
{
VK_CHANNEL_R_BIT = VK_BIT(0),
VK_CHANNEL_G_BIT = VK_BIT(1),
VK_CHANNEL_B_BIT = VK_BIT(2),
VK_CHANNEL_A_BIT = VK_BIT(3),
} VkChannelFlagBits;
// Fence creation flags
typedef VkFlags VkFenceCreateFlags;
typedef enum VkFenceCreateFlagBits_
{
VK_FENCE_CREATE_SIGNALED_BIT = VK_BIT(0),
} VkFenceCreateFlagBits;
// Semaphore creation flags
typedef VkFlags VkSemaphoreCreateFlags;
typedef enum VkSemaphoreCreateFlagBits_
{
VK_SEMAPHORE_CREATE_SHAREABLE_BIT = VK_BIT(0),
} VkSemaphoreCreateFlagBits;
// Format capability flags
typedef VkFlags VkFormatFeatureFlags;
typedef enum VkFormatFeatureFlagBits_
{
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = VK_BIT(0), // Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = VK_BIT(1), // Format can be used for storage images (STORAGE_IMAGE descriptor type)
VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = VK_BIT(2), // Format supports atomic operations in case it's used for storage images
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = VK_BIT(3), // Format can be used for uniform texel buffers (TBOs)
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = VK_BIT(4), // Format can be used for storage texel buffers (IBOs)
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = VK_BIT(5), // Format supports atomic operations in case it's used for storage texel buffers
VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = VK_BIT(6), // Format can be used for vertex buffers (VBOs)
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = VK_BIT(7), // Format can be used for color attachment images
VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = VK_BIT(8), // Format supports blending in case it's used for color attachment images
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = VK_BIT(9), // Format can be used for depth/stencil attachment images
VK_FORMAT_FEATURE_CONVERSION_BIT = VK_BIT(10), // Format can be used as the source or destination of format converting blits
} VkFormatFeatureFlagBits;
// Query control flags
typedef VkFlags VkQueryControlFlags;
typedef enum VkQueryControlFlagBits_
{
VK_QUERY_CONTROL_CONSERVATIVE_BIT = VK_BIT(0), // Allow conservative results to be collected by the query
} VkQueryControlFlagBits;
// Query result flags
typedef VkFlags VkQueryResultFlags;
typedef enum VkQueryResultFlagBits_
{
VK_QUERY_RESULT_32_BIT = 0, // Results of the queries are written to the destination buffer as 32-bit values
VK_QUERY_RESULT_64_BIT = VK_BIT(0), // Results of the queries are written to the destination buffer as 64-bit values
VK_QUERY_RESULT_NO_WAIT_BIT = 0, // Results of the queries aren't waited on before proceeding with the result copy
VK_QUERY_RESULT_WAIT_BIT = VK_BIT(1), // Results of the queries are waited on before proceeding with the result copy
VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = VK_BIT(2), // Besides the results of the query, the availability of the results is also written
VK_QUERY_RESULT_PARTIAL_BIT = VK_BIT(3), // Copy the partial results of the query even if the final results aren't available
} VkQueryResultFlagBits;
// Physical device compatibility flags
typedef VkFlags VkPhysicalDeviceCompatibilityFlags;
typedef enum VkPhysicalDeviceCompatibilityFlagBits_
{
VK_PHYSICAL_DEVICE_COMPATIBILITY_FEATURES_BIT = VK_BIT(0),
VK_PHYSICAL_DEVICE_COMPATIBILITY_IQ_MATCH_BIT = VK_BIT(1),
VK_PHYSICAL_DEVICE_COMPATIBILITY_PEER_TRANSFER_BIT = VK_BIT(2),
VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_MEMORY_BIT = VK_BIT(3),
VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_SYNC_BIT = VK_BIT(4),
VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_DEVICE0_DISPLAY_BIT = VK_BIT(5),
VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_DEVICE1_DISPLAY_BIT = VK_BIT(6),
} VkPhysicalDeviceCompatibilityFlagBits;
// Shader creation flags
typedef VkFlags VkShaderCreateFlags;
// Event creation flags
typedef VkFlags VkEventCreateFlags;
// Command buffer creation flags
typedef VkFlags VkCmdBufferCreateFlags;
// Command buffer optimization flags
typedef VkFlags VkCmdBufferOptimizeFlags;
typedef enum VkCmdBufferOptimizeFlagBits_
{
VK_CMD_BUFFER_OPTIMIZE_SMALL_BATCH_BIT = VK_BIT(0),
VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT = VK_BIT(1),
VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT = VK_BIT(2),
VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT = VK_BIT(3),
} VkCmdBufferOptimizeFlagBits;
// Pipeline statistics flags
typedef VkFlags VkQueryPipelineStatisticFlags;
typedef enum VkQueryPipelineStatisticFlagBits_ {
VK_QUERY_PIPELINE_STATISTIC_IA_VERTICES_BIT = VK_BIT(0), // Optional
VK_QUERY_PIPELINE_STATISTIC_IA_PRIMITIVES_BIT = VK_BIT(1), // Optional
VK_QUERY_PIPELINE_STATISTIC_VS_INVOCATIONS_BIT = VK_BIT(2), // Optional
VK_QUERY_PIPELINE_STATISTIC_GS_INVOCATIONS_BIT = VK_BIT(3), // Optional
VK_QUERY_PIPELINE_STATISTIC_GS_PRIMITIVES_BIT = VK_BIT(4), // Optional
VK_QUERY_PIPELINE_STATISTIC_C_INVOCATIONS_BIT = VK_BIT(5), // Optional
VK_QUERY_PIPELINE_STATISTIC_C_PRIMITIVES_BIT = VK_BIT(6), // Optional
VK_QUERY_PIPELINE_STATISTIC_FS_INVOCATIONS_BIT = VK_BIT(7), // Optional
VK_QUERY_PIPELINE_STATISTIC_TCS_PATCHES_BIT = VK_BIT(8), // Optional
VK_QUERY_PIPELINE_STATISTIC_TES_INVOCATIONS_BIT = VK_BIT(9), // Optional
VK_QUERY_PIPELINE_STATISTIC_CS_INVOCATIONS_BIT = VK_BIT(10), // Optional
} VkQueryPipelineStatisticFlagBits;
// Memory mapping flags
typedef VkFlags VkMemoryMapFlags;
// ------------------------------------------------------------------------------------------------
// Vulkan structures
typedef struct VkOffset2D_
{
int32_t x;
int32_t y;
} VkOffset2D;
typedef struct VkOffset3D_
{
int32_t x;
int32_t y;
int32_t z;
} VkOffset3D;
typedef struct VkExtent2D_
{
int32_t width;
int32_t height;
} VkExtent2D;
typedef struct VkExtent3D_
{
int32_t width;
int32_t height;
int32_t depth;
} VkExtent3D;
typedef struct VkViewport_
{
float originX;
float originY;
float width;
float height;
float minDepth;
float maxDepth;
} VkViewport;
typedef struct VkRect_
{
VkOffset2D offset;
VkExtent2D extent;
} VkRect;
typedef struct VkChannelMapping_
{
VkChannelSwizzle r;
VkChannelSwizzle g;
VkChannelSwizzle b;
VkChannelSwizzle a;
} VkChannelMapping;
typedef struct VkPhysicalDeviceProperties_
{
uint32_t apiVersion;
uint32_t driverVersion;
uint32_t vendorId;
uint32_t deviceId;
VkPhysicalDeviceType deviceType;
char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME];
VkDeviceSize maxInlineMemoryUpdateSize;
uint32_t maxBoundDescriptorSets;
uint32_t maxThreadGroupSize;
uint64_t timestampFrequency;
bool32_t multiColorAttachmentClears;
uint32_t maxDescriptorSets; // at least 2?
uint32_t maxViewports; // at least 16?
uint32_t maxColorAttachments; // at least 8?
} VkPhysicalDeviceProperties;
typedef struct VkPhysicalDevicePerformance_
{
float maxDeviceClock;
float aluPerClock;
float texPerClock;
float primsPerClock;
float pixelsPerClock;
} VkPhysicalDevicePerformance;
typedef struct VkPhysicalDeviceCompatibilityInfo_
{
VkPhysicalDeviceCompatibilityFlags compatibilityFlags;
} VkPhysicalDeviceCompatibilityInfo;
typedef struct VkExtensionProperties_
{
char extName[VK_MAX_EXTENSION_NAME]; // extension name
uint32_t version; // version of the extension specification
} VkExtensionProperties;
typedef struct VkApplicationInfo_
{
VkStructureType sType; // Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
const void* pNext; // Next structure in chain
const char* pAppName;
uint32_t appVersion;
const char* pEngineName;
uint32_t engineVersion;
uint32_t apiVersion;
} VkApplicationInfo;
typedef void* (VKAPI *PFN_vkAllocFunction)(
void* pUserData,
size_t size,
size_t alignment,
VkSystemAllocType allocType);
typedef void (VKAPI *PFN_vkFreeFunction)(
void* pUserData,
void* pMem);
typedef struct VkAllocCallbacks_
{
void* pUserData;
PFN_vkAllocFunction pfnAlloc;
PFN_vkFreeFunction pfnFree;
} VkAllocCallbacks;
typedef struct VkDeviceQueueCreateInfo_
{
uint32_t queueNodeIndex;
uint32_t queueCount;
} VkDeviceQueueCreateInfo;
typedef struct VkDeviceCreateInfo_
{
VkStructureType sType; // Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t queueRecordCount;
const VkDeviceQueueCreateInfo* pRequestedQueues;
uint32_t extensionCount;
const char*const* ppEnabledExtensionNames;
VkDeviceCreateFlags flags; // Device creation flags
} VkDeviceCreateInfo;
typedef struct VkInstanceCreateInfo_
{
VkStructureType sType; // Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
const void* pNext; // Pointer to next structure
const VkApplicationInfo* pAppInfo;
const VkAllocCallbacks* pAllocCb;
uint32_t extensionCount;
const char*const* ppEnabledExtensionNames; // layer or extension name to be enabled
} VkInstanceCreateInfo;
// can be added to VkDeviceCreateInfo via pNext
typedef struct VkLayerCreateInfo_
{
VkStructureType sType; // Should be VK_STRUCTURE_TYPE_LAYER_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t layerCount;
const char *const* ppActiveLayerNames; // layer name from the layer's vkEnumerateLayers())
} VkLayerCreateInfo;
typedef struct VkPhysicalDeviceQueueProperties_
{
VkQueueFlags queueFlags; // Queue flags
uint32_t queueCount;
uint32_t maxAtomicCounters;
bool32_t supportsTimestamps;
uint32_t maxMemReferences; // Tells how many memory references can be active for the given queue
} VkPhysicalDeviceQueueProperties;
typedef struct VkPhysicalDeviceMemoryProperties_
{
bool32_t supportsMigration;
bool32_t supportsPinning;
} VkPhysicalDeviceMemoryProperties;
typedef struct VkMemoryAllocInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO
const void* pNext; // Pointer to next structure
VkDeviceSize allocationSize; // Size of memory allocation
VkMemoryPropertyFlags memProps; // Memory property flags
VkMemoryPriority memPriority;
} VkMemoryAllocInfo;
typedef struct VkMemoryOpenInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_MEMORY_OPEN_INFO
const void* pNext; // Pointer to next structure
VkDeviceMemory sharedMem;
} VkMemoryOpenInfo;
typedef struct VkPeerMemoryOpenInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PEER_MEMORY_OPEN_INFO
const void* pNext; // Pointer to next structure
VkDeviceMemory originalMem;
} VkPeerMemoryOpenInfo;
typedef struct VkMemoryRequirements_
{
VkDeviceSize size; // Specified in bytes
VkDeviceSize alignment; // Specified in bytes
VkDeviceSize granularity; // Granularity on which vkQueueBindObjectMemoryRange can bind sub-ranges of memory specified in bytes (usually the page size)
VkMemoryPropertyFlags memPropsAllowed; // Allowed memory property flags
VkMemoryPropertyFlags memPropsRequired; // Required memory property flags
} VkMemoryRequirements;
typedef struct VkFormatProperties_
{
VkFormatFeatureFlags linearTilingFeatures; // Format features in case of linear tiling
VkFormatFeatureFlags optimalTilingFeatures; // Format features in case of optimal tiling
} VkFormatProperties;
typedef struct VkBufferViewAttachInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_ATTACH_INFO
const void* pNext; // Pointer to next structure
VkBufferView view;
} VkBufferViewAttachInfo;
typedef struct VkImageViewAttachInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_ATTACH_INFO
const void* pNext; // Pointer to next structure
VkImageView view;
VkImageLayout layout;
} VkImageViewAttachInfo;
typedef struct VkUpdateSamplers_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_UPDATE_SAMPLERS
const void* pNext; // Pointer to next structure
uint32_t binding; // Binding of the sampler (array)
uint32_t arrayIndex; // First element of the array to update or zero otherwise
uint32_t count; // Number of elements to update
const VkSampler* pSamplers;
} VkUpdateSamplers;
typedef struct VkSamplerImageViewInfo_
{
VkSampler sampler;
const VkImageViewAttachInfo* pImageView;
} VkSamplerImageViewInfo;
typedef struct VkUpdateSamplerTextures_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_UPDATE_SAMPLER_TEXTURES
const void* pNext; // Pointer to next structure
uint32_t binding; // Binding of the combined texture sampler (array)
uint32_t arrayIndex; // First element of the array to update or zero otherwise
uint32_t count; // Number of elements to update
const VkSamplerImageViewInfo* pSamplerImageViews;
} VkUpdateSamplerTextures;
typedef struct VkUpdateImages_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_UPDATE_IMAGES
const void* pNext; // Pointer to next structure
VkDescriptorType descriptorType;
uint32_t binding; // Binding of the image (array)
uint32_t arrayIndex; // First element of the array to update or zero otherwise
uint32_t count; // Number of elements to update
const VkImageViewAttachInfo* pImageViews;
} VkUpdateImages;
typedef struct VkUpdateBuffers_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_UPDATE_BUFFERS
const void* pNext; // Pointer to next structure
VkDescriptorType descriptorType;
uint32_t binding; // Binding of the buffer (array)
uint32_t arrayIndex; // First element of the array to update or zero otherwise
uint32_t count; // Number of elements to update
const VkBufferViewAttachInfo* pBufferViews;
} VkUpdateBuffers;
typedef struct VkUpdateAsCopy_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_UPDATE_AS_COPY
const void* pNext; // Pointer to next structure
VkDescriptorType descriptorType;
VkDescriptorSet descriptorSet;
uint32_t binding;
uint32_t arrayElement;
uint32_t count;
} VkUpdateAsCopy;
typedef struct VkBufferCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
const void* pNext; // Pointer to next structure.
VkDeviceSize size; // Specified in bytes
VkBufferUsageFlags usage; // Buffer usage flags
VkBufferCreateFlags flags; // Buffer creation flags
} VkBufferCreateInfo;
typedef struct VkBufferViewCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
const void* pNext; // Pointer to next structure.
VkBuffer buffer;
VkBufferViewType viewType;
VkFormat format; // Optionally specifies format of elements
VkDeviceSize offset; // Specified in bytes
VkDeviceSize range; // View size specified in bytes
} VkBufferViewCreateInfo;
typedef struct VkImageSubresource_
{
VkImageAspect aspect;
uint32_t mipLevel;
uint32_t arraySlice;
} VkImageSubresource;
typedef struct VkImageSubresourceRange_
{
VkImageAspect aspect;
uint32_t baseMipLevel;
uint32_t mipLevels;
uint32_t baseArraySlice;
uint32_t arraySize;
} VkImageSubresourceRange;
typedef struct VkMemoryBarrier_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
const void* pNext; // Pointer to next structure.
VkMemoryOutputFlags outputMask; // Outputs the barrier should sync
VkMemoryInputFlags inputMask; // Inputs the barrier should sync to
} VkMemoryBarrier;
typedef struct VkBufferMemoryBarrier_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
const void* pNext; // Pointer to next structure.
VkMemoryOutputFlags outputMask; // Outputs the barrier should sync
VkMemoryInputFlags inputMask; // Inputs the barrier should sync to
VkBuffer buffer; // Buffer to sync
VkDeviceSize offset; // Offset within the buffer to sync
VkDeviceSize size; // Amount of bytes to sync
} VkBufferMemoryBarrier;
typedef struct VkImageMemoryBarrier_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
const void* pNext; // Pointer to next structure.
VkMemoryOutputFlags outputMask; // Outputs the barrier should sync
VkMemoryInputFlags inputMask; // Inputs the barrier should sync to
VkImageLayout oldLayout; // Current layout of the image
VkImageLayout newLayout; // New layout to transition the image to
VkImage image; // Image to sync
VkImageSubresourceRange subresourceRange; // Subresource range to sync
} VkImageMemoryBarrier;
typedef struct VkImageCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
const void* pNext; // Pointer to next structure.
VkImageType imageType;
VkFormat format;
VkExtent3D extent;
uint32_t mipLevels;
uint32_t arraySize;
uint32_t samples;
VkImageTiling tiling;
VkImageUsageFlags usage; // Image usage flags
VkImageCreateFlags flags; // Image creation flags
} VkImageCreateInfo;
typedef struct VkPeerImageOpenInfo_
{
VkImage originalImage;
} VkPeerImageOpenInfo;
typedef struct VkSubresourceLayout_
{
VkDeviceSize offset; // Specified in bytes
VkDeviceSize size; // Specified in bytes
VkDeviceSize rowPitch; // Specified in bytes
VkDeviceSize depthPitch; // Specified in bytes
} VkSubresourceLayout;
typedef struct VkImageViewCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
const void* pNext; // Pointer to next structure
VkImage image;
VkImageViewType viewType;
VkFormat format;
VkChannelMapping channels;
VkImageSubresourceRange subresourceRange;
float minLod;
} VkImageViewCreateInfo;
typedef struct VkColorAttachmentViewCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_COLOR_ATTACHMENT_VIEW_CREATE_INFO
const void* pNext; // Pointer to next structure
VkImage image;
VkFormat format;
uint32_t mipLevel;
uint32_t baseArraySlice;
uint32_t arraySize;
VkImage msaaResolveImage;
VkImageSubresourceRange msaaResolveSubResource;
} VkColorAttachmentViewCreateInfo;
typedef struct VkDepthStencilViewCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DEPTH_STENCIL_VIEW_CREATE_INFO
const void* pNext; // Pointer to next structure
VkImage image;
uint32_t mipLevel;
uint32_t baseArraySlice;
uint32_t arraySize;
VkImage msaaResolveImage;
VkImageSubresourceRange msaaResolveSubResource;
VkDepthStencilViewCreateFlags flags; // Depth stencil attachment view flags
} VkDepthStencilViewCreateInfo;
typedef struct VkColorAttachmentBindInfo_
{
VkColorAttachmentView view;
VkImageLayout layout;
} VkColorAttachmentBindInfo;
typedef struct VkDepthStencilBindInfo_
{
VkDepthStencilView view;
VkImageLayout layout;
} VkDepthStencilBindInfo;
typedef struct VkBufferCopy_
{
VkDeviceSize srcOffset; // Specified in bytes
VkDeviceSize destOffset; // Specified in bytes
VkDeviceSize copySize; // Specified in bytes
} VkBufferCopy;
typedef struct VkImageMemoryBindInfo_
{
VkImageSubresource subresource;
VkOffset3D offset;
VkExtent3D extent;
} VkImageMemoryBindInfo;
typedef struct VkImageCopy_
{
VkImageSubresource srcSubresource;
VkOffset3D srcOffset; // Specified in pixels for both compressed and uncompressed images
VkImageSubresource destSubresource;
VkOffset3D destOffset; // Specified in pixels for both compressed and uncompressed images
VkExtent3D extent; // Specified in pixels for both compressed and uncompressed images
} VkImageCopy;
typedef struct VkImageBlit_
{
VkImageSubresource srcSubresource;
VkOffset3D srcOffset; // Specified in pixels for both compressed and uncompressed images
VkExtent3D srcExtent; // Specified in pixels for both compressed and uncompressed images
VkImageSubresource destSubresource;
VkOffset3D destOffset; // Specified in pixels for both compressed and uncompressed images
VkExtent3D destExtent; // Specified in pixels for both compressed and uncompressed images
} VkImageBlit;
typedef struct VkBufferImageCopy_
{
VkDeviceSize bufferOffset; // Specified in bytes
VkImageSubresource imageSubresource;
VkOffset3D imageOffset; // Specified in pixels for both compressed and uncompressed images
VkExtent3D imageExtent; // Specified in pixels for both compressed and uncompressed images
} VkBufferImageCopy;
typedef struct VkImageResolve_
{
VkImageSubresource srcSubresource;
VkOffset3D srcOffset;
VkImageSubresource destSubresource;
VkOffset3D destOffset;
VkExtent3D extent;
} VkImageResolve;
typedef struct VkShaderCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_SHADER_CREATE_INFO
const void* pNext; // Pointer to next structure
size_t codeSize; // Specified in bytes
const void* pCode;
VkShaderCreateFlags flags; // Reserved
} VkShaderCreateInfo;
typedef struct VkDescriptorSetLayoutBinding_
{
VkDescriptorType descriptorType; // Type of the descriptors in this binding
uint32_t count; // Number of descriptors in this binding
VkShaderStageFlags stageFlags; // Shader stages this binding is visible to
const VkSampler* pImmutableSamplers; // Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
} VkDescriptorSetLayoutBinding;
typedef struct VkDescriptorSetLayoutCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t count; // Number of bindings in the descriptor set layout
const VkDescriptorSetLayoutBinding* pBinding; // Array of descriptor set layout bindings
} VkDescriptorSetLayoutCreateInfo;
typedef struct VkDescriptorTypeCount_
{
VkDescriptorType type;
uint32_t count;
} VkDescriptorTypeCount;
typedef struct VkDescriptorPoolCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t count;
const VkDescriptorTypeCount* pTypeCount;
} VkDescriptorPoolCreateInfo;
typedef struct VkLinkConstBuffer_
{
uint32_t bufferId;
size_t bufferSize;
const void* pBufferData;
} VkLinkConstBuffer;
typedef struct VkSpecializationMapEntry_
{
uint32_t constantId; // The SpecConstant ID specified in the BIL
uint32_t offset; // Offset of the value in the data block
} VkSpecializationMapEntry;
typedef struct VkSpecializationInfo_
{
uint32_t mapEntryCount;
const VkSpecializationMapEntry* pMap; // mapEntryCount entries
const void* pData;
} VkSpecializationInfo;
typedef struct VkPipelineShader_
{
VkShaderStage stage;
VkShader shader;
uint32_t linkConstBufferCount;
const VkLinkConstBuffer* pLinkConstBufferInfo;
const VkSpecializationInfo* pSpecializationInfo;
} VkPipelineShader;
typedef struct VkComputePipelineCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
const void* pNext; // Pointer to next structure
VkPipelineShader cs;
VkPipelineCreateFlags flags; // Pipeline creation flags
VkPipelineLayout layout; // Interface layout of the pipeline
} VkComputePipelineCreateInfo;
typedef struct VkVertexInputBindingDescription_
{
uint32_t binding; // Vertex buffer binding id
uint32_t strideInBytes; // Distance between vertices in bytes (0 = no advancement)
VkVertexInputStepRate stepRate; // Rate at which binding is incremented
} VkVertexInputBindingDescription;
typedef struct VkVertexInputAttributeDescription_
{
uint32_t location; // location of the shader vertex attrib
uint32_t binding; // Vertex buffer binding id
VkFormat format; // format of source data
uint32_t offsetInBytes; // Offset of first element in bytes from base of vertex
} VkVertexInputAttributeDescription;
typedef struct VkPipelineVertexInputCreateInfo_
{
VkStructureType sType; // Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t bindingCount; // number of bindings
const VkVertexInputBindingDescription* pVertexBindingDescriptions;
uint32_t attributeCount; // number of attributes
const VkVertexInputAttributeDescription* pVertexAttributeDescriptions;
} VkPipelineVertexInputCreateInfo;
typedef struct VkPipelineIaStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_IA_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
VkPrimitiveTopology topology;
bool32_t disableVertexReuse; // optional
bool32_t primitiveRestartEnable;
uint32_t primitiveRestartIndex; // optional (GL45)
} VkPipelineIaStateCreateInfo;
typedef struct VkPipelineTessStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_TESS_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t patchControlPoints;
} VkPipelineTessStateCreateInfo;
typedef struct VkPipelineVpStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_VP_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t viewportCount;
VkCoordinateOrigin clipOrigin; // optional (GL45)
VkDepthMode depthMode; // optional (GL45)
} VkPipelineVpStateCreateInfo;
typedef struct VkPipelineRsStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_RS_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
bool32_t depthClipEnable;
bool32_t rasterizerDiscardEnable;
bool32_t programPointSize; // optional (GL45)
VkCoordinateOrigin pointOrigin; // optional (GL45)
VkProvokingVertex provokingVertex; // optional (GL45)
VkFillMode fillMode; // optional (GL45)
VkCullMode cullMode;
VkFrontFace frontFace;
} VkPipelineRsStateCreateInfo;
typedef struct VkPipelineMsStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_MS_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t samples;
bool32_t multisampleEnable; // optional (GL45)
bool32_t sampleShadingEnable; // optional (GL45)
float minSampleShading; // optional (GL45)
VkSampleMask sampleMask;
} VkPipelineMsStateCreateInfo;
typedef struct VkPipelineCbAttachmentState_
{
bool32_t blendEnable;
VkFormat format;
VkBlend srcBlendColor;
VkBlend destBlendColor;
VkBlendOp blendOpColor;
VkBlend srcBlendAlpha;
VkBlend destBlendAlpha;
VkBlendOp blendOpAlpha;
VkChannelFlags channelWriteMask;
} VkPipelineCbAttachmentState;
typedef struct VkPipelineCbStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_CB_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
bool32_t alphaToCoverageEnable;
bool32_t logicOpEnable;
VkLogicOp logicOp;
uint32_t attachmentCount; // # of pAttachments
const VkPipelineCbAttachmentState* pAttachments;
} VkPipelineCbStateCreateInfo;
typedef struct VkStencilOpState_
{
VkStencilOp stencilFailOp;
VkStencilOp stencilPassOp;
VkStencilOp stencilDepthFailOp;
VkCompareOp stencilCompareOp;
} VkStencilOpState;
typedef struct VkPipelineDsStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_DS_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
VkFormat format;
bool32_t depthTestEnable;
bool32_t depthWriteEnable;
VkCompareOp depthCompareOp;
bool32_t depthBoundsEnable; // optional (depth_bounds_test)
bool32_t stencilTestEnable;
VkStencilOpState front;
VkStencilOpState back;
} VkPipelineDsStateCreateInfo;
typedef struct VkPipelineShaderStageCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
const void* pNext; // Pointer to next structure
VkPipelineShader shader;
} VkPipelineShaderStageCreateInfo;
typedef struct VkGraphicsPipelineCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
const void* pNext; // Pointer to next structure
VkPipelineCreateFlags flags; // Pipeline creation flags
VkPipelineLayout layout; // Interface layout of the pipeline
} VkGraphicsPipelineCreateInfo;
typedef struct VkPipelineLayoutCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t descriptorSetCount; // Number of descriptor sets interfaced by the pipeline
const VkDescriptorSetLayout* pSetLayouts; // Array of <setCount> number of descriptor set layout objects defining the layout of the
} VkPipelineLayoutCreateInfo;
typedef struct VkSamplerCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
const void* pNext; // Pointer to next structure
VkTexFilter magFilter; // Filter mode for magnification
VkTexFilter minFilter; // Filter mode for minifiation
VkTexMipmapMode mipMode; // Mipmap selection mode
VkTexAddress addressU;
VkTexAddress addressV;
VkTexAddress addressW;
float mipLodBias;
uint32_t maxAnisotropy;
VkCompareOp compareOp;
float minLod;
float maxLod;
VkBorderColor borderColor;
} VkSamplerCreateInfo;
typedef struct VkDynamicVpStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DYNAMIC_VP_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t viewportAndScissorCount; // number of entries in pViewports and pScissors
const VkViewport* pViewports;
const VkRect* pScissors;
} VkDynamicVpStateCreateInfo;
typedef struct VkDynamicRsStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DYNAMIC_RS_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
float depthBias;
float depthBiasClamp;
float slopeScaledDepthBias;
float pointSize; // optional (GL45) - Size of points
float pointFadeThreshold; // optional (GL45) - Size of point fade threshold
float lineWidth; // optional (GL45) - Width of lines
} VkDynamicRsStateCreateInfo;
typedef struct VkDynamicCbStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DYNAMIC_CB_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
float blendConst[4];
} VkDynamicCbStateCreateInfo;
typedef struct VkDynamicDsStateCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DYNAMIC_DS_STATE_CREATE_INFO
const void* pNext; // Pointer to next structure
float minDepth; // optional (depth_bounds_test)
float maxDepth; // optional (depth_bounds_test)
uint32_t stencilReadMask;
uint32_t stencilWriteMask;
uint32_t stencilFrontRef;
uint32_t stencilBackRef;
} VkDynamicDsStateCreateInfo;
typedef struct VkCmdBufferCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t queueNodeIndex;
VkCmdBufferCreateFlags flags; // Command buffer creation flags
} VkCmdBufferCreateInfo;
typedef struct VkCmdBufferBeginInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO
const void* pNext; // Pointer to next structure
VkCmdBufferOptimizeFlags flags; // Command buffer optimization flags
} VkCmdBufferBeginInfo;
typedef struct VkRenderPassBegin_
{
VkRenderPass renderPass;
VkFramebuffer framebuffer;
} VkRenderPassBegin;
typedef struct VkCmdBufferGraphicsBeginInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_CMD_BUFFER_GRAPHICS_BEGIN_INFO
const void* pNext; // Pointer to next structure
VkRenderPassBegin renderPassContinue; // Only needed when a render pass is split across two command buffers
} VkCmdBufferGraphicsBeginInfo;
// Union allowing specification of floating point or raw color data. Actual value selected is based on image being cleared.
typedef union VkClearColorValue_
{
float floatColor[4];
uint32_t rawColor[4];
} VkClearColorValue;
typedef struct VkClearColor_
{
VkClearColorValue color;
bool32_t useRawValue;
} VkClearColor;
typedef struct VkRenderPassCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
const void* pNext; // Pointer to next structure
VkRect renderArea;
uint32_t colorAttachmentCount;
VkExtent2D extent;
uint32_t sampleCount;
uint32_t layers;
const VkFormat* pColorFormats;
const VkImageLayout* pColorLayouts;
const VkAttachmentLoadOp* pColorLoadOps;
const VkAttachmentStoreOp* pColorStoreOps;
const VkClearColor* pColorLoadClearValues;
VkFormat depthStencilFormat;
VkImageLayout depthStencilLayout;
VkAttachmentLoadOp depthLoadOp;
float depthLoadClearValue;
VkAttachmentStoreOp depthStoreOp;
VkAttachmentLoadOp stencilLoadOp;
uint32_t stencilLoadClearValue;
VkAttachmentStoreOp stencilStoreOp;
} VkRenderPassCreateInfo;
typedef struct VkEventCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
const void* pNext; // Pointer to next structure
VkEventCreateFlags flags; // Event creation flags
} VkEventCreateInfo;
typedef struct VkFenceCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
const void* pNext; // Pointer to next structure
VkFenceCreateFlags flags; // Fence creation flags
} VkFenceCreateInfo;
typedef struct VkSemaphoreCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t initialCount;
VkSemaphoreCreateFlags flags; // Semaphore creation flags
} VkSemaphoreCreateInfo;
typedef struct VkSemaphoreOpenInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_SEMAPHORE_OPEN_INFO
const void* pNext; // Pointer to next structure
VkSemaphore sharedSemaphore;
} VkSemaphoreOpenInfo;
typedef struct VkQueryPoolCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
const void* pNext; // Pointer to next structure
VkQueryType queryType;
uint32_t slots;
VkQueryPipelineStatisticFlags pipelineStatistics; // Optional
} VkQueryPoolCreateInfo;
typedef struct VkFramebufferCreateInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t colorAttachmentCount;
const VkColorAttachmentBindInfo* pColorAttachments;
const VkDepthStencilBindInfo* pDepthStencilAttachment;
uint32_t sampleCount;
uint32_t width;
uint32_t height;
uint32_t layers;
} VkFramebufferCreateInfo;
typedef struct VkDrawIndirectCmd_
{
uint32_t vertexCount;
uint32_t instanceCount;
uint32_t firstVertex;
uint32_t firstInstance;
} VkDrawIndirectCmd;
typedef struct VkDrawIndexedIndirectCmd_
{
uint32_t indexCount;
uint32_t instanceCount;
uint32_t firstIndex;
int32_t vertexOffset;
uint32_t firstInstance;
} VkDrawIndexedIndirectCmd;
typedef struct VkDispatchIndirectCmd_
{
uint32_t x;
uint32_t y;
uint32_t z;
} VkDispatchIndirectCmd;
// ------------------------------------------------------------------------------------------------
// API functions
typedef VkResult (VKAPI *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance);
typedef VkResult (VKAPI *PFN_vkDestroyInstance)(VkInstance instance);
typedef VkResult (VKAPI *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceInfo)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceInfoType infoType, size_t* pDataSize, void* pData);
typedef void * (VKAPI *PFN_vkGetProcAddr)(VkPhysicalDevice physicalDevice, const char * pName);
typedef VkResult (VKAPI *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice);
typedef VkResult (VKAPI *PFN_vkDestroyDevice)(VkDevice device);
typedef VkResult (VKAPI *PFN_vkGetGlobalExtensionInfo)(VkExtensionInfoType infoType, uint32_t extensionIndex, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceExtensionInfo)(VkPhysicalDevice physicalDevice, VkExtensionInfoType infoType, uint32_t extensionIndex, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkEnumerateLayers)(VkPhysicalDevice physicalDevice, size_t maxStringSize, size_t* pLayerCount, char* const* pOutLayers, void* pReserved);
typedef VkResult (VKAPI *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueNodeIndex, uint32_t queueIndex, VkQueue* pQueue);
typedef VkResult (VKAPI *PFN_vkQueueSubmit)(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence);
typedef VkResult (VKAPI *PFN_vkQueueAddMemReferences)(VkQueue queue, uint32_t count, const VkDeviceMemory* pMems);
typedef VkResult (VKAPI *PFN_vkQueueRemoveMemReferences)(VkQueue queue, uint32_t count, const VkDeviceMemory* pMems);
typedef VkResult (VKAPI *PFN_vkQueueWaitIdle)(VkQueue queue);
typedef VkResult (VKAPI *PFN_vkDeviceWaitIdle)(VkDevice device);
typedef VkResult (VKAPI *PFN_vkAllocMemory)(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory mem);
typedef VkResult (VKAPI *PFN_vkSetMemoryPriority)(VkDevice device, VkDeviceMemory mem, VkMemoryPriority priority);
typedef VkResult (VKAPI *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
typedef VkResult (VKAPI *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory mem);
typedef VkResult (VKAPI *PFN_vkFlushMappedMemory)(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size);
typedef VkResult (VKAPI *PFN_vkPinSystemMemory)(VkDevice device, const void* pSysMem, size_t memSize, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkGetMultiDeviceCompatibility)(VkPhysicalDevice physicalDevice0, VkPhysicalDevice physicalDevice1, VkPhysicalDeviceCompatibilityInfo* pInfo);
typedef VkResult (VKAPI *PFN_vkOpenSharedMemory)(VkDevice device, const VkMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkOpenSharedSemaphore)(VkDevice device, const VkSemaphoreOpenInfo* pOpenInfo, VkSemaphore* pSemaphore);
typedef VkResult (VKAPI *PFN_vkOpenPeerMemory)(VkDevice device, const VkPeerMemoryOpenInfo* pOpenInfo, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkOpenPeerImage)(VkDevice device, const VkPeerImageOpenInfo* pOpenInfo, VkImage* pImage, VkDeviceMemory* pMem);
typedef VkResult (VKAPI *PFN_vkDestroyObject)(VkDevice device, VkObjectType objType, VkObject object);
typedef VkResult (VKAPI *PFN_vkGetObjectInfo)(VkDevice device, VkObjectType objType, VkObject object, VkObjectInfoType infoType, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkQueueBindObjectMemory)(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceMemory mem, VkDeviceSize offset);
typedef VkResult (VKAPI *PFN_vkQueueBindObjectMemoryRange)(VkQueue queue, VkObjectType objType, VkObject object, uint32_t allocationIdx, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset);
typedef VkResult (VKAPI *PFN_vkQueueBindImageMemoryRange)(VkQueue queue, VkImage image, uint32_t allocationIdx, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset);
typedef VkResult (VKAPI *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence);
typedef VkResult (VKAPI *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, VkFence* pFences);
typedef VkResult (VKAPI *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence);
typedef VkResult (VKAPI *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, bool32_t waitAll, uint64_t timeout);
typedef VkResult (VKAPI *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore);
typedef VkResult (VKAPI *PFN_vkQueueSignalSemaphore)(VkQueue queue, VkSemaphore semaphore);
typedef VkResult (VKAPI *PFN_vkQueueWaitSemaphore)(VkQueue queue, VkSemaphore semaphore);
typedef VkResult (VKAPI *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent);
typedef VkResult (VKAPI *PFN_vkGetEventStatus)(VkDevice device, VkEvent event);
typedef VkResult (VKAPI *PFN_vkSetEvent)(VkDevice device, VkEvent event);
typedef VkResult (VKAPI *PFN_vkResetEvent)(VkDevice device, VkEvent event);
typedef VkResult (VKAPI *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool);
typedef VkResult (VKAPI *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags);
typedef VkResult (VKAPI *PFN_vkGetFormatInfo)(VkDevice device, VkFormat format, VkFormatInfoType infoType, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer);
typedef VkResult (VKAPI *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView);
typedef VkResult (VKAPI *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage);
typedef VkResult (VKAPI *PFN_vkGetImageSubresourceInfo)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceInfoType infoType, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView);
typedef VkResult (VKAPI *PFN_vkCreateColorAttachmentView)(VkDevice device, const VkColorAttachmentViewCreateInfo* pCreateInfo, VkColorAttachmentView* pView);
typedef VkResult (VKAPI *PFN_vkCreateDepthStencilView)(VkDevice device, const VkDepthStencilViewCreateInfo* pCreateInfo, VkDepthStencilView* pView);
typedef VkResult (VKAPI *PFN_vkCreateShader)(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader);
typedef VkResult (VKAPI *PFN_vkCreateGraphicsPipeline)(VkDevice device, const VkGraphicsPipelineCreateInfo* pCreateInfo, VkPipeline* pPipeline);
typedef VkResult (VKAPI *PFN_vkCreateGraphicsPipelineDerivative)(VkDevice device, const VkGraphicsPipelineCreateInfo* pCreateInfo, VkPipeline basePipeline, VkPipeline* pPipeline);
typedef VkResult (VKAPI *PFN_vkCreateComputePipeline)(VkDevice device, const VkComputePipelineCreateInfo* pCreateInfo, VkPipeline* pPipeline);
typedef VkResult (VKAPI *PFN_vkStorePipeline)(VkDevice device, VkPipeline pipeline, size_t* pDataSize, void* pData);
typedef VkResult (VKAPI *PFN_vkLoadPipeline)(VkDevice device, size_t dataSize, const void* pData, VkPipeline* pPipeline);
typedef VkResult (VKAPI *PFN_vkLoadPipelineDerivative)(VkDevice device, size_t dataSize, const void* pData, VkPipeline basePipeline, VkPipeline* pPipeline);
typedef VkResult (VKAPI *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout);
typedef VkResult (VKAPI *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler);
typedef VkResult (VKAPI *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout);
typedef VkResult (VKAPI *PFN_vkBeginDescriptorPoolUpdate)(VkDevice device, VkDescriptorUpdateMode updateMode);
typedef VkResult (VKAPI *PFN_vkEndDescriptorPoolUpdate)(VkDevice device, VkCmdBuffer cmd);
typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
typedef VkResult (VKAPI *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount);
typedef void (VKAPI *PFN_vkClearDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets);
typedef void (VKAPI *PFN_vkUpdateDescriptors)(VkDevice device, VkDescriptorSet descriptorSet, uint32_t updateCount, const void** ppUpdateArray);
typedef VkResult (VKAPI *PFN_vkCreateDynamicViewportState)(VkDevice device, const VkDynamicVpStateCreateInfo* pCreateInfo, VkDynamicVpState* pState);
typedef VkResult (VKAPI *PFN_vkCreateDynamicRasterState)(VkDevice device, const VkDynamicRsStateCreateInfo* pCreateInfo, VkDynamicRsState* pState);
typedef VkResult (VKAPI *PFN_vkCreateDynamicColorBlendState)(VkDevice device, const VkDynamicCbStateCreateInfo* pCreateInfo, VkDynamicCbState* pState);
typedef VkResult (VKAPI *PFN_vkCreateDynamicDepthStencilState)(VkDevice device, const VkDynamicDsStateCreateInfo* pCreateInfo, VkDynamicDsState* pState);
typedef VkResult (VKAPI *PFN_vkCreateCommandBuffer)(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer);
typedef VkResult (VKAPI *PFN_vkBeginCommandBuffer)(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo);
typedef VkResult (VKAPI *PFN_vkEndCommandBuffer)(VkCmdBuffer cmdBuffer);
typedef VkResult (VKAPI *PFN_vkResetCommandBuffer)(VkCmdBuffer cmdBuffer);
typedef void (VKAPI *PFN_vkCmdBindPipeline)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
typedef void (VKAPI *PFN_vkCmdBindDynamicStateObject)(VkCmdBuffer cmdBuffer, VkStateBindPoint stateBindPoint, VkDynamicStateObject state);
typedef void (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets);
typedef void (VKAPI *PFN_vkCmdBindIndexBuffer)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
typedef void (VKAPI *PFN_vkCmdBindVertexBuffers)(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
typedef void (VKAPI *PFN_vkCmdDraw)(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount);
typedef void (VKAPI *PFN_vkCmdDrawIndexed)(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount);
typedef void (VKAPI *PFN_vkCmdDrawIndirect)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
typedef void (VKAPI *PFN_vkCmdDrawIndexedIndirect)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
typedef void (VKAPI *PFN_vkCmdDispatch)(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z);
typedef void (VKAPI *PFN_vkCmdDispatchIndirect)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset);
typedef void (VKAPI *PFN_vkCmdCopyBuffer)(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkBuffer destBuffer, uint32_t regionCount, const VkBufferCopy* pRegions);
typedef void (VKAPI *PFN_vkCmdCopyImage)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageCopy* pRegions);
typedef void (VKAPI *PFN_vkCmdBlitImage)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageBlit* pRegions);
typedef void (VKAPI *PFN_vkCmdCopyBufferToImage)(VkCmdBuffer cmdBuffer, VkBuffer srcBuffer, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions);
typedef void (VKAPI *PFN_vkCmdCopyImageToBuffer)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer destBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions);
typedef void (VKAPI *PFN_vkCmdCloneImageData)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout);
typedef void (VKAPI *PFN_vkCmdUpdateBuffer)(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData);
typedef void (VKAPI *PFN_vkCmdFillBuffer)(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data);
typedef void (VKAPI *PFN_vkCmdClearColorImage)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, VkClearColor color, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
typedef void (VKAPI *PFN_vkCmdClearDepthStencil)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
typedef void (VKAPI *PFN_vkCmdResolveImage)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions);
typedef void (VKAPI *PFN_vkCmdSetEvent)(VkCmdBuffer cmdBuffer, VkEvent event, VkPipeEvent pipeEvent);
typedef void (VKAPI *PFN_vkCmdResetEvent)(VkCmdBuffer cmdBuffer, VkEvent event, VkPipeEvent pipeEvent);
typedef void (VKAPI *PFN_vkCmdWaitEvents)(VkCmdBuffer cmdBuffer, VkWaitEvent waitEvent, uint32_t eventCount, const VkEvent* pEvents, uint32_t memBarrierCount, const void** ppMemBarriers);
typedef void (VKAPI *PFN_vkCmdPipelineBarrier)(VkCmdBuffer cmdBuffer, VkWaitEvent waitEvent, uint32_t pipeEventCount, const VkPipeEvent* pPipeEvents, uint32_t memBarrierCount, const void** ppMemBarriers);
typedef void (VKAPI *PFN_vkCmdBeginQuery)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot, VkQueryControlFlags flags);
typedef void (VKAPI *PFN_vkCmdEndQuery)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t slot);
typedef void (VKAPI *PFN_vkCmdResetQueryPool)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount);
typedef void (VKAPI *PFN_vkCmdWriteTimestamp)(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset);
typedef void (VKAPI *PFN_vkCmdCopyQueryPoolResults)(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize destStride, VkQueryResultFlags flags);
typedef void (VKAPI *PFN_vkCmdInitAtomicCounters)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, const uint32_t* pData);
typedef void (VKAPI *PFN_vkCmdLoadAtomicCounters)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, VkBuffer srcBuffer, VkDeviceSize srcOffset);
typedef void (VKAPI *PFN_vkCmdSaveAtomicCounters)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, uint32_t startCounter, uint32_t counterCount, VkBuffer destBuffer, VkDeviceSize destOffset);
typedef VkResult (VKAPI *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer);
typedef VkResult (VKAPI *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass);
typedef void (VKAPI *PFN_vkCmdBeginRenderPass)(VkCmdBuffer cmdBuffer, const VkRenderPassBegin* pRenderPassBegin);
typedef void (VKAPI *PFN_vkCmdEndRenderPass)(VkCmdBuffer cmdBuffer, VkRenderPass renderPass);
#ifdef VK_PROTOTYPES
// Device initialization
VkResult VKAPI vkCreateInstance(
const VkInstanceCreateInfo* pCreateInfo,
VkInstance* pInstance);
VkResult VKAPI vkDestroyInstance(
VkInstance instance);
VkResult VKAPI vkEnumeratePhysicalDevices(
VkInstance instance,
uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice* pPhysicalDevices);
VkResult VKAPI vkGetPhysicalDeviceInfo(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceInfoType infoType,
size_t* pDataSize,
void* pData);
void * VKAPI vkGetProcAddr(
VkPhysicalDevice physicalDevice,
const char* pName);
// Device functions
VkResult VKAPI vkCreateDevice(
VkPhysicalDevice physicalDevice,
const VkDeviceCreateInfo* pCreateInfo,
VkDevice* pDevice);
VkResult VKAPI vkDestroyDevice(
VkDevice device);
// Extension discovery functions
VkResult VKAPI vkGetGlobalExtensionInfo(
VkExtensionInfoType infoType,
uint32_t extensionIndex,
size_t* pDataSize,
void* pData);
VkResult VKAPI vkGetPhysicalDeviceExtensionInfo(
VkPhysicalDevice physicalDevice,
VkExtensionInfoType infoType,
uint32_t extensionIndex,
size_t* pDataSize,
void* pData);
// Layer discovery functions
VkResult VKAPI vkEnumerateLayers(
VkPhysicalDevice physicalDevice,
size_t maxStringSize,
size_t* pLayerCount,
char* const* pOutLayers,
void* pReserved);
// Queue functions
VkResult VKAPI vkGetDeviceQueue(
VkDevice device,
uint32_t queueNodeIndex,
uint32_t queueIndex,
VkQueue* pQueue);
VkResult VKAPI vkQueueSubmit(
VkQueue queue,
uint32_t cmdBufferCount,
const VkCmdBuffer* pCmdBuffers,
VkFence fence);
VkResult VKAPI vkQueueAddMemReferences(
VkQueue queue,
uint32_t count,
const VkDeviceMemory* pMems);
VkResult VKAPI vkQueueRemoveMemReferences(
VkQueue queue,
uint32_t count,
const VkDeviceMemory* pMems);
VkResult VKAPI vkQueueWaitIdle(
VkQueue queue);
VkResult VKAPI vkDeviceWaitIdle(
VkDevice device);
// Memory functions
VkResult VKAPI vkAllocMemory(
VkDevice device,
const VkMemoryAllocInfo* pAllocInfo,
VkDeviceMemory* pMem);
VkResult VKAPI vkFreeMemory(
VkDevice device,
VkDeviceMemory mem);
VkResult VKAPI vkSetMemoryPriority(
VkDevice device,
VkDeviceMemory mem,
VkMemoryPriority priority);
VkResult VKAPI vkMapMemory(
VkDevice device,
VkDeviceMemory mem,
VkDeviceSize offset,
VkDeviceSize size,
VkMemoryMapFlags flags,
void** ppData);
VkResult VKAPI vkUnmapMemory(
VkDevice device,
VkDeviceMemory mem);
VkResult VKAPI vkFlushMappedMemory(
VkDevice device,
VkDeviceMemory mem,
VkDeviceSize offset,
VkDeviceSize size);
VkResult VKAPI vkPinSystemMemory(
VkDevice device,
const void* pSysMem,
size_t memSize,
VkDeviceMemory* pMem);
// Multi-device functions
VkResult VKAPI vkGetMultiDeviceCompatibility(
VkPhysicalDevice physicalDevice0,
VkPhysicalDevice physicalDevice1,
VkPhysicalDeviceCompatibilityInfo* pInfo);
VkResult VKAPI vkOpenSharedMemory(
VkDevice device,
const VkMemoryOpenInfo* pOpenInfo,
VkDeviceMemory* pMem);
VkResult VKAPI vkOpenSharedSemaphore(
VkDevice device,
const VkSemaphoreOpenInfo* pOpenInfo,
VkSemaphore* pSemaphore);
VkResult VKAPI vkOpenPeerMemory(
VkDevice device,
const VkPeerMemoryOpenInfo* pOpenInfo,
VkDeviceMemory* pMem);
VkResult VKAPI vkOpenPeerImage(
VkDevice device,
const VkPeerImageOpenInfo* pOpenInfo,
VkImage* pImage,
VkDeviceMemory* pMem);
// Generic API object functions
VkResult VKAPI vkDestroyObject(
VkDevice device,
VkObjectType objType,
VkObject object);
VkResult VKAPI vkGetObjectInfo(
VkDevice device,
VkObjectType objType,
VkObject object,
VkObjectInfoType infoType,
size_t* pDataSize,
void* pData);
// Memory management API functions
VkResult VKAPI vkQueueBindObjectMemory(
VkQueue queue,
VkObjectType objType,
VkObject object,
uint32_t allocationIdx,
VkDeviceMemory mem,
VkDeviceSize memOffset);
VkResult VKAPI vkQueueBindObjectMemoryRange(
VkQueue queue,
VkObjectType objType,
VkObject object,
uint32_t allocationIdx,
VkDeviceSize rangeOffset,
VkDeviceSize rangeSize,
VkDeviceMemory mem,
VkDeviceSize memOffset);
VkResult VKAPI vkQueueBindImageMemoryRange(
VkQueue queue,
VkImage image,
uint32_t allocationIdx,
const VkImageMemoryBindInfo* pBindInfo,
VkDeviceMemory mem,
VkDeviceSize memOffset);
// Fence functions
VkResult VKAPI vkCreateFence(
VkDevice device,
const VkFenceCreateInfo* pCreateInfo,
VkFence* pFence);
VkResult VKAPI vkResetFences(
VkDevice device,
uint32_t fenceCount,
VkFence* pFences);
VkResult VKAPI vkGetFenceStatus(
VkDevice device,
VkFence fence);
VkResult VKAPI vkWaitForFences(
VkDevice device,
uint32_t fenceCount,
const VkFence* pFences,
bool32_t waitAll,
uint64_t timeout); // timeout in nanoseconds
// Queue semaphore functions
VkResult VKAPI vkCreateSemaphore(
VkDevice device,
const VkSemaphoreCreateInfo* pCreateInfo,
VkSemaphore* pSemaphore);
VkResult VKAPI vkQueueSignalSemaphore(
VkQueue queue,
VkSemaphore semaphore);
VkResult VKAPI vkQueueWaitSemaphore(
VkQueue queue,
VkSemaphore semaphore);
// Event functions
VkResult VKAPI vkCreateEvent(
VkDevice device,
const VkEventCreateInfo* pCreateInfo,
VkEvent* pEvent);
VkResult VKAPI vkGetEventStatus(
VkDevice device,
VkEvent event);
VkResult VKAPI vkSetEvent(
VkDevice device,
VkEvent event);
VkResult VKAPI vkResetEvent(
VkDevice device,
VkEvent event);
// Query functions
VkResult VKAPI vkCreateQueryPool(
VkDevice device,
const VkQueryPoolCreateInfo* pCreateInfo,
VkQueryPool* pQueryPool);
VkResult VKAPI vkGetQueryPoolResults(
VkDevice device,
VkQueryPool queryPool,
uint32_t startQuery,
uint32_t queryCount,
size_t* pDataSize,
void* pData,
VkQueryResultFlags flags);
// Format capabilities
VkResult VKAPI vkGetFormatInfo(
VkDevice device,
VkFormat format,
VkFormatInfoType infoType,
size_t* pDataSize,
void* pData);
// Buffer functions
VkResult VKAPI vkCreateBuffer(
VkDevice device,
const VkBufferCreateInfo* pCreateInfo,
VkBuffer* pBuffer);
// Buffer view functions
VkResult VKAPI vkCreateBufferView(
VkDevice device,
const VkBufferViewCreateInfo* pCreateInfo,
VkBufferView* pView);
// Image functions
VkResult VKAPI vkCreateImage(
VkDevice device,
const VkImageCreateInfo* pCreateInfo,
VkImage* pImage);
VkResult VKAPI vkGetImageSubresourceInfo(
VkDevice device,
VkImage image,
const VkImageSubresource* pSubresource,
VkSubresourceInfoType infoType,
size_t* pDataSize,
void* pData);
// Image view functions
VkResult VKAPI vkCreateImageView(
VkDevice device,
const VkImageViewCreateInfo* pCreateInfo,
VkImageView* pView);
VkResult VKAPI vkCreateColorAttachmentView(
VkDevice device,
const VkColorAttachmentViewCreateInfo* pCreateInfo,
VkColorAttachmentView* pView);
VkResult VKAPI vkCreateDepthStencilView(
VkDevice device,
const VkDepthStencilViewCreateInfo* pCreateInfo,
VkDepthStencilView* pView);
// Shader functions
VkResult VKAPI vkCreateShader(
VkDevice device,
const VkShaderCreateInfo* pCreateInfo,
VkShader* pShader);
// Pipeline functions
VkResult VKAPI vkCreateGraphicsPipeline(
VkDevice device,
const VkGraphicsPipelineCreateInfo* pCreateInfo,
VkPipeline* pPipeline);
VkResult VKAPI vkCreateGraphicsPipelineDerivative(
VkDevice device,
const VkGraphicsPipelineCreateInfo* pCreateInfo,
VkPipeline basePipeline,
VkPipeline* pPipeline);
VkResult VKAPI vkCreateComputePipeline(
VkDevice device,
const VkComputePipelineCreateInfo* pCreateInfo,
VkPipeline* pPipeline);
VkResult VKAPI vkStorePipeline(
VkDevice device,
VkPipeline pipeline,
size_t* pDataSize,
void* pData);
VkResult VKAPI vkLoadPipeline(
VkDevice device,
size_t dataSize,
const void* pData,
VkPipeline* pPipeline);
VkResult VKAPI vkLoadPipelineDerivative(
VkDevice device,
size_t dataSize,
const void* pData,
VkPipeline basePipeline,
VkPipeline* pPipeline);
// Pipeline layout functions
VkResult VKAPI vkCreatePipelineLayout(
VkDevice device,
const VkPipelineLayoutCreateInfo* pCreateInfo,
VkPipelineLayout* pPipelineLayout);
// Sampler functions
VkResult VKAPI vkCreateSampler(
VkDevice device,
const VkSamplerCreateInfo* pCreateInfo,
VkSampler* pSampler);
// Descriptor set functions
VkResult VKAPI vkCreateDescriptorSetLayout(
VkDevice device,
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
VkDescriptorSetLayout* pSetLayout);
VkResult VKAPI vkBeginDescriptorPoolUpdate(
VkDevice device,
VkDescriptorUpdateMode updateMode);
VkResult VKAPI vkEndDescriptorPoolUpdate(
VkDevice device,
VkCmdBuffer cmd);
VkResult VKAPI vkCreateDescriptorPool(
VkDevice device,
VkDescriptorPoolUsage poolUsage,
uint32_t maxSets,
const VkDescriptorPoolCreateInfo* pCreateInfo,
VkDescriptorPool* pDescriptorPool);
VkResult VKAPI vkResetDescriptorPool(
VkDevice device,
VkDescriptorPool descriptorPool);
VkResult VKAPI vkAllocDescriptorSets(
VkDevice device,
VkDescriptorPool descriptorPool,
VkDescriptorSetUsage setUsage,
uint32_t count,
const VkDescriptorSetLayout* pSetLayouts,
VkDescriptorSet* pDescriptorSets,
uint32_t* pCount);
void VKAPI vkClearDescriptorSets(
VkDevice device,
VkDescriptorPool descriptorPool,
uint32_t count,
const VkDescriptorSet* pDescriptorSets);
void VKAPI vkUpdateDescriptors(
VkDevice device,
VkDescriptorSet descriptorSet,
uint32_t updateCount,
const void** ppUpdateArray);
// State object functions
VkResult VKAPI vkCreateDynamicViewportState(
VkDevice device,
const VkDynamicVpStateCreateInfo* pCreateInfo,
VkDynamicVpState* pState);
VkResult VKAPI vkCreateDynamicRasterState(
VkDevice device,
const VkDynamicRsStateCreateInfo* pCreateInfo,
VkDynamicRsState* pState);
VkResult VKAPI vkCreateDynamicColorBlendState(
VkDevice device,
const VkDynamicCbStateCreateInfo* pCreateInfo,
VkDynamicCbState* pState);
VkResult VKAPI vkCreateDynamicDepthStencilState(
VkDevice device,
const VkDynamicDsStateCreateInfo* pCreateInfo,
VkDynamicDsState* pState);
// Command buffer functions
VkResult VKAPI vkCreateCommandBuffer(
VkDevice device,
const VkCmdBufferCreateInfo* pCreateInfo,
VkCmdBuffer* pCmdBuffer);
VkResult VKAPI vkBeginCommandBuffer(
VkCmdBuffer cmdBuffer,
const VkCmdBufferBeginInfo* pBeginInfo);
VkResult VKAPI vkEndCommandBuffer(
VkCmdBuffer cmdBuffer);
VkResult VKAPI vkResetCommandBuffer(
VkCmdBuffer cmdBuffer);
// Command buffer building functions
void VKAPI vkCmdBindPipeline(
VkCmdBuffer cmdBuffer,
VkPipelineBindPoint pipelineBindPoint,
VkPipeline pipeline);
void VKAPI vkCmdBindDynamicStateObject(
VkCmdBuffer cmdBuffer,
VkStateBindPoint stateBindPoint,
VkDynamicStateObject dynamicState);
void VKAPI vkCmdBindDescriptorSets(
VkCmdBuffer cmdBuffer,
VkPipelineBindPoint pipelineBindPoint,
uint32_t firstSet,
uint32_t setCount,
const VkDescriptorSet* pDescriptorSets,
uint32_t dynamicOffsetCount,
const uint32_t* pDynamicOffsets);
void VKAPI vkCmdBindIndexBuffer(
VkCmdBuffer cmdBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkIndexType indexType);
void VKAPI vkCmdBindVertexBuffers(
VkCmdBuffer cmdBuffer,
uint32_t startBinding,
uint32_t bindingCount,
const VkBuffer* pBuffers,
const VkDeviceSize* pOffsets);
void VKAPI vkCmdDraw(
VkCmdBuffer cmdBuffer,
uint32_t firstVertex,
uint32_t vertexCount,
uint32_t firstInstance,
uint32_t instanceCount);
void VKAPI vkCmdDrawIndexed(
VkCmdBuffer cmdBuffer,
uint32_t firstIndex,
uint32_t indexCount,
int32_t vertexOffset,
uint32_t firstInstance,
uint32_t instanceCount);
void VKAPI vkCmdDrawIndirect(
VkCmdBuffer cmdBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t stride);
void VKAPI vkCmdDrawIndexedIndirect(
VkCmdBuffer cmdBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t stride);
void VKAPI vkCmdDispatch(
VkCmdBuffer cmdBuffer,
uint32_t x,
uint32_t y,
uint32_t z);
void VKAPI vkCmdDispatchIndirect(
VkCmdBuffer cmdBuffer,
VkBuffer buffer,
VkDeviceSize offset);
void VKAPI vkCmdCopyBuffer(
VkCmdBuffer cmdBuffer,
VkBuffer srcBuffer,
VkBuffer destBuffer,
uint32_t regionCount,
const VkBufferCopy* pRegions);
void VKAPI vkCmdCopyImage(
VkCmdBuffer cmdBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage destImage,
VkImageLayout destImageLayout,
uint32_t regionCount,
const VkImageCopy* pRegions);
void VKAPI vkCmdBlitImage(
VkCmdBuffer cmdBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage destImage,
VkImageLayout destImageLayout,
uint32_t regionCount,
const VkImageBlit* pRegions);
void VKAPI vkCmdCopyBufferToImage(
VkCmdBuffer cmdBuffer,
VkBuffer srcBuffer,
VkImage destImage,
VkImageLayout destImageLayout,
uint32_t regionCount,
const VkBufferImageCopy* pRegions);
void VKAPI vkCmdCopyImageToBuffer(
VkCmdBuffer cmdBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkBuffer destBuffer,
uint32_t regionCount,
const VkBufferImageCopy* pRegions);
void VKAPI vkCmdCloneImageData(
VkCmdBuffer cmdBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage destImage,
VkImageLayout destImageLayout);
void VKAPI vkCmdUpdateBuffer(
VkCmdBuffer cmdBuffer,
VkBuffer destBuffer,
VkDeviceSize destOffset,
VkDeviceSize dataSize,
const uint32_t* pData);
void VKAPI vkCmdFillBuffer(
VkCmdBuffer cmdBuffer,
VkBuffer destBuffer,
VkDeviceSize destOffset,
VkDeviceSize fillSize,
uint32_t data);
void VKAPI vkCmdClearColorImage(
VkCmdBuffer cmdBuffer,
VkImage image,
VkImageLayout imageLayout,
const VkClearColor* color,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges);
void VKAPI vkCmdClearDepthStencil(
VkCmdBuffer cmdBuffer,
VkImage image,
VkImageLayout imageLayout,
float depth,
uint32_t stencil,
uint32_t rangeCount,
const VkImageSubresourceRange* pRanges);
void VKAPI vkCmdResolveImage(
VkCmdBuffer cmdBuffer,
VkImage srcImage,
VkImageLayout srcImageLayout,
VkImage destImage,
VkImageLayout destImageLayout,
uint32_t regionCount,
const VkImageResolve* pRegions);
void VKAPI vkCmdSetEvent(
VkCmdBuffer cmdBuffer,
VkEvent event,
VkPipeEvent pipeEvent);
void VKAPI vkCmdResetEvent(
VkCmdBuffer cmdBuffer,
VkEvent event,
VkPipeEvent pipeEvent);
void VKAPI vkCmdWaitEvents(
VkCmdBuffer cmdBuffer,
VkWaitEvent waitEvent,
uint32_t eventCount,
const VkEvent* pEvents,
uint32_t memBarrierCount,
const void** ppMemBarriers);
void VKAPI vkCmdPipelineBarrier(
VkCmdBuffer cmdBuffer,
VkWaitEvent waitEvent,
uint32_t pipeEventCount,
const VkPipeEvent* pPipeEvents,
uint32_t memBarrierCount,
const void** ppMemBarriers);
void VKAPI vkCmdBeginQuery(
VkCmdBuffer cmdBuffer,
VkQueryPool queryPool,
uint32_t slot,
VkQueryControlFlags flags);
void VKAPI vkCmdEndQuery(
VkCmdBuffer cmdBuffer,
VkQueryPool queryPool,
uint32_t slot);
void VKAPI vkCmdResetQueryPool(
VkCmdBuffer cmdBuffer,
VkQueryPool queryPool,
uint32_t startQuery,
uint32_t queryCount);
void VKAPI vkCmdWriteTimestamp(
VkCmdBuffer cmdBuffer,
VkTimestampType timestampType,
VkBuffer destBuffer,
VkDeviceSize destOffset);
void VKAPI vkCmdCopyQueryPoolResults(
VkCmdBuffer cmdBuffer,
VkQueryPool queryPool,
uint32_t startQuery,
uint32_t queryCount,
VkBuffer destBuffer,
VkDeviceSize destOffset,
VkDeviceSize destStride,
VkQueryResultFlags flags);
void VKAPI vkCmdInitAtomicCounters(
VkCmdBuffer cmdBuffer,
VkPipelineBindPoint pipelineBindPoint,
uint32_t startCounter,
uint32_t counterCount,
const uint32_t* pData);
void VKAPI vkCmdLoadAtomicCounters(
VkCmdBuffer cmdBuffer,
VkPipelineBindPoint pipelineBindPoint,
uint32_t startCounter,
uint32_t counterCount,
VkBuffer srcBuffer,
VkDeviceSize srcOffset);
void VKAPI vkCmdSaveAtomicCounters(
VkCmdBuffer cmdBuffer,
VkPipelineBindPoint pipelineBindPoint,
uint32_t startCounter,
uint32_t counterCount,
VkBuffer destBuffer,
VkDeviceSize destOffset);
VkResult VKAPI vkCreateFramebuffer(
VkDevice device,
const VkFramebufferCreateInfo* pCreateInfo,
VkFramebuffer* pFramebuffer);
VkResult VKAPI vkCreateRenderPass(
VkDevice device,
const VkRenderPassCreateInfo* pCreateInfo,
VkRenderPass* pRenderPass);
void VKAPI vkCmdBeginRenderPass(
VkCmdBuffer cmdBuffer,
const VkRenderPassBegin* pRenderPassBegin);
void VKAPI vkCmdEndRenderPass(
VkCmdBuffer cmdBuffer,
VkRenderPass renderPass);
#endif // VK_PROTOTYPES
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __VULKAN_H__
|