summaryrefslogtreecommitdiff
path: root/chapters/descriptorsets.adoc
blob: 9b6da7941668d36cfcde62ab0b5dc7d5d161c51a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
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
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
// Copyright 2015-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

[[descriptorsets]]
= Resource Descriptors

A _descriptor_ is an opaque data structure representing a shader resource
such as a buffer, buffer view, image view, sampler, or combined image
sampler.
Descriptors are organized into _descriptor sets_, which are bound during
command recording for use in subsequent drawing commands.
The arrangement of content in each descriptor set is determined by a
_descriptor set layout_, which determines what descriptors can be stored
within it.
The sequence of descriptor set layouts that can: be used by a pipeline is
specified in a _pipeline layout_.
Each pipeline object can: use up to pname:maxBoundDescriptorSets (see
<<limits, Limits>>) descriptor sets.

ifdef::VK_EXT_descriptor_buffer[]
If the <<features-descriptorBuffer, pname:descriptorBuffer>> feature is
enabled, the implementation supports placing descriptors into
<<descriptorbuffers,descriptor buffers>> which are bound during command
recording in a similar way to descriptor sets.
endif::VK_EXT_descriptor_buffer[]

Shaders access resources via variables decorated with a descriptor set and
binding number that link them to a descriptor in a descriptor set.
The shader interface mapping to bound descriptor sets is described in the
<<interfaces-resources, Shader Resource Interface>> section.

ifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
Shaders can: also access buffers without going through descriptors by using
<<descriptorsets-physical-storage-buffer,Physical Storage Buffer Access>> to
access them through 64-bit addresses.
endif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]


[[descriptorsets-types]]
== Descriptor Types

There are a number of different types of descriptor supported by Vulkan,
corresponding to different resources or usage.
The following sections describe the API definitions of each descriptor type.
The mapping of each type to SPIR-V is listed in the
<<interfaces-resources-correspondence, Shader Resource and Descriptor Type
Correspondence>> and <<interfaces-resources-storage-class-correspondence,
Shader Resource and Storage Class Correspondence>> tables in the
<<interfaces, Shader Interfaces>> chapter.


[[descriptorsets-storageimage]]
=== Storage Image

A _storage image_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) is a descriptor
type associated with an <<resources-images, image resource>> via an
<<resources-image-views, image view>> that load, store, and atomic
operations can: be performed on.

Storage image loads are supported in all shader stages for image views whose
<<resources-image-view-format-features,format features>> contain
<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT>>.

Stores to storage images are supported in
ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[task, mesh and]
compute shaders for image views whose
<<resources-image-view-format-features,format features>> contain
<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT>>.

Atomic operations on storage images are supported in
ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[task, mesh and]
compute shaders for image views whose
<<resources-image-view-format-features,format features>> contain
<<formats-properties,ename:VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT>>.

When the <<features-fragmentStoresAndAtomics,
pname:fragmentStoresAndAtomics>> feature is enabled, stores and atomic
operations are also supported for storage images in fragment shaders with
the same set of image formats as supported in compute shaders.
When the <<features-vertexPipelineStoresAndAtomics,
pname:vertexPipelineStoresAndAtomics>> feature is enabled, stores and atomic
operations are also supported in vertex, tessellation, and geometry shaders
with the same set of image formats as supported in compute shaders.

The image subresources for a storage image must: be in the
ifdef::VK_KHR_shared_presentable_image[]
ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR or
endif::VK_KHR_shared_presentable_image[]
ename:VK_IMAGE_LAYOUT_GENERAL layout in order to access its data in a
shader.


[[descriptorsets-sampler]]
=== Sampler

A _sampler descriptor_ (ename:VK_DESCRIPTOR_TYPE_SAMPLER) is a descriptor
type associated with a <<samplers,sampler>> object, used to control the
behavior of <<textures,sampling operations>> performed on a
<<descriptorsets-sampledimage, sampled image>>.


[[descriptorsets-sampledimage]]
=== Sampled Image

A _sampled image_ (ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE) is a descriptor
type associated with an <<resources-images, image resource>> via an
<<resources-image-views, image view>> that <<textures,sampling operations>>
can: be performed on.

Shaders combine a sampled image variable and a sampler variable to perform
sampling operations.

Sampled images are supported in all shader stages for image views whose
<<resources-image-view-format-features,format features>> contain
<<formats-properties,ename:VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT>>.

An image subresources for a sampled image must: be in one of the following
layouts:

  * ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_GENERAL
ifdef::VK_KHR_shared_presentable_image[]
  * ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
endif::VK_KHR_shared_presentable_image[]
ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
  * ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
endif::VK_VERSION_1_1,VK_KHR_maintenance2[]
ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
  * ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
ifdef::VK_KHR_synchronization2[]
  * ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
endif::VK_KHR_synchronization2[]
ifdef::VK_EXT_attachment_feedback_loop_layout[]
  * ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
endif::VK_EXT_attachment_feedback_loop_layout[]


[[descriptorsets-combinedimagesampler]]
=== Combined Image Sampler

A _combined image sampler_ (ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)
is a single descriptor type associated with both a <<samplers,sampler>> and
an <<resources-images,image resource>>, combining both a
<<descriptorsets-sampler,sampler>> and <<descriptorsets-sampledimage,
sampled image>> descriptor into a single descriptor.

ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
If the descriptor refers to a sampler that performs
ifndef::VK_EXT_fragment_density_map[]
<<samplers-YCbCr-conversion,{YCbCr} conversion>>,
endif::VK_EXT_fragment_density_map[]
ifdef::VK_EXT_fragment_density_map[]
<<samplers-YCbCr-conversion,{YCbCr} conversion>> or samples a
<<samplers-subsamplesampler,subsampled image>>,
endif::VK_EXT_fragment_density_map[]
the sampler must: only be used to sample the image in the same descriptor.
Otherwise, the
endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
ifndef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
ifndef::VK_EXT_fragment_density_map[]
The
endif::VK_EXT_fragment_density_map[]
ifdef::VK_EXT_fragment_density_map[]
If the descriptor refers to a sampler that samples a
<<samplers-subsamplesampler,subsampled image>>, the sampler must: only be
used to sample the image in the same descriptor.
Otherwise, the
endif::VK_EXT_fragment_density_map[]
endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
sampler and image in this type of descriptor can: be used freely with any
other samplers and images.

An image subresources for a combined image sampler must: be in one of the
following layouts:

  * ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_GENERAL
ifdef::VK_KHR_shared_presentable_image[]
  * ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
endif::VK_KHR_shared_presentable_image[]
ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
  * ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
endif::VK_VERSION_1_1,VK_KHR_maintenance2[]
ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
  * ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL
endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
ifdef::VK_KHR_synchronization2[]
  * ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
endif::VK_KHR_synchronization2[]
ifdef::VK_EXT_attachment_feedback_loop_layout[]
  * ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
endif::VK_EXT_attachment_feedback_loop_layout[]


[NOTE]
.Note
====
On some implementations, it may: be more efficient to sample from an image
using a combination of sampler and sampled image that are stored together in
the descriptor set in a combined descriptor.
====


[[descriptorsets-uniformtexelbuffer]]
=== Uniform Texel Buffer

A _uniform texel buffer_ (ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER) is
a descriptor type associated with a <<resources-buffers,buffer resource>>
via a <<resources-buffer-views, buffer view>> that <<textures,image sampling
operations>> can: be performed on.

Uniform texel buffers define a tightly-packed 1-dimensional linear array of
texels, with texels going through format conversion when read in a shader in
the same way as they are for an image.

Load operations from uniform texel buffers are supported in all shader
stages for buffer view formats which report
<<resources-buffer-view-format-features,format features>> support for
ename:VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT


[[descriptorsets-storagetexelbuffer]]
=== Storage Texel Buffer

A _storage texel buffer_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER) is
a descriptor type associated with a <<resources-buffers,buffer resource>>
via a <<resources-buffer-views, buffer view>> that <<textures,image load,
store, and atomic operations>> can: be performed on.

Storage texel buffers define a tightly-packed 1-dimensional linear array of
texels, with texels going through format conversion when read in a shader in
the same way as they are for an image.
Unlike <<descriptorsets-uniformtexelbuffer,uniform texel buffers>>, these
buffers can also be written to in the same way as for
<<descriptorsets-storageimage, storage images>>.

Storage texel buffer loads are supported in all shader stages for texel
buffer view formats which report
<<resources-buffer-view-format-features,format features>> support for
ename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT

Stores to storage texel buffers are supported in
ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[task, mesh and]
compute shaders for texel buffer formats which report
<<resources-buffer-view-format-features,format features>> support for
ename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT

Atomic operations on storage texel buffers are supported in
ifdef::VK_NV_mesh_shader,VK_EXT_mesh_shader[task, mesh and]
compute shaders for texel buffer formats which report
<<resources-buffer-view-format-features,format features>> support for
ename:VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT

When the <<features-fragmentStoresAndAtomics,
pname:fragmentStoresAndAtomics>> feature is enabled, stores and atomic
operations are also supported for storage texel buffers in fragment shaders
with the same set of texel buffer formats as supported in compute shaders.
When the <<features-vertexPipelineStoresAndAtomics,
pname:vertexPipelineStoresAndAtomics>> feature is enabled, stores and atomic
operations are also supported in vertex, tessellation, and geometry shaders
with the same set of texel buffer formats as supported in compute shaders.


[[descriptorsets-storagebuffer]]
=== Storage Buffer

A _storage buffer_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER) is a descriptor
type associated with a <<resources-buffers,buffer resource>> directly,
described in a shader as a structure with various members that load, store,
and atomic operations can: be performed on.

[NOTE]
.Note
====
Atomic operations can: only be performed on members of certain types as
defined in the <<spirvenv, SPIR-V environment appendix>>.
====


[[descriptorsets-uniformbuffer]]
=== Uniform Buffer

A _uniform buffer_ (ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) is a descriptor
type associated with a <<resources-buffers,buffer resource>> directly,
described in a shader as a structure with various members that load
operations can: be performed on.


[[descriptorsets-uniformbufferdynamic]]
=== Dynamic Uniform Buffer

A _dynamic uniform buffer_ (ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC)
is almost identical to a <<descriptorsets-uniformbuffer, uniform buffer>>,
and differs only in how the offset into the buffer is specified.
The base offset calculated by the slink:VkDescriptorBufferInfo when
initially <<descriptorsets-updates, updating the descriptor set>> is added
to a <<descriptorsets-binding-dynamicoffsets, dynamic offset>> when binding
the descriptor set.


[[descriptorsets-storagebufferdynamic]]
=== Dynamic Storage Buffer

A _dynamic storage buffer_ (ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC)
is almost identical to a <<descriptorsets-storagebuffer, storage buffer>>,
and differs only in how the offset into the buffer is specified.
The base offset calculated by the slink:VkDescriptorBufferInfo when
initially <<descriptorsets-updates, updating the descriptor set>> is added
to a <<descriptorsets-binding-dynamicoffsets, dynamic offset>> when binding
the descriptor set.


ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
[[descriptorsets-inlineuniformblock]]
=== Inline Uniform Block

An _inline uniform block_ (ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK) is
almost identical to a <<descriptorsets-uniformbuffer, uniform buffer>>, and
differs only in taking its storage directly from the encompassing descriptor
set instead of being backed by buffer memory.
It is typically used to access a small set of constant data that does not
require the additional flexibility provided by the indirection enabled when
using a uniform buffer where the descriptor and the referenced buffer memory
are decoupled.
Compared to push constants, they allow reusing the same set of constant data
across multiple disjoint sets of drawing and dispatching commands.

Inline uniform block descriptors cannot: be aggregated into arrays.
Instead, the array size specified for an inline uniform block descriptor
binding specifies the binding's capacity in bytes.

endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]


ifdef::VK_QCOM_image_processing[]
[[descriptorsets-weightimage]]
=== Sample Weight Image

A _sample weight image_ (ename:VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM)
is a descriptor type associated with an <<resources-images, image resource>>
via an <<resources-image-views, image view>> that can: be used in
<<textures-weightimage, weight image sampling>>.
The image view must have been created with
slink:VkImageViewSampleWeightCreateInfoQCOM.

Shaders can: combine a weight image variable, a sampled image variable, and
a sampler variable to perform <<textures-weightimage, weight image
sampling>>.

Weight image sampling is supported in all shader stages if the weight image
view specifies a format that supports
<<resources-image-view-format-features,format feature>>
<<formats-properties,ename:VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM>> and
the sampled image view specifies a format that supports
<<resources-image-view-format-features,format feature>>
<<formats-properties,ename:VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM>>

The image subresources for the weight image must: be in the
ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, or
ename:VK_IMAGE_LAYOUT_GENERAL layout in order to access its data in a
shader.


[[descriptorsets-blockmatch]]
=== Block Matching Image

A _block matching image_ (ename:VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM)
is a descriptor type associated with an <<resources-images, image resource>>
via an <<resources-image-views, image view>> that can: be used in
<<textures-blockmatch, block matching>>.

Shaders can: combine a target image variable, a reference image variable,
and a sampler variable to perform <<textures-blockmatch, block matching>>.

Block matching is supported in all shader stages for if both the target view
and reference view specifies a format that supports
<<resources-image-view-format-features,format feature>>
<<formats-properties,ename:VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM>>


The image subresources for block matching must: be in the
ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, or
ename:VK_IMAGE_LAYOUT_GENERAL layout in order to access its data in a
shader.
endif::VK_QCOM_image_processing[]


[[descriptorsets-inputattachment]]
=== Input Attachment

An _input attachment_ (ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT) is a
descriptor type associated with an <<resources-images, image resource>> via
an <<resources-image-views, image view>> that can: be used for
<<synchronization-framebuffer-regions,framebuffer local>> load operations in
fragment shaders.

All image formats that are supported for color attachments
(ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
ifdef::VK_NV_linear_color_attachment[]
or ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV
endif::VK_NV_linear_color_attachment[]
) or depth/stencil attachments
(ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT) for a given image
tiling mode are also supported for input attachments.

An image view used as an input attachment must: be in one of the following
layouts:

  * ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_GENERAL
ifdef::VK_KHR_shared_presentable_image[]
  * ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
endif::VK_KHR_shared_presentable_image[]
ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
  * ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL
  * ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL
endif::VK_VERSION_1_1,VK_KHR_maintenance2[]
ifdef::VK_KHR_synchronization2[]
  * ename:VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR
endif::VK_KHR_synchronization2[]
ifdef::VK_EXT_attachment_feedback_loop_layout[]
  * ename:VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
endif::VK_EXT_attachment_feedback_loop_layout[]
ifdef::VK_KHR_dynamic_rendering_local_read[]
  * ename:VK_IMAGE_LAYOUT_RENDERING_LOCAL_READ_KHR
endif::VK_KHR_dynamic_rendering_local_read[]


ifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
[[descriptorsets-accelerationstructure]]
=== Acceleration Structure

An _acceleration structure_ (
ifdef::VK_KHR_acceleration_structure[ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR]
ifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[or]
ifdef::VK_NV_ray_tracing[ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV]
) is a descriptor type that is used to retrieve scene geometry from within
shaders that are used for ray traversal.
Shaders have read-only access to the memory.
endif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]


ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
[[descriptorsets-mutable]]
=== Mutable

A descriptor of _mutable_ (ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT) type
indicates that this descriptor can: mutate to any of the descriptor types
given in the slink:VkMutableDescriptorTypeListEXT::pname:pDescriptorTypes
list of descriptor types in the pname:pNext chain of
slink:VkDescriptorSetLayoutCreateInfo for this binding.
At any point, each individual descriptor of mutable type has an active
descriptor type.
The active descriptor type can: be any one of the declared types in
pname:pDescriptorTypes.
Additionally, a mutable descriptor's active descriptor type can: be of the
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT type, which is the initial active
descriptor type.
The active descriptor type can: change when the descriptor is updated.
When a descriptor is consumed by binding a descriptor set, the active
descriptor type is considered, not ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT.

An active descriptor type of ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT is
considered an undefined: descriptor.
If a descriptor is consumed where the active descriptor type does not match
what the shader expects, the descriptor is considered an undefined:
descriptor.

[NOTE]
.Note
====
To find which descriptor types are supported as
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the application can: use
flink:vkGetDescriptorSetLayoutSupport with an
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT binding, with the list of descriptor
types to query in the
slink:VkMutableDescriptorTypeCreateInfoEXT::pname:pDescriptorTypes array for
that binding.
====

[NOTE]
.Note
====
The intention of a mutable descriptor type is that implementations allocate
N bytes per descriptor, where N is determined by the maximum descriptor size
for a given descriptor binding.
Implementations are not expected to keep track of the active descriptor
type, and it should be considered a C-like union type.

A mutable descriptor type is not considered as efficient in terms of runtime
performance as using a non-mutable descriptor type, and applications are not
encouraged to use them outside API layering efforts.
Mutable descriptor types can be more efficient if the alternative is using
many different descriptors to emulate mutable descriptor types.
====
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]


[[descriptorsets-sets]]
== Descriptor Sets

Descriptors are grouped together into descriptor set objects.
A descriptor set object is an opaque object containing storage for a set of
descriptors, where the types and number of descriptors is defined by a
descriptor set layout.
The layout object may: be used to define the association of each descriptor
binding with memory or other implementation resources.
The layout is used both for determining the resources that need to be
associated with the descriptor set, and determining the interface between
shader stages and shader resources.


[[descriptorsets-setlayout]]
=== Descriptor Set Layout

[open,refpage='VkDescriptorSetLayout',desc='Opaque handle to a descriptor set layout object',type='handles']
--
A descriptor set layout object is defined by an array of zero or more
descriptor bindings.
Each individual descriptor binding is specified by a descriptor type, a
count (array size) of the number of descriptors in the binding, a set of
shader stages that can: access the binding, and (if using immutable
samplers) an array of sampler descriptors.

Descriptor set layout objects are represented by sname:VkDescriptorSetLayout
handles:

include::{generated}/api/handles/VkDescriptorSetLayout.adoc[]
--

[open,refpage='vkCreateDescriptorSetLayout',desc='Create a new descriptor set layout',type='protos']
--
:refpage: vkCreateDescriptorSetLayout
:objectnameplural: descriptor set layouts
:objectnamecamelcase: descriptorSetLayout
:objectcount: 1

To create descriptor set layout objects, call:

include::{generated}/api/protos/vkCreateDescriptorSetLayout.adoc[]

  * pname:device is the logical device that creates the descriptor set
    layout.
  * pname:pCreateInfo is a pointer to a
    slink:VkDescriptorSetLayoutCreateInfo structure specifying the state of
    the descriptor set layout object.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.
  * pname:pSetLayout is a pointer to a slink:VkDescriptorSetLayout handle in
    which the resulting descriptor set layout object is returned.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

ifdef::VK_VERSION_1_1,VK_KHR_maintenance3,VKSC_VERSION_1_0[]
.Valid Usage
****
ifdef::VK_VERSION_1_1,VK_KHR_maintenance3[]

  * [[VUID-vkCreateDescriptorSetLayout-support-09582]]
    If the descriptor layout does not meet the limits reported through the
    <<limits,physical device limits>>, then
    flink:vkGetDescriptorSetLayoutSupport must return
    slink:VkDescriptorSetLayoutSupport with pname:support equal to
    ename:VK_TRUE for pname:pCreateInfo

endif::VK_VERSION_1_1,VK_KHR_maintenance3[]
ifdef::VKSC_VERSION_1_0[]
include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]

:uniqifier: layoutbindings
:combinedobjectnameplural: descriptor set layout bindings
:combinedparentobject: VkDescriptorSetLayout
:combinedobjectcount: pname:pCreateInfo->bindingCount
:combinedobjectnamecamelcase: descriptorSetLayoutBinding
include::{chapters}/commonvalidity/memory_reservation_request_count_combined_common.adoc[]
endif::VKSC_VERSION_1_0[]
****
endif::VK_VERSION_1_1,VK_KHR_maintenance3,VKSC_VERSION_1_0[]

include::{generated}/validity/protos/vkCreateDescriptorSetLayout.adoc[]
--

[open,refpage='VkDescriptorSetLayoutCreateInfo',desc='Structure specifying parameters of a newly created descriptor set layout',type='structs']
--
Information about the descriptor set layout is passed in a
sname:VkDescriptorSetLayoutCreateInfo structure:

include::{generated}/api/structs/VkDescriptorSetLayoutCreateInfo.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is a bitmask
ifdef::VK_KHR_push_descriptor[]
    of elink:VkDescriptorSetLayoutCreateFlagBits
endif::VK_KHR_push_descriptor[]
    specifying options for descriptor set layout creation.
  * pname:bindingCount is the number of elements in pname:pBindings.
  * pname:pBindings is a pointer to an array of
    slink:VkDescriptorSetLayoutBinding structures.

.Valid Usage
****
  * [[VUID-VkDescriptorSetLayoutCreateInfo-binding-00279]]
ifdef::VK_NV_per_stage_descriptor_set[]
    If the <<features-perStageDescriptorSet, pname:perStageDescriptorSet>>
    feature is not enabled, or pname:flags does not contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV, then the
endif::VK_NV_per_stage_descriptor_set[]
ifndef::VK_NV_per_stage_descriptor_set[]
    The
endif::VK_NV_per_stage_descriptor_set[]
    slink:VkDescriptorSetLayoutBinding::pname:binding members of the
    elements of the pname:pBindings array must: each have different values
ifdef::VK_KHR_push_descriptor[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-00280]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all
    elements of pname:pBindings must: not have a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-02208]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all
    elements of pname:pBindings must: not have a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-00281]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then the
    total number of elements of all bindings must: be less than or equal to
    slink:VkPhysicalDevicePushDescriptorPropertiesKHR::pname:maxPushDescriptors
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04590]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
    pname:flags must: not contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04591]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR,
    pname:pBindings must: not have a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
endif::VK_KHR_push_descriptor[]
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-03000]]
    If any binding has the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
    bit set, pname:flags must: include
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT
  * [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-03001]]
    If any binding has the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
    bit set, then all bindings must: not have pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04592]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT,
    pname:flags must: not contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-pBindings-07303]]
    If any element pname:pBindings[i] has a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, then a
    slink:VkMutableDescriptorTypeCreateInfoEXT must: be present in the
    pname:pNext chain, and pname:mutableDescriptorTypeListCount must: be
    greater than i
  * [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorType-04594]]
    If a binding has a pname:descriptorType value of
    ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, then sname:pImmutableSamplers
    must: be `NULL`
  * [[VUID-VkDescriptorSetLayoutCreateInfo-mutableDescriptorType-04595]]
    If
    slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT::pname:mutableDescriptorType
    is not enabled, pname:pBindings must: not contain a pname:descriptorType
    of ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-04596]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT,
    slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT::pname:mutableDescriptorType
    must: be enabled
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VKSC_VERSION_1_0[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-bindingCount-05011]]
    pname:bindingCount must: be less than or equal to
    <<limits-maxDescriptorSetLayoutBindings,maxDescriptorSetLayoutBindings>>
  * [[VUID-VkDescriptorSetLayoutCreateInfo-descriptorCount-05071]]
    The sum of pname:descriptorCount over all bindings in pname:pBindings
    that have pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_SAMPLER or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER and
    sname:pImmutableSamplers not equal to `NULL` must: be less than or equal
    to
    slink:VkDeviceObjectReservationCreateInfo::pname:maxImmutableSamplersPerDescriptorSetLayout
endif::VKSC_VERSION_1_0[]
ifdef::VK_EXT_descriptor_buffer[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-08000]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, then
    all elements of pname:pBindings must: not have a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-08001]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT,
    pname:flags must: also contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-08002]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, then
    pname:flags must: not contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-08003]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT, then
    pname:flags must: not contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE
endif::VK_VALVE_mutable_descriptor_type[]
endif::VK_EXT_descriptor_buffer[]
ifdef::VK_NV_per_stage_descriptor_set[]
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-09463]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV, then
    <<features-perStageDescriptorSet, pname:perStageDescriptorSet>> must: be
    enabled
  * [[VUID-VkDescriptorSetLayoutCreateInfo-flags-09464]]
    If pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV, then there must:
    not be any two elements of the pname:pBindings array with the same
    slink:VkDescriptorSetLayoutBinding::pname:binding value and their
    slink:VkDescriptorSetLayoutBinding::pname:stageFlags containing the same
    bit
endif::VK_NV_per_stage_descriptor_set[]
****

include::{generated}/validity/structs/VkDescriptorSetLayoutCreateInfo.adoc[]
--

ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
[open,refpage='VkMutableDescriptorTypeCreateInfoEXT',desc='Structure describing the list of possible active descriptor types for mutable type descriptors',type='structs',alias='VkMutableDescriptorTypeCreateInfoVALVE']
--
If the pname:pNext chain of a slink:VkDescriptorSetLayoutCreateInfo or
slink:VkDescriptorPoolCreateInfo structure includes a
slink:VkMutableDescriptorTypeCreateInfoEXT structure, then that structure
specifies Information about the possible descriptor types for mutable
descriptor types.

The sname:VkMutableDescriptorTypeCreateInfoEXT structure is defined as:

include::{generated}/api/structs/VkMutableDescriptorTypeCreateInfoEXT.adoc[]

ifdef::VK_VALVE_mutable_descriptor_type[]
or the equivalent

include::{generated}/api/structs/VkMutableDescriptorTypeCreateInfoVALVE.adoc[]
endif::VK_VALVE_mutable_descriptor_type[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:mutableDescriptorTypeListCount is the number of elements in
    pname:pMutableDescriptorTypeLists.
  * pname:pMutableDescriptorTypeLists is a pointer to an array of
    sname:VkMutableDescriptorTypeListEXT structures.

If pname:mutableDescriptorTypeListCount is zero or if this structure is not
included in the pname:pNext chain, the slink:VkMutableDescriptorTypeListEXT
for each element is considered to be zero or `NULL` for each member.
Otherwise, the descriptor set layout binding at
slink:VkDescriptorSetLayoutCreateInfo::pname:pBindings[i] uses the
descriptor type lists in
slink:VkMutableDescriptorTypeCreateInfoEXT::pname:pMutableDescriptorTypeLists[i].

include::{generated}/validity/structs/VkMutableDescriptorTypeCreateInfoEXT.adoc[]
--

[open,refpage='VkMutableDescriptorTypeListEXT',desc='Structure describing descriptor types that a given descriptor may mutate to',type='structs',alias='VkMutableDescriptorTypeListVALVE']
--
The list of potential descriptor types a given mutable descriptor can:
mutate to is passed in a sname:VkMutableDescriptorTypeListEXT structure.

The sname:VkMutableDescriptorTypeListEXT structure is defined as:

include::{generated}/api/structs/VkMutableDescriptorTypeListEXT.adoc[]

ifdef::VK_VALVE_mutable_descriptor_type[]
or the equivalent

include::{generated}/api/structs/VkMutableDescriptorTypeListVALVE.adoc[]
endif::VK_VALVE_mutable_descriptor_type[]

  * pname:descriptorTypeCount is the number of elements in
    pname:pDescriptorTypes.
  * pname:pDescriptorTypes is `NULL` or a pointer to an array of
    pname:descriptorTypeCount elink:VkDescriptorType values defining which
    descriptor types a given binding may mutate to.

.Valid Usage
****
  * [[VUID-VkMutableDescriptorTypeListEXT-descriptorTypeCount-04597]]
    pname:descriptorTypeCount must: not be `0` if the corresponding binding
    is of ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
  * [[VUID-VkMutableDescriptorTypeListEXT-pDescriptorTypes-04598]]
    pname:pDescriptorTypes must: be a valid pointer to an array of
    pname:descriptorTypeCount valid, unique elink:VkDescriptorType values if
    the given binding is of ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT type
  * [[VUID-VkMutableDescriptorTypeListEXT-descriptorTypeCount-04599]]
    pname:descriptorTypeCount must: be `0` if the corresponding binding is
    not of ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
  * [[VUID-VkMutableDescriptorTypeListEXT-pDescriptorTypes-04600]]
    pname:pDescriptorTypes must: not contain
    ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
  * [[VUID-VkMutableDescriptorTypeListEXT-pDescriptorTypes-04601]]
    pname:pDescriptorTypes must: not contain
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
  * [[VUID-VkMutableDescriptorTypeListEXT-pDescriptorTypes-04602]]
    pname:pDescriptorTypes must: not contain
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkMutableDescriptorTypeListEXT-pDescriptorTypes-04603]]
    pname:pDescriptorTypes must: not contain
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
****

include::{generated}/validity/structs/VkMutableDescriptorTypeListEXT.adoc[]
--
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]

[open,refpage='VkDescriptorSetLayoutCreateFlagBits',desc='Bitmask specifying descriptor set layout properties',type='enums']
--
Bits which can: be set in
slink:VkDescriptorSetLayoutCreateInfo::pname:flags, specifying options for
descriptor set layout, are:

include::{generated}/api/enums/VkDescriptorSetLayoutCreateFlagBits.adoc[]

ifdef::VK_KHR_push_descriptor[]
  * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR specifies
    that descriptor sets must: not be allocated using this layout, and
    descriptors are instead pushed by flink:vkCmdPushDescriptorSetKHR.
endif::VK_KHR_push_descriptor[]
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
// Jon: "UpdateAfterBind" is a vague reference, should be more precise /
// link to the right specification area
  * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT
    specifies that descriptor sets using this layout must: be allocated from
    a descriptor pool created with the
    ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT bit set.
    Descriptor set layouts created with this bit set have alternate limits
    for the maximum number of descriptors per-stage and per-pipeline layout.
    The non-UpdateAfterBind limits only count descriptors in sets created
    without this flag.
    The UpdateAfterBind limits count all descriptors, but the limits may: be
    higher than the non-UpdateAfterBind limits.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_NV_device_generated_commands_compute[]
  * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_INDIRECT_BINDABLE_BIT_NV specifies
    that descriptor sets using this layout allows them to be bound with
    compute pipelines that are created with
    ename:VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV flag set to be used in
    <<device-generated-commands,Device-Generated Commands>>.
endif::VK_NV_device_generated_commands_compute[]
ifdef::VK_EXT_descriptor_buffer[]
  * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
    specifies that this layout must: only be used with descriptor buffers.
  * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT
    specifies that this is a layout only containing immutable samplers that
    can: be bound by flink:vkCmdBindDescriptorBufferEmbeddedSamplersEXT.
    Unlike normal immutable samplers, embedded immutable samplers do not
    require the application to provide them in a descriptor buffer.
endif::VK_EXT_descriptor_buffer[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT specifies
    that descriptor sets using this layout must: be allocated from a
    descriptor pool created with the
    ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT bit set.
    Descriptor set layouts created with this bit have no expressible limit
    for maximum number of descriptors per-stage.
    Host descriptor sets are limited only by available host memory, but may:
    be limited for implementation specific reasons.
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    Implementations may: limit the number of supported descriptors to
    UpdateAfterBind limits or non-UpdateAfterBind limits, whichever is
    larger.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifndef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    Implementations may: limit the number of supported descriptors to
    non-UpdateAfterBind limits.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VK_NV_per_stage_descriptor_set[]
  * ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV specifies that
    binding numbers in descriptor sets using this layout may: represent
    different resources and/or types of resources in each stage.
endif::VK_NV_per_stage_descriptor_set[]

ifndef::VK_KHR_push_descriptor[]
[NOTE]
.Note
====
All bits for this type are defined by extensions, and none of those
extensions are enabled in this build of the specification.
====
endif::VK_KHR_push_descriptor[]
--

[open,refpage='VkDescriptorSetLayoutCreateFlags',desc='Bitmask of VkDescriptorSetLayoutCreateFlagBits',type='flags']
--
include::{generated}/api/flags/VkDescriptorSetLayoutCreateFlags.adoc[]

tname:VkDescriptorSetLayoutCreateFlags is a bitmask type for setting a mask
of zero or more elink:VkDescriptorSetLayoutCreateFlagBits.
--

[open,refpage='VkDescriptorSetLayoutBinding',desc='Structure specifying a descriptor set layout binding',type='structs']
--
The sname:VkDescriptorSetLayoutBinding structure is defined as:

include::{generated}/api/structs/VkDescriptorSetLayoutBinding.adoc[]

  * pname:binding is the binding number of this entry and corresponds to a
    resource of the same binding number in the shader stages.
  * pname:descriptorType is a elink:VkDescriptorType specifying which type
    of resource descriptors are used for this binding.
  * pname:descriptorCount is the number of descriptors contained in the
    binding, accessed in a shader as an
ifndef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[array.]
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    array, except if pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK in which case
    pname:descriptorCount is the size in bytes of the inline uniform block.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If pname:descriptorCount is zero this binding entry is reserved and the
    resource must: not be accessed from any stage via this binding within
    any pipeline using the set layout.
  * pname:stageFlags member is a bitmask of elink:VkShaderStageFlagBits
    specifying which pipeline shader stages can: access a resource for this
    binding.
    ename:VK_SHADER_STAGE_ALL is a shorthand specifying that all defined
    shader stages, including any additional stages defined by extensions,
    can: access the resource.
+
If a shader stage is not included in pname:stageFlags, then a resource must:
not be accessed from that stage via this binding within any pipeline using
the set layout.
Other than input attachments which are limited to the fragment shader, there
are no limitations on what combinations of stages can: use a descriptor
binding, and in particular a binding can: be used by both graphics stages
and the compute stage.
  * pname:pImmutableSamplers affects initialization of samplers.
    If pname:descriptorType specifies a ename:VK_DESCRIPTOR_TYPE_SAMPLER or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER type descriptor, then
    pname:pImmutableSamplers can: be used to initialize a set of _immutable
    samplers_.
    Immutable samplers are permanently bound into the set layout and must:
    not be changed; updating a ename:VK_DESCRIPTOR_TYPE_SAMPLER descriptor
    with immutable samplers is not allowed and updates to a
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptor with
    immutable samplers does not modify the samplers (the image views are
    updated, but the sampler updates are ignored).
    If pname:pImmutableSamplers is not `NULL`, then it is a pointer to an
    array of sampler handles that will be copied into the set layout and
    used for the corresponding binding.
    Only the sampler handles are copied; the sampler objects must: not be
    destroyed before the final use of the set layout and any descriptor
    pools and sets created using it.
    If pname:pImmutableSamplers is `NULL`, then the sampler slots are
    dynamic and sampler handles must: be bound into descriptor sets using
    this layout.
    If pname:descriptorType is not one of these descriptor types, then
    pname:pImmutableSamplers is ignored.

The above layout definition allows the descriptor bindings to be specified
sparsely such that not all binding numbers between 0 and the maximum binding
number need to be specified in the pname:pBindings array.
Bindings that are not specified have a pname:descriptorCount and
pname:stageFlags of zero, and the value of pname:descriptorType is
undefined:.
However, all binding numbers between 0 and the maximum binding number in the
slink:VkDescriptorSetLayoutCreateInfo::pname:pBindings array may: consume
memory in the descriptor set layout even if not all descriptor bindings are
used, though it should: not consume additional memory from the descriptor
pool.

[NOTE]
.Note
====
The maximum binding number specified should: be as compact as possible to
avoid wasted memory.
====

.Valid Usage
****
  * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-00282]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and
    pname:descriptorCount is not `0` and pname:pImmutableSamplers is not
    `NULL`, pname:pImmutableSamplers must: be a valid pointer to an array of
    pname:descriptorCount valid sname:VkSampler handles
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-04604]]
    If the <<features-inlineUniformBlock, pname:inlineUniformBlock>> feature
    is not enabled, pname:descriptorType must: not be
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
  * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-02209]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
    then pname:descriptorCount must: be a multiple of `4`
  * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-08004]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
ifdef::VK_EXT_descriptor_buffer[]
    and slink:VkDescriptorSetLayoutCreateInfo::pname:flags does not contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT
endif::VK_EXT_descriptor_buffer[]
    then pname:descriptorCount must: be less than or equal to
    sname:VkPhysicalDeviceInlineUniformBlockProperties::pname:maxInlineUniformBlockSize
ifdef::VK_EXT_descriptor_buffer[]
  * [[VUID-VkDescriptorSetLayoutBinding-flags-08005]]
    If slink:VkDescriptorSetLayoutCreateInfo::pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT,
    pname:descriptorType must: be ename:VK_DESCRIPTOR_TYPE_SAMPLER
  * [[VUID-VkDescriptorSetLayoutBinding-flags-08006]]
    If slink:VkDescriptorSetLayoutCreateInfo::pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT,
    pname:descriptorCount must: less than or equal to `1`
  * [[VUID-VkDescriptorSetLayoutBinding-flags-08007]]
    If slink:VkDescriptorSetLayoutCreateInfo::pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT,
    and pname:descriptorCount is equal to `1`, pname:pImmutableSamplers
    must: not be `NULL`
endif::VK_EXT_descriptor_buffer[]
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorSetLayoutBinding-descriptorCount-09465]]
    If pname:descriptorCount is not `0`, pname:stageFlags must: be
    ename:VK_SHADER_STAGE_ALL or a valid combination of other
    elink:VkShaderStageFlagBits values
  * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-01510]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT and
    pname:descriptorCount is not `0`, then pname:stageFlags must: be `0` or
    ename:VK_SHADER_STAGE_FRAGMENT_BIT
ifdef::VK_EXT_custom_border_color[]
  * [[VUID-VkDescriptorSetLayoutBinding-pImmutableSamplers-04009]]
    The sampler objects indicated by pname:pImmutableSamplers must: not have
    a pname:borderColor with one of the values
    ename:VK_BORDER_COLOR_FLOAT_CUSTOM_EXT or
    ename:VK_BORDER_COLOR_INT_CUSTOM_EXT
endif::VK_EXT_custom_border_color[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorSetLayoutBinding-descriptorType-04605]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, then
    sname:pImmutableSamplers must: be `NULL`
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VKSC_VERSION_1_0[]
  * [[VUID-VkDescriptorSetLayoutBinding-binding-05012]]
    pname:binding must: be less than the value of
    slink:VkDeviceObjectReservationCreateInfo::pname:descriptorSetLayoutBindingLimit
    provided when the device was created
endif::VKSC_VERSION_1_0[]
ifdef::VK_NV_per_stage_descriptor_set[]
  * [[VUID-VkDescriptorSetLayoutBinding-flags-09466]]
    If slink:VkDescriptorSetLayoutCreateInfo::pname:flags contains
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PER_STAGE_BIT_NV, and
    pname:descriptorCount is not `0`, then pname:stageFlags must: be a valid
    combination of ename:VK_SHADER_STAGE_VERTEX_BIT,
    ename:VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT,
    ename:VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT,
    ename:VK_SHADER_STAGE_GEOMETRY_BIT, ename:VK_SHADER_STAGE_FRAGMENT_BIT
    and ename:VK_SHADER_STAGE_COMPUTE_BIT values
endif::VK_NV_per_stage_descriptor_set[]
****

include::{generated}/validity/structs/VkDescriptorSetLayoutBinding.adoc[]
--

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
[open,refpage='VkDescriptorSetLayoutBindingFlagsCreateInfo',desc='Structure specifying creation flags for descriptor set layout bindings',type='structs',alias='VkDescriptorSetLayoutBindingFlagsCreateInfoEXT']
--
If the pname:pNext chain of a slink:VkDescriptorSetLayoutCreateInfo
structure includes a slink:VkDescriptorSetLayoutBindingFlagsCreateInfo
structure, then that structure includes an array of flags, one for each
descriptor set layout binding.

The slink:VkDescriptorSetLayoutBindingFlagsCreateInfo structure is defined
as:

include::{generated}/api/structs/VkDescriptorSetLayoutBindingFlagsCreateInfo.adoc[]

ifdef::VK_EXT_descriptor_indexing[]
or the equivalent

include::{generated}/api/structs/VkDescriptorSetLayoutBindingFlagsCreateInfoEXT.adoc[]
endif::VK_EXT_descriptor_indexing[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:bindingCount is zero or the number of elements in
    pname:pBindingFlags.
  * pname:pBindingFlags is a pointer to an array of
    tlink:VkDescriptorBindingFlags bitfields, one for each descriptor set
    layout binding.

If pname:bindingCount is zero or if this structure is not included in the
pname:pNext chain, the tlink:VkDescriptorBindingFlags for each descriptor
set layout binding is considered to be zero.
Otherwise, the descriptor set layout binding at
slink:VkDescriptorSetLayoutCreateInfo::pname:pBindings[i] uses the flags in
pname:pBindingFlags[i].

.Valid Usage
****
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-bindingCount-03002]]
    If pname:bindingCount is not zero, pname:bindingCount must: equal
    slink:VkDescriptorSetLayoutCreateInfo::pname:bindingCount
ifdef::VK_KHR_push_descriptor[]
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-flags-03003]]
    If slink:VkDescriptorSetLayoutCreateInfo::pname:flags includes
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR, then all
    elements of pname:pBindingFlags must: not include
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT,
    ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT, or
    ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT
endif::VK_KHR_push_descriptor[]
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-pBindingFlags-03004]]
    If an element of pname:pBindingFlags includes
    ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, then it must:
    be the element with the highest pname:binding number
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingUniformBufferUpdateAfterBind-03005]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingUniformBufferUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingSampledImageUpdateAfterBind-03006]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingSampledImageUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, or
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageImageUpdateAfterBind-03007]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingStorageImageUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageBufferUpdateAfterBind-03008]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingStorageBufferUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingUniformTexelBufferUpdateAfterBind-03009]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingUniformTexelBufferUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingStorageTexelBufferUpdateAfterBind-03010]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingStorageTexelBufferUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingInlineUniformBlockUpdateAfterBind-02211]]
    If
    slink:VkPhysicalDeviceInlineUniformBlockFeatures::pname:descriptorBindingInlineUniformBlockUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_KHR_acceleration_structure[]
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingAccelerationStructureUpdateAfterBind-03570]]
    If
    slink:VkPhysicalDeviceAccelerationStructureFeaturesKHR::pname:descriptorBindingAccelerationStructureUpdateAfterBind
    is not enabled, all bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR or
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
endif::VK_KHR_acceleration_structure[]
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-None-03011]]
    All bindings with descriptor type
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC must: not use
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingUpdateUnusedWhilePending-03012]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingUpdateUnusedWhilePending
    is not enabled, all elements of pname:pBindingFlags must: not include
    ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingPartiallyBound-03013]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingPartiallyBound
    is not enabled, all elements of pname:pBindingFlags must: not include
    ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-descriptorBindingVariableDescriptorCount-03014]]
    If
    slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingVariableDescriptorCount
    is not enabled, all elements of pname:pBindingFlags must: not include
    ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT
  * [[VUID-VkDescriptorSetLayoutBindingFlagsCreateInfo-pBindingFlags-03015]]
    If an element of pname:pBindingFlags includes
    ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, that
    element's pname:descriptorType must: not be
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC
****

include::{generated}/validity/structs/VkDescriptorSetLayoutBindingFlagsCreateInfo.adoc[]
--

[open,refpage='VkDescriptorBindingFlagBits',desc='Bitmask specifying descriptor set layout binding properties',type='enums',alias='VkDescriptorBindingFlagBitsEXT']
--
Bits which can: be set in each element of
slink:VkDescriptorSetLayoutBindingFlagsCreateInfo::pname:pBindingFlags,
specifying options for the corresponding descriptor set layout binding, are:

include::{generated}/api/enums/VkDescriptorBindingFlagBits.adoc[]

ifdef::VK_EXT_descriptor_indexing[]
or the equivalent

include::{generated}/api/enums/VkDescriptorBindingFlagBitsEXT.adoc[]
endif::VK_EXT_descriptor_indexing[]

// Used below for VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
:maxBlockSize: <<limits-maxInlineUniformBlockSize, pname:maxInlineUniformBlockSize>>
:maxTotalSize: <<limits-maxInlineUniformTotalSize, pname:maxInlineUniformTotalSize>>

  * ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT indicates that if
    descriptors in this binding are updated between when the descriptor set
    is bound in a command buffer and when that command buffer is submitted
    to a queue, then the submission will use the most recently set
    descriptors for this binding and the updates do not invalidate the
    command buffer.
    Descriptor bindings created with this flag are also partially exempt
    from the external synchronization requirement in
ifdef::VK_KHR_descriptor_update_template[]
    flink:vkUpdateDescriptorSetWithTemplateKHR and
endif::VK_KHR_descriptor_update_template[]
    flink:vkUpdateDescriptorSets.
    Multiple descriptors with this flag set can: be updated concurrently in
    different threads, though the same descriptor must: not be updated
    concurrently by two threads.
    Descriptors with this flag set can: be updated concurrently with the set
    being bound to a command buffer in another thread, but not concurrently
    with the set being reset or freed.
  * ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT indicates that
    descriptors in this binding that are not _dynamically used_ need not
    contain valid descriptors at the time the descriptors are consumed.
    A descriptor is dynamically used if any shader invocation executes an
    instruction that performs any memory access using the descriptor.
    If a descriptor is not dynamically used, any resource referenced by the
    descriptor is not considered to be referenced during command execution.
  * ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT indicates
    that descriptors in this binding can: be updated after a command buffer
    has bound this descriptor set, or while a command buffer that uses this
    descriptor set is pending execution, as long as the descriptors that are
    updated are not used by those command buffers.
    Descriptor bindings created with this flag are also partially exempt
    from the external synchronization requirement in
    flink:vkUpdateDescriptorSetWithTemplateKHR and
    flink:vkUpdateDescriptorSets in the same way as for
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT.
    If ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT is also set, then
    descriptors can: be updated as long as they are not dynamically used by
    any shader invocations.
    If ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT is not set, then
    descriptors can: be updated as long as they are not statically used by
    any shader invocations.
  * ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT indicates that
    this is a _variable-sized descriptor binding_ whose size will be
    specified when a descriptor set is allocated using this layout.
    The value of pname:descriptorCount is treated as an upper bound on the
    size of the binding.
    This must: only be used for the last binding in the descriptor set
    layout (i.e. the binding with the largest value of pname:binding).
    For the purposes of counting against limits such as
    pname:maxDescriptorSet* and pname:maxPerStageDescriptor*, the full value
    of pname:descriptorCount is
ifndef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[counted.]
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    counted, except for descriptor bindings with a descriptor type of
ifndef::VK_EXT_descriptor_buffer[]
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK.
endif::VK_EXT_descriptor_buffer[]
ifdef::VK_EXT_descriptor_buffer[]
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, when
    slink:VkDescriptorSetLayoutCreateInfo::pname:flags does not contain
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT.
endif::VK_EXT_descriptor_buffer[]
    In this case, pname:descriptorCount specifies the upper bound on the
    byte size of the binding; thus it counts against the
ifdef::VK_VERSION_1_3+VK_EXT_inline_uniform_block[{maxBlockSize} and {maxTotalSize} limits]
ifndef::VK_VERSION_1_3[{maxBlockSize} limit]
ifndef::VK_EXT_inline_uniform_block[{maxTotalSize} limit]
instead.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

[NOTE]
.Note
====
Note that while ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT and
ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT both involve
updates to descriptor sets after they are bound,
ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT is a weaker
requirement since it is only about descriptors that are not used, whereas
ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT requires the
implementation to observe updates to descriptors that are used.
====
--

[open,refpage='VkDescriptorBindingFlags',desc='Bitmask of VkDescriptorBindingFlagBits',type='flags',alias='VkDescriptorBindingFlagsEXT']
--
include::{generated}/api/flags/VkDescriptorBindingFlags.adoc[]

ifdef::VK_EXT_descriptor_indexing[]
or the equivalent

include::{generated}/api/flags/VkDescriptorBindingFlagsEXT.adoc[]
endif::VK_EXT_descriptor_indexing[]

tname:VkDescriptorBindingFlags is a bitmask type for setting a mask of zero
or more elink:VkDescriptorBindingFlagBits.
--
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

ifdef::VK_VERSION_1_1,VK_KHR_maintenance3[]
[open,refpage='vkGetDescriptorSetLayoutSupport',desc='Query whether a descriptor set layout can be created',type='protos']
--
To query information about whether a descriptor set layout can: be created,
call:

ifdef::VK_VERSION_1_1[]
include::{generated}/api/protos/vkGetDescriptorSetLayoutSupport.adoc[]
endif::VK_VERSION_1_1[]

ifdef::VK_VERSION_1_1+VK_KHR_maintenance3[or the equivalent command]

ifdef::VK_KHR_maintenance3[]
include::{generated}/api/protos/vkGetDescriptorSetLayoutSupportKHR.adoc[]
endif::VK_KHR_maintenance3[]

  * pname:device is the logical device that would create the descriptor set
    layout.
  * pname:pCreateInfo is a pointer to a
    slink:VkDescriptorSetLayoutCreateInfo structure specifying the state of
    the descriptor set layout object.
  * pname:pSupport is a pointer to a slink:VkDescriptorSetLayoutSupport
    structure, in which information about support for the descriptor set
    layout object is returned.

Some implementations have limitations on what fits in a descriptor set which
are not easily expressible in terms of existing limits like
pname:maxDescriptorSet*, for example if all descriptor types share a limited
space in memory but each descriptor is a different size or alignment.
This command returns information about whether a descriptor set satisfies
this limit.
If the descriptor set layout satisfies the
slink:VkPhysicalDeviceMaintenance3Properties::pname:maxPerSetDescriptors
limit, this command is guaranteed to return ename:VK_TRUE in
slink:VkDescriptorSetLayoutSupport::pname:supported.
If the descriptor set layout exceeds the
slink:VkPhysicalDeviceMaintenance3Properties::pname:maxPerSetDescriptors
limit, whether the descriptor set layout is supported is
implementation-dependent and may: depend on whether the descriptor sizes and
alignments cause the layout to exceed an internal limit.

This command does not consider other limits such as
pname:maxPerStageDescriptor*, and so a descriptor set layout that is
supported according to this command must: still satisfy the pipeline layout
limits such as pname:maxPerStageDescriptor* in order to be used in a
pipeline layout.

[NOTE]
.Note
====
This is a sname:VkDevice query rather than sname:VkPhysicalDevice because
the answer may: depend on enabled features.
====

include::{generated}/validity/protos/vkGetDescriptorSetLayoutSupport.adoc[]
--

[open,refpage='VkDescriptorSetLayoutSupport',desc='Structure returning information about whether a descriptor set layout can be supported',type='structs']
--
Information about support for the descriptor set layout is returned in a
sname:VkDescriptorSetLayoutSupport structure:

include::{generated}/api/structs/VkDescriptorSetLayoutSupport.adoc[]

ifdef::VK_KHR_maintenance3[]
or the equivalent

include::{generated}/api/structs/VkDescriptorSetLayoutSupportKHR.adoc[]
endif::VK_KHR_maintenance3[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:supported specifies whether the descriptor set layout can: be
    created.

pname:supported is set to ename:VK_TRUE if the descriptor set can: be
created, or else is set to ename:VK_FALSE.

include::{generated}/validity/structs/VkDescriptorSetLayoutSupport.adoc[]
--
endif::VK_VERSION_1_1,VK_KHR_maintenance3[]

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
[open,refpage='VkDescriptorSetVariableDescriptorCountLayoutSupport',desc='Structure returning information about whether a descriptor set layout can be supported',type='structs',alias='VkDescriptorSetVariableDescriptorCountLayoutSupportEXT']
--
If the pname:pNext chain of a slink:VkDescriptorSetLayoutSupport structure
includes a sname:VkDescriptorSetVariableDescriptorCountLayoutSupport
structure, then that structure returns additional information about whether
the descriptor set layout is supported.

include::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountLayoutSupport.adoc[]

ifdef::VK_EXT_descriptor_indexing[]
or the equivalent

include::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountLayoutSupportEXT.adoc[]
endif::VK_EXT_descriptor_indexing[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:maxVariableDescriptorCount indicates the maximum number of
    descriptors supported in the highest numbered binding of the layout, if
    that binding is variable-sized.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the highest numbered binding of the layout has a descriptor type of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then
    pname:maxVariableDescriptorCount indicates the maximum byte size
    supported for the binding, if that binding is variable-sized.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

If the slink:VkDescriptorSetLayoutCreateInfo structure specified in
flink:vkGetDescriptorSetLayoutSupport::pname:pCreateInfo includes a
variable-sized descriptor, then pname:supported is determined assuming the
requested size of the variable-sized descriptor, and
pname:maxVariableDescriptorCount is set to the maximum size of that
descriptor that can: be successfully created (which is greater than or equal
to the requested size passed in).
If the slink:VkDescriptorSetLayoutCreateInfo structure does not include a
variable-sized descriptor, or if the
slink:VkPhysicalDeviceDescriptorIndexingFeatures::pname:descriptorBindingVariableDescriptorCount
feature is not enabled, then pname:maxVariableDescriptorCount is set to
zero.
For the purposes of this command, a variable-sized descriptor binding with a
pname:descriptorCount of zero is treated as having a pname:descriptorCount
of
ifndef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[one,]
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
four if pname:descriptorType is
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, or one otherwise,
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
and thus the binding is not ignored and the maximum descriptor count will be
returned.
If the layout is not supported, then the value written to
pname:maxVariableDescriptorCount is undefined:.

include::{generated}/validity/structs/VkDescriptorSetVariableDescriptorCountLayoutSupport.adoc[]
--
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

The following examples show a shader snippet using two descriptor sets, and
application code that creates corresponding descriptor set layouts.

.GLSL example
[source,glsl]
----
//
// binding to a single sampled image descriptor in set 0
//
layout (set=0, binding=0) uniform texture2D mySampledImage;

//
// binding to an array of sampled image descriptors in set 0
//
layout (set=0, binding=1) uniform texture2D myArrayOfSampledImages[12];

//
// binding to a single uniform buffer descriptor in set 1
//
layout (set=1, binding=0) uniform myUniformBuffer
{
    vec4 myElement[32];
};
----

.SPIR-V example
[source,spirv]
----
               ...
          %1 = OpExtInstImport "GLSL.std.450"
               ...
               OpName %9 "mySampledImage"
               OpName %14 "myArrayOfSampledImages"
               OpName %18 "myUniformBuffer"
               OpMemberName %18 0 "myElement"
               OpName %20 ""
               OpDecorate %9 DescriptorSet 0
               OpDecorate %9 Binding 0
               OpDecorate %14 DescriptorSet 0
               OpDecorate %14 Binding 1
               OpDecorate %17 ArrayStride 16
               OpMemberDecorate %18 0 Offset 0
               OpDecorate %18 Block
               OpDecorate %20 DescriptorSet 1
               OpDecorate %20 Binding 0
          %2 = OpTypeVoid
          %3 = OpTypeFunction %2
          %6 = OpTypeFloat 32
          %7 = OpTypeImage %6 2D 0 0 0 1 Unknown
          %8 = OpTypePointer UniformConstant %7
          %9 = OpVariable %8 UniformConstant
         %10 = OpTypeInt 32 0
         %11 = OpConstant %10 12
         %12 = OpTypeArray %7 %11
         %13 = OpTypePointer UniformConstant %12
         %14 = OpVariable %13 UniformConstant
         %15 = OpTypeVector %6 4
         %16 = OpConstant %10 32
         %17 = OpTypeArray %15 %16
         %18 = OpTypeStruct %17
         %19 = OpTypePointer Uniform %18
         %20 = OpVariable %19 Uniform
               ...
----

.API example
[source,c++]
----
VkResult myResult;

const VkDescriptorSetLayoutBinding myDescriptorSetLayoutBinding[] =
{
    // binding to a single image descriptor
    {
        .binding = 0,
        .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
        .descriptorCount = 1,
        .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
        .pImmutableSamplers = NULL
    },

    // binding to an array of image descriptors
    {
        .binding = 1,
        .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
        .descriptorCount = 12,
        .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
        .pImmutableSamplers = NULL
    },

    // binding to a single uniform buffer descriptor
    {
        .binding = 0,
        .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
        .descriptorCount = 1,
        .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
        .pImmutableSamplers = NULL
    }
};

const VkDescriptorSetLayoutCreateInfo myDescriptorSetLayoutCreateInfo[] =
{
    // Information for first descriptor set with two descriptor bindings
    {
        .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
        .pNext = NULL,
        .flags = 0,
        .bindingCount = 2,
        .pBindings = &myDescriptorSetLayoutBinding[0]
    },

    // Information for second descriptor set with one descriptor binding
    {
        .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
        .pNext = NULL,
        .flags = 0,
        .bindingCount = 1,
        .pBindings = &myDescriptorSetLayoutBinding[2]
    }
};

VkDescriptorSetLayout myDescriptorSetLayout[2];

//
// Create first descriptor set layout
//
myResult = vkCreateDescriptorSetLayout(
    myDevice,
    &myDescriptorSetLayoutCreateInfo[0],
    NULL,
    &myDescriptorSetLayout[0]);

//
// Create second descriptor set layout
//
myResult = vkCreateDescriptorSetLayout(
    myDevice,
    &myDescriptorSetLayoutCreateInfo[1],
    NULL,
    &myDescriptorSetLayout[1]);
----

[open,refpage='vkDestroyDescriptorSetLayout',desc='Destroy a descriptor set layout object',type='protos']
--
To destroy a descriptor set layout, call:

include::{generated}/api/protos/vkDestroyDescriptorSetLayout.adoc[]

  * pname:device is the logical device that destroys the descriptor set
    layout.
  * pname:descriptorSetLayout is the descriptor set layout to destroy.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.

ifndef::VKSC_VERSION_1_0[]
.Valid Usage
****
  * [[VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00284]]
    If sname:VkAllocationCallbacks were provided when
    pname:descriptorSetLayout was created, a compatible set of callbacks
    must: be provided here
  * [[VUID-vkDestroyDescriptorSetLayout-descriptorSetLayout-00285]]
    If no sname:VkAllocationCallbacks were provided when
    pname:descriptorSetLayout was created, pname:pAllocator must: be `NULL`
****
endif::VKSC_VERSION_1_0[]

include::{generated}/validity/protos/vkDestroyDescriptorSetLayout.adoc[]
--


[[descriptorsets-pipelinelayout]]
=== Pipeline Layouts

[open,refpage='VkPipelineLayout',desc='Opaque handle to a pipeline layout object',type='handles']
--
Access to descriptor sets from a pipeline is accomplished through a
_pipeline layout_.
Zero or more descriptor set layouts and zero or more push constant ranges
are combined to form a pipeline layout object describing the complete set of
resources that can: be accessed by a pipeline.
The pipeline layout represents a sequence of descriptor sets with each
having a specific layout.
This sequence of layouts is used to determine the interface between shader
stages and shader resources.
Each pipeline is created using a pipeline layout.

Pipeline layout objects are represented by sname:VkPipelineLayout handles:

include::{generated}/api/handles/VkPipelineLayout.adoc[]
--

[open,refpage='vkCreatePipelineLayout',desc='Creates a new pipeline layout object',type='protos']
--
:refpage: vkCreatePipelineLayout
:objectnameplural: pipeline layouts
:objectnamecamelcase: pipelineLayout
:objectcount: 1

To create a pipeline layout, call:

include::{generated}/api/protos/vkCreatePipelineLayout.adoc[]

  * pname:device is the logical device that creates the pipeline layout.
  * pname:pCreateInfo is a pointer to a slink:VkPipelineLayoutCreateInfo
    structure specifying the state of the pipeline layout object.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.
  * pname:pPipelineLayout is a pointer to a slink:VkPipelineLayout handle in
    which the resulting pipeline layout object is returned.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

ifdef::VKSC_VERSION_1_0[]
.Valid Usage
****
include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]
****
endif::VKSC_VERSION_1_0[]

include::{generated}/validity/protos/vkCreatePipelineLayout.adoc[]
--

[open,refpage='VkPipelineLayoutCreateInfo',desc='Structure specifying the parameters of a newly created pipeline layout object',type='structs']
--
The slink:VkPipelineLayoutCreateInfo structure is defined as:

include::{generated}/api/structs/VkPipelineLayoutCreateInfo.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is a bitmask of elink:VkPipelineLayoutCreateFlagBits
    specifying options for pipeline layout creation.
  * pname:setLayoutCount is the number of descriptor sets included in the
    pipeline layout.
  * pname:pSetLayouts is a pointer to an array of
    sname:VkDescriptorSetLayout objects.
  * pname:pushConstantRangeCount is the number of push constant ranges
    included in the pipeline layout.
  * pname:pPushConstantRanges is a pointer to an array of
    sname:VkPushConstantRange structures defining a set of push constant
    ranges for use in a single pipeline layout.
    In addition to descriptor set layouts, a pipeline layout also describes
    how many push constants can: be accessed by each stage of the pipeline.
+
[NOTE]
.Note
====
Push constants represent a high speed path to modify constant data in
pipelines that is expected to outperform memory-backed resource updates.
====

ifdef::VKSC_VERSION_1_0[]
In Vulkan SC, the pipeline compilation process occurs
<<pipelines-offline-compilation,offline>>, but the application must: still
provide values to sname:VkPipelineLayoutCreateInfo that match the values
used for offline compilation of pipelines using this slink:VkPipelineLayout.
endif::VKSC_VERSION_1_0[]

.Valid Usage
****
  * [[VUID-VkPipelineLayoutCreateInfo-setLayoutCount-00286]]
    pname:setLayoutCount must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxBoundDescriptorSets
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03016]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_SAMPLER and
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given
    shader stage across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSamplers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03017]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER
    and ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any
    given shader stage across all elements of pname:pSetLayouts must: be
    less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorUniformBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03018]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER
    and ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any
    given shader stage across all elements of pname:pSetLayouts must: be
    less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-06939]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
ifdef::VK_QCOM_image_processing[]
    ename:VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM,
    ename:VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM,
endif::VK_QCOM_image_processing[]
    and ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, accessible to any
    given shader stage across all elements of pname:pSetLayouts must: be
    less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorSampledImages
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03020]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
    and ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any
    given shader stage across all elements of pname:pSetLayouts must: be
    less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorStorageImages
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03021]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT
    accessible to any given shader stage across all elements of
    pname:pSetLayouts must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxPerStageDescriptorInputAttachments
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02214]]
    The total number of bindings in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
    and
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK accessible to any given
    shader stage across all elements of pname:pSetLayouts, must: be less
    than or equal to
    sname:VkPhysicalDeviceInlineUniformBlockProperties::pname:maxPerStageDescriptorInlineUniformBlocks
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03022]]
    The total number of descriptors with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_SAMPLER and
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible to any given
    shader stage across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindSamplers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03023]]
    The total number of descriptors with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER and
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible to any given
    shader stage across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindUniformBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03024]]
    The total number of descriptors with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER and
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible to any given
    shader stage across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindStorageBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03025]]
    The total number of descriptors with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible to any given
    shader stage across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindSampledImages
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03026]]
    The total number of descriptors with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible to any given
    shader stage across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindStorageImages
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03027]]
    The total number of descriptors with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible to any given shader
    stage across all elements of pname:pSetLayouts must: be less than or
    equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxPerStageDescriptorUpdateAfterBindInputAttachments
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02215]]
    The total number of bindings with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK accessible to any given
    shader stage across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceInlineUniformBlockProperties::pname:maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03028]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_SAMPLER and
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetSamplers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03029]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER
    accessible across all shader stages and across all elements of
    pname:pSetLayouts must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetUniformBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03030]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetUniformBuffersDynamic
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03031]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER
    accessible across all shader stages and across all elements of
    pname:pSetLayouts must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03032]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageBuffersDynamic
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03033]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetSampledImages
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03034]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
    and ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetStorageImages
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03035]]
    The total number of descriptors in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT
    accessible across all shader stages and across all elements of
    pname:pSetLayouts must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxDescriptorSetInputAttachments
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02216]]
    The total number of bindings in descriptor set layouts
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceInlineUniformBlockProperties::pname:maxDescriptorSetInlineUniformBlocks
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03036]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_SAMPLER and
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindSamplers
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03037]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER accessible across all shader
    stages and across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindUniformBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03038]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindUniformBuffersDynamic
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03039]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER accessible across all shader
    stages and across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindStorageBuffers
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03040]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindStorageBuffersDynamic
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03041]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindSampledImages
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03042]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindStorageImages
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-03043]]
    The total number of descriptors of the type
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT accessible across all shader
    stages and across all elements of pname:pSetLayouts must: be less than
    or equal to
    sname:VkPhysicalDeviceDescriptorIndexingProperties::pname:maxDescriptorSetUpdateAfterBindInputAttachments
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02217]]
    The total number of bindings with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceInlineUniformBlockProperties::pname:maxDescriptorSetUpdateAfterBindInlineUniformBlocks
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_VERSION_1_3[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-06531]]
    The total number of descriptors with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    sname:VkPhysicalDeviceVulkan13Properties::pname:maxInlineUniformTotalSize
endif::VK_VERSION_1_3[]
  * [[VUID-VkPipelineLayoutCreateInfo-pPushConstantRanges-00292]]
    Any two elements of pname:pPushConstantRanges must: not include the same
    stage in pname:stageFlags
ifdef::VK_KHR_push_descriptor[]
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293]]
    pname:pSetLayouts must: not contain more than one descriptor set layout
    that was created with
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set
endif::VK_KHR_push_descriptor[]
ifdef::VK_KHR_acceleration_structure[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03571]]
    The total number of bindings in descriptor set layouts created without
    the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit
    set with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible to any
    given shader stage across all elements of pname:pSetLayouts must: be
    less than or equal to
    slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxPerStageDescriptorAccelerationStructures
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03572]]
    The total number of bindings with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible to any
    given shader stage across all elements of pname:pSetLayouts must: be
    less than or equal to
    slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxPerStageDescriptorUpdateAfterBindAccelerationStructures
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03573]]
    The total number of bindings in descriptor set layouts created without
    the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit
    set with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible across
    all shader stages and across all elements of pname:pSetLayouts must: be
    less than or equal to
    slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxDescriptorSetAccelerationStructures
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-03574]]
    The total number of bindings with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR accessible across
    all shader stages and across all elements of pname:pSetLayouts must: be
    less than or equal to
    slink:VkPhysicalDeviceAccelerationStructurePropertiesKHR::pname:maxDescriptorSetUpdateAfterBindAccelerationStructures
endif::VK_KHR_acceleration_structure[]
ifdef::VK_NV_ray_tracing[]
  * [[VUID-VkPipelineLayoutCreateInfo-descriptorType-02381]]
    The total number of bindings with a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV accessible across all
    shader stages and across all elements of pname:pSetLayouts must: be less
    than or equal to
    slink:VkPhysicalDeviceRayTracingPropertiesNV::pname:maxDescriptorSetAccelerationStructures
endif::VK_NV_ray_tracing[]
ifdef::VK_EXT_fragment_density_map2[]
  * [[VUID-VkPipelineLayoutCreateInfo-pImmutableSamplers-03566]]
    The total number of pname:pImmutableSamplers created with pname:flags
    containing ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT or
    ename:VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT across
    all shader stages and across all elements of pname:pSetLayouts must: be
    less than or equal to <<limits-maxDescriptorSetSubsampledSamplers,
    sname:VkPhysicalDeviceFragmentDensityMap2PropertiesEXT::pname:maxDescriptorSetSubsampledSamplers>>
endif::VK_EXT_fragment_density_map2[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-04606]]
    Any element of pname:pSetLayouts must: not have been created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT bit set
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkPipelineLayoutCreateInfo-graphicsPipelineLibrary-06753]]
ifdef::VK_EXT_graphics_pipeline_library[]
    If <<features-graphicsPipelineLibrary, pname:graphicsPipelineLibrary>>
    is not enabled, elements
endif::VK_EXT_graphics_pipeline_library[]
ifndef::VK_EXT_graphics_pipeline_library[Elements]
    of pname:pSetLayouts must: be valid slink:VkDescriptorSetLayout objects
ifdef::VK_EXT_descriptor_buffer[]
  * [[VUID-VkPipelineLayoutCreateInfo-pSetLayouts-08008]]
    If any element of pname:pSetLayouts was created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT bit set,
    all elements of pname:pSetLayouts must: have been created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT bit set
endif::VK_EXT_descriptor_buffer[]
****

include::{generated}/validity/structs/VkPipelineLayoutCreateInfo.adoc[]
--

[open,refpage='VkPipelineLayoutCreateFlagBits',desc='Pipeline layout creation flag bits',type='enums']
--
include::{generated}/api/enums/VkPipelineLayoutCreateFlagBits.adoc[]

ifndef::VK_EXT_graphics_pipeline_library[]
All values for this enum are defined by extensions.
endif::VK_EXT_graphics_pipeline_library[]
ifdef::VK_EXT_graphics_pipeline_library[]
  * ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT specifies that
    implementations must: ensure that the properties and/or absence of a
    particular descriptor set do not influence any other properties of the
    pipeline layout.
    This allows pipelines libraries linked without
    ename:VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT to be created
    with a subset of the total descriptor sets.
endif::VK_EXT_graphics_pipeline_library[]
--

[open,refpage='VkPipelineLayoutCreateFlags',desc='Bitmask of pipeline layout creation flag bits',type='flags']
--
include::{generated}/api/flags/VkPipelineLayoutCreateFlags.adoc[]

tname:VkPipelineLayoutCreateFlags is a bitmask type for setting a mask of
elink:VkPipelineLayoutCreateFlagBits.
--

[open,refpage='VkPushConstantRange',desc='Structure specifying a push constant range',type='structs']
--
The sname:VkPushConstantRange structure is defined as:

include::{generated}/api/structs/VkPushConstantRange.adoc[]

  * pname:stageFlags is a set of stage flags describing the shader stages
    that will access a range of push constants.
    If a particular stage is not included in the range, then accessing
    members of that range of push constants from the corresponding shader
    stage will return undefined: values.
  * pname:offset and pname:size are the start offset and size, respectively,
    consumed by the range.
    Both pname:offset and pname:size are in units of bytes and must: be a
    multiple of 4.
    The layout of the push constant variables is specified in the shader.

.Valid Usage
****
  * [[VUID-VkPushConstantRange-offset-00294]]
    pname:offset must: be less than
    sname:VkPhysicalDeviceLimits::pname:maxPushConstantsSize
  * [[VUID-VkPushConstantRange-offset-00295]]
    pname:offset must: be a multiple of `4`
  * [[VUID-VkPushConstantRange-size-00296]]
    pname:size must: be greater than `0`
  * [[VUID-VkPushConstantRange-size-00297]]
    pname:size must: be a multiple of `4`
  * [[VUID-VkPushConstantRange-size-00298]]
    pname:size must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxPushConstantsSize minus
    pname:offset
****

include::{generated}/validity/structs/VkPushConstantRange.adoc[]
--

Once created, pipeline layouts are used as part of pipeline creation (see
<<pipelines, Pipelines>>), as part of binding descriptor sets (see
<<descriptorsets-binding, Descriptor Set Binding>>), and as part of setting
push constants (see <<descriptorsets-push-constants, Push Constant
Updates>>).
Pipeline creation accepts a pipeline layout as input, and the layout may: be
used to map (set, binding, arrayElement) tuples to implementation resources
or memory locations within a descriptor set.
The assignment of implementation resources depends only on the bindings
defined in the descriptor sets that comprise the pipeline layout, and not on
any shader source.

[[descriptorsets-pipelinelayout-consistency]]
All resource variables <<shaders-staticuse,statically used>> in all shaders
in a pipeline must: be declared with a (set, binding, arrayElement) that
exists in the corresponding descriptor set layout and is of an appropriate
descriptor type and includes the set of shader stages it is used by in
pname:stageFlags.
The pipeline layout can: include entries that are not used by a particular
pipeline.
The pipeline layout allows the application to provide a consistent set of
bindings across multiple pipeline compiles, which enables those pipelines to
be compiled in a way that the implementation may: cheaply switch pipelines
without reprogramming the bindings.

Similarly, the push constant block declared in each shader (if present)
must: only place variables at offsets that are each included in a push
constant range with pname:stageFlags including the bit corresponding to the
shader stage that uses it.
The pipeline layout can: include ranges or portions of ranges that are not
used by a particular pipeline.

There is a limit on the total number of resources of each type that can: be
included in bindings in all descriptor set layouts in a pipeline layout as
shown in <<descriptorsets-pipelinelayout-limits,Pipeline Layout Resource
Limits>>.
The "`Total Resources Available`" column gives the limit on the number of
each type of resource that can: be included in bindings in all descriptor
sets in the pipeline layout.
Some resource types count against multiple limits.
Additionally, there are limits on the total number of each type of resource
that can: be used in any pipeline stage as described in
<<interfaces-resources-limits,Shader Resource Limits>>.

[[descriptorsets-pipelinelayout-limits]]
.Pipeline Layout Resource Limits
[width="80%",cols="<37,<22",options="header"]
|====
| Total Resources Available | Resource Types
.2+<.^| pname:maxDescriptorSetSamplers
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindSamplers
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | sampler           | combined image sampler
.3+<.^| pname:maxDescriptorSetSampledImages
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindSampledImages
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | sampled image     | combined image sampler | uniform texel buffer
.2+<.^| pname:maxDescriptorSetStorageImages
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindStorageImages
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | storage image     | storage texel buffer
.2+<.^| pname:maxDescriptorSetUniformBuffers
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindUniformBuffers
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | uniform buffer    | uniform buffer dynamic
| pname:maxDescriptorSetUniformBuffersDynamic
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindUniformBuffersDynamic
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | uniform buffer dynamic
.2+<.^| pname:maxDescriptorSetStorageBuffers
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindStorageBuffers
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | storage buffer    | storage buffer dynamic
| pname:maxDescriptorSetStorageBuffersDynamic
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindStorageBuffersDynamic
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | storage buffer dynamic
| pname:maxDescriptorSetInputAttachments
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindInputAttachments
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | input attachment
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
| pname:maxDescriptorSetInlineUniformBlocks
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
or pname:maxDescriptorSetUpdateAfterBindInlineUniformBlocks
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
            | inline uniform block
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
| pname:maxDescriptorSetAccelerationStructures
ifdef::VK_KHR_acceleration_structure[]
or pname:maxDescriptorSetUpdateAfterBindAccelerationStructures
endif::VK_KHR_acceleration_structure[]
            | acceleration structure
endif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
|====


[open,refpage='vkDestroyPipelineLayout',desc='Destroy a pipeline layout object',type='protos']
--
To destroy a pipeline layout, call:

include::{generated}/api/protos/vkDestroyPipelineLayout.adoc[]

  * pname:device is the logical device that destroys the pipeline layout.
  * pname:pipelineLayout is the pipeline layout to destroy.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.

.Valid Usage
****
ifndef::VKSC_VERSION_1_0[]
  * [[VUID-vkDestroyPipelineLayout-pipelineLayout-00299]]
    If sname:VkAllocationCallbacks were provided when pname:pipelineLayout
    was created, a compatible set of callbacks must: be provided here
  * [[VUID-vkDestroyPipelineLayout-pipelineLayout-00300]]
    If no sname:VkAllocationCallbacks were provided when
    pname:pipelineLayout was created, pname:pAllocator must: be `NULL`
endif::VKSC_VERSION_1_0[]
  * [[VUID-vkDestroyPipelineLayout-pipelineLayout-02004]]
    pname:pipelineLayout must: not have been passed to any ftext:vkCmd*
    command for any command buffers that are still in the
    <<commandbuffers-lifecycle, recording state>> when
    fname:vkDestroyPipelineLayout is called
****

include::{generated}/validity/protos/vkDestroyPipelineLayout.adoc[]
--


[[descriptorsets-compatibility]]
==== Pipeline Layout Compatibility

Two pipeline layouts are defined to be "`compatible for
<<descriptorsets-push-constants, push constants>>`" if they were created
with identical push constant ranges.
Two pipeline layouts are defined to be "`compatible for set N`" if they were
created with _identically defined_ descriptor set layouts for sets zero
through N,
ifdef::VK_EXT_graphics_pipeline_library[]
if both of them either were or were not created with
ename:VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT,
endif::VK_EXT_graphics_pipeline_library[]
and if they were created with identical push constant ranges.

When binding a descriptor set (see <<descriptorsets-binding, Descriptor Set
Binding>>) to set number N, a previously bound descriptor set bound with
lower index M than N is disturbed if the pipeline layouts for set M and N
are not compatible for set M. Otherwise, the bound descriptor set in M is
not disturbed.

If, additionally, the previously bound descriptor set for set N was bound
using a pipeline layout not compatible for set N, then all bindings in sets
numbered greater than N are disturbed.

When binding a pipeline, the pipeline can: correctly access any previously
bound descriptor set N if it was bound with compatible pipeline layout for
set N, and it was not disturbed.

Layout compatibility means that descriptor sets can: be bound to a command
buffer for use by any pipeline created with a compatible pipeline layout,
and without having bound a particular pipeline first.
It also means that descriptor sets can: remain valid across a pipeline
change, and the same resources will be accessible to the newly bound
pipeline.

When a descriptor set is disturbed by binding descriptor sets, the disturbed
set is considered to contain undefined: descriptors bound with the same
pipeline layout as the disturbing descriptor set.

ifdef::implementation-guide[]
.Implementor's Note
****
A consequence of layout compatibility is that when the implementation
compiles a pipeline layout and maps pipeline resources to implementation
resources, the mechanism for set N should: only be a function of sets
[0..N].
****
endif::implementation-guide[]


[NOTE]
.Note
====
Place the least frequently changing descriptor sets near the start of the
pipeline layout, and place the descriptor sets representing the most
frequently changing resources near the end.
When pipelines are switched, only the descriptor set bindings that have been
invalidated will need to be updated and the remainder of the descriptor set
bindings will remain in place.
====

The maximum number of descriptor sets that can: be bound to a pipeline
layout is queried from physical device properties (see
pname:maxBoundDescriptorSets in <<limits, Limits>>).

.API example
[source,c++]
----
const VkDescriptorSetLayout layouts[] = { layout1, layout2 };

const VkPushConstantRange ranges[] =
{
    {
        .stageFlags = VK_SHADER_STAGE_VERTEX_BIT,
        .offset = 0,
        .size = 4
    },
    {
        .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
        .offset = 4,
        .size = 4
    },
};

const VkPipelineLayoutCreateInfo createInfo =
{
    .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
    .pNext = NULL,
    .flags = 0,
    .setLayoutCount = 2,
    .pSetLayouts = layouts,
    .pushConstantRangeCount = 2,
    .pPushConstantRanges = ranges
};

VkPipelineLayout myPipelineLayout;
myResult = vkCreatePipelineLayout(
    myDevice,
    &createInfo,
    NULL,
    &myPipelineLayout);
----


[[descriptorsets-allocation]]
=== Allocation of Descriptor Sets

[open,refpage='VkDescriptorPool',desc='Opaque handle to a descriptor pool object',type='handles']
--
A _descriptor pool_ maintains a pool of descriptors, from which descriptor
sets are allocated.
Descriptor pools are externally synchronized, meaning that the application
must: not allocate and/or free descriptor sets from the same pool in
multiple threads simultaneously.

Descriptor pools are represented by sname:VkDescriptorPool handles:

include::{generated}/api/handles/VkDescriptorPool.adoc[]
--

[open,refpage='vkCreateDescriptorPool',desc='Creates a descriptor pool object',type='protos']
--
:refpage: vkCreateDescriptorPool
:objectnameplural: descriptor pools
:objectnamecamelcase: descriptorPool
:objectcount: 1

To create a descriptor pool object, call:

include::{generated}/api/protos/vkCreateDescriptorPool.adoc[]

  * pname:device is the logical device that creates the descriptor pool.
  * pname:pCreateInfo is a pointer to a slink:VkDescriptorPoolCreateInfo
    structure specifying the state of the descriptor pool object.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.
  * pname:pDescriptorPool is a pointer to a slink:VkDescriptorPool handle in
    which the resulting descriptor pool object is returned.

The created descriptor pool is returned in pname:pDescriptorPool.

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

ifdef::VKSC_VERSION_1_0[]
.Valid Usage
****
include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]
****
endif::VKSC_VERSION_1_0[]

include::{generated}/validity/protos/vkCreateDescriptorPool.adoc[]
--

[open,refpage='VkDescriptorPoolCreateInfo',desc='Structure specifying parameters of a newly created descriptor pool',type='structs']
--
Additional information about the pool is passed in a
sname:VkDescriptorPoolCreateInfo structure:

include::{generated}/api/structs/VkDescriptorPoolCreateInfo.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is a bitmask of elink:VkDescriptorPoolCreateFlagBits
    specifying certain supported operations on the pool.
  * pname:maxSets is the maximum number of descriptor sets that can: be
    allocated from the pool.
  * pname:poolSizeCount is the number of elements in pname:pPoolSizes.
  * pname:pPoolSizes is a pointer to an array of slink:VkDescriptorPoolSize
    structures, each containing a descriptor type and number of descriptors
    of that type to be allocated in the pool.

If multiple sname:VkDescriptorPoolSize structures containing the same
descriptor type appear in the pname:pPoolSizes array then the pool will be
created with enough storage for the total number of descriptors of each
type.

Fragmentation of a descriptor pool is possible and may: lead to descriptor
set allocation failures.
A failure due to fragmentation is defined as failing a descriptor set
allocation despite the sum of all outstanding descriptor set allocations
from the pool plus the requested allocation requiring no more than the total
number of descriptors requested at pool creation.
Implementations provide certain guarantees of when fragmentation must: not
cause allocation failure, as described below.

If a descriptor pool has not had any descriptor sets freed since it was
created or most recently reset then fragmentation must: not cause an
allocation failure (note that this is always the case for a pool created
without the ename:VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT bit
set).
Additionally, if all sets allocated from the pool since it was created or
most recently reset use the same number of descriptors (of each type) and
the requested allocation also uses that same number of descriptors (of each
type), then fragmentation must: not cause an allocation failure.

If an allocation failure occurs due to fragmentation, an application can:
create an additional descriptor pool to perform further descriptor set
allocations.

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
If pname:flags has the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT
bit set, descriptor pool creation may: fail with the error
ename:VK_ERROR_FRAGMENTATION if the total number of descriptors across all
pools (including this one) created with this bit set exceeds
pname:maxUpdateAfterBindDescriptorsInAllPools, or if fragmentation of the
underlying hardware resources occurs.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
If a pname:pPoolSizes[i]::pname:type is
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, a
slink:VkMutableDescriptorTypeCreateInfoEXT struct in the pname:pNext chain
can: be used to specify which mutable descriptor types can: be allocated
from the pool.
If included in the pname:pNext chain,
slink:VkMutableDescriptorTypeCreateInfoEXT::pname:pMutableDescriptorTypeLists[i]
specifies which kind of ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT descriptors
can: be allocated from this pool entry.
If slink:VkMutableDescriptorTypeCreateInfoEXT does not exist in the
pname:pNext chain, or
slink:VkMutableDescriptorTypeCreateInfoEXT::pname:pMutableDescriptorTypeLists[i]
is out of range, the descriptor pool allocates enough memory to be able to
allocate a ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT descriptor with any
supported elink:VkDescriptorType as a mutable descriptor.
A mutable descriptor can: be allocated from a pool entry if the type list in
slink:VkDescriptorSetLayoutCreateInfo is a subset of the type list declared
in the descriptor pool, or if the pool entry is created without a descriptor
type list.
Multiple pname:pPoolSizes entries with ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
can: be declared.
When multiple such pool entries are present in pname:pPoolSizes, they
specify sets of supported descriptor types which either fully overlap,
partially overlap, or are disjoint.
Two sets fully overlap if the sets of supported descriptor types are equal.
If the sets are not disjoint they partially overlap.
A pool entry without a sname:VkMutableDescriptorTypeListEXT assigned to it
is considered to partially overlap any other pool entry which has a
sname:VkMutableDescriptorTypeListEXT assigned to it.
The application must: ensure that partial overlap does not exist in
pname:pPoolSizes.

[NOTE]
.Note
====
The requirement of no partial overlap is intended to resolve ambiguity for
validation as there is no confusion which pname:pPoolSizes entries will be
allocated from.
An implementation is not expected to depend on this requirement.
====
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]

.Valid Usage
****
  * [[VUID-VkDescriptorPoolCreateInfo-descriptorPoolOverallocation-09227]]
ifdef::VK_NV_descriptor_pool_overallocation[]
    If the <<features-descriptorPoolOverallocation,
    pname:descriptorPoolOverallocation>> feature is not enabled, or
    pname:flags does not have
    ename:VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV set,
endif::VK_NV_descriptor_pool_overallocation[]
    pname:maxSets must: be greater than `0`
ifdef::VK_NV_descriptor_pool_overallocation[]
  * [[VUID-VkDescriptorPoolCreateInfo-flags-09228]]
    If pname:flags has the
    ename:VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV or
    ename:VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV bits
    set, then <<features-descriptorPoolOverallocation,
    pname:descriptorPoolOverallocation>> must: be enabled
endif::VK_NV_descriptor_pool_overallocation[]
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorPoolCreateInfo-flags-04607]]
    If pname:flags has the ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT
    bit set, then the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT
    bit must: not be set
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorPoolCreateInfo-mutableDescriptorType-04608]]
    If
    slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT::pname:mutableDescriptorType
    is not enabled, pname:pPoolSizes must: not contain a
    pname:descriptorType of ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
  * [[VUID-VkDescriptorPoolCreateInfo-flags-04609]]
    If pname:flags has the ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT
    bit set,
    slink:VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT::pname:mutableDescriptorType
    must: be enabled
  * [[VUID-VkDescriptorPoolCreateInfo-pPoolSizes-04787]]
    If pname:pPoolSizes contains a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, any other
    ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT element in pname:pPoolSizes must:
    not have sets of supported descriptor types which partially overlap
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorPoolCreateInfo-pPoolSizes-09424]]
    If pname:pPoolSizes contains a pname:descriptorType of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, the pname:pNext chain
    must: include a slink:VkDescriptorPoolInlineUniformBlockCreateInfo
    structure whose pname:maxInlineUniformBlockBindings member is not zero
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
****

include::{generated}/validity/structs/VkDescriptorPoolCreateInfo.adoc[]
--

ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
[open,refpage='VkDescriptorPoolInlineUniformBlockCreateInfo',desc='Structure specifying the maximum number of inline uniform block bindings of a newly created descriptor pool',type='structs',alias='VkDescriptorPoolInlineUniformBlockCreateInfoEXT']
--
In order to be able to allocate descriptor sets having
<<descriptorsets-inlineuniformblock, inline uniform block>> bindings the
descriptor pool must: be created with specifying the inline uniform block
binding capacity of the descriptor pool, in addition to the total inline
uniform data capacity in bytes which is specified through a
slink:VkDescriptorPoolSize structure with a pname:descriptorType value of
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK.
This can: be done by adding a
sname:VkDescriptorPoolInlineUniformBlockCreateInfo structure to the
pname:pNext chain of slink:VkDescriptorPoolCreateInfo.

The sname:VkDescriptorPoolInlineUniformBlockCreateInfo structure is defined
as:

include::{generated}/api/structs/VkDescriptorPoolInlineUniformBlockCreateInfo.adoc[]

ifdef::VK_EXT_inline_uniform_block[]
or the equivalent

include::{generated}/api/structs/VkDescriptorPoolInlineUniformBlockCreateInfoEXT.adoc[]
endif::VK_EXT_inline_uniform_block[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:maxInlineUniformBlockBindings is the number of inline uniform
    block bindings to allocate.

include::{generated}/validity/structs/VkDescriptorPoolInlineUniformBlockCreateInfo.adoc[]
--
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

[open,refpage='VkDescriptorPoolCreateFlagBits',desc='Bitmask specifying certain supported operations on a descriptor pool',type='enums']
--
Bits which can: be set in slink:VkDescriptorPoolCreateInfo::pname:flags,
enabling operations on a descriptor pool, are:

include::{generated}/api/enums/VkDescriptorPoolCreateFlagBits.adoc[]

  * ename:VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT specifies that
    descriptor sets can: return their individual allocations to the pool,
    i.e. all of flink:vkAllocateDescriptorSets, flink:vkFreeDescriptorSets,
    and flink:vkResetDescriptorPool are allowed.
    Otherwise, descriptor sets allocated from the pool must: not be
    individually freed back to the pool, i.e. only
    flink:vkAllocateDescriptorSets and flink:vkResetDescriptorPool are
    allowed.
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT specifies that
    descriptor sets allocated from this pool can: include bindings with the
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT bit set.
    It is valid to allocate descriptor sets that have bindings that do not
    set the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT bit from a
    pool that has ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT set.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT specifies that this
    descriptor pool and the descriptor sets allocated from it reside
    entirely in host memory and cannot be bound.
    Similar to descriptor sets allocated without this flag, applications
    can: copy-from and copy-to descriptors sets allocated from this
    descriptor pool.
    Descriptor sets allocated from this pool are partially exempt from the
    external synchronization requirement in
ifdef::VK_KHR_descriptor_update_template[]
    flink:vkUpdateDescriptorSetWithTemplateKHR and
endif::VK_KHR_descriptor_update_template[]
    flink:vkUpdateDescriptorSets.
    Descriptor sets and their descriptors can be updated concurrently in
    different threads, though the same descriptor must: not be updated
    concurrently by two threads.
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VK_NV_descriptor_pool_overallocation[]
  * ename:VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_SETS_BIT_NV
    specifies that the implementation should allow the application to
    allocate more than slink:VkDescriptorPoolCreateInfo::pname:maxSets
    descriptor set objects from the descriptor pool as available resources
    allow.
    The implementation may: use the pname:maxSets value to allocate the
    initial available sets, but using zero is permitted.
  * ename:VK_DESCRIPTOR_POOL_CREATE_ALLOW_OVERALLOCATION_POOLS_BIT_NV
    specifies that the implementation should allow the application to
    allocate more descriptors from the pool than was specified by the
    slink:VkDescriptorPoolSize::pname:descriptorCount for any descriptor
    type as specified by
    slink:VkDescriptorPoolCreateInfo::pname:poolSizeCount and
    slink:VkDescriptorPoolCreateInfo::pname:pPoolSizes, as available
    resources allow.
    The implementation may: use the pname:descriptorCount for each
    descriptor type to allocate the initial pool, but the application is
    allowed to set the pname:poolSizeCount to zero, or any of the
    pname:descriptorCount values in the pname:pPoolSizes array to zero.
endif::VK_NV_descriptor_pool_overallocation[]
--

[open,refpage='VkDescriptorPoolCreateFlags',desc='Bitmask of VkDescriptorPoolCreateFlagBits',type='flags']
--
include::{generated}/api/flags/VkDescriptorPoolCreateFlags.adoc[]

tname:VkDescriptorPoolCreateFlags is a bitmask type for setting a mask of
zero or more elink:VkDescriptorPoolCreateFlagBits.
--

[open,refpage='VkDescriptorPoolSize',desc='Structure specifying descriptor pool size',type='structs']
--
The sname:VkDescriptorPoolSize structure is defined as:

include::{generated}/api/structs/VkDescriptorPoolSize.adoc[]

  * pname:type is the type of descriptor.
  * pname:descriptorCount is the number of descriptors of that type to
    allocate.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then
    pname:descriptorCount is the number of bytes to allocate for descriptors
    of this type.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

ifdef::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]
[NOTE]
.Note
====
When creating a descriptor pool that will contain descriptors for combined
image samplers of multi-planar formats, an application needs to account for
non-trivial descriptor consumption when choosing the pname:descriptorCount
value, as indicated by
slink:VkSamplerYcbcrConversionImageFormatProperties::pname:combinedImageSamplerDescriptorCount.

ifdef::VK_KHR_maintenance6[]
For simplicity the application can: use the
slink:VkPhysicalDeviceMaintenance6PropertiesKHR::pname:maxCombinedImageSamplerDescriptorCount
property, which is sized to accommodate any and all
<<formats-requiring-sampler-ycbcr-conversion, formats that require a sampler
{YCbCr} conversion>> supported by the implementation.
endif::VK_KHR_maintenance6[]
====
endif::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]

.Valid Usage
****
  * [[VUID-VkDescriptorPoolSize-descriptorCount-00302]]
    pname:descriptorCount must: be greater than `0`
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorPoolSize-type-02218]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then
    pname:descriptorCount must: be a multiple of `4`
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
****

include::{generated}/validity/structs/VkDescriptorPoolSize.adoc[]
--

ifdef::VKSC_VERSION_1_0[]
ifdef::hidden[]
// tag::scremoved[]
  * fname:vkDestroyDescriptorPool <<SCID-4>>
// end::scremoved[]
endif::hidden[]

Descriptor pools cannot: be destroyed <<SCID-4>>.
If
slink:VkPhysicalDeviceVulkanSC10Properties::<<limits-deviceDestroyFreesMemory,pname:deviceDestroyFreesMemory>>
is ename:VK_TRUE, the memory is returned to the system when the device is
destroyed.

endif::VKSC_VERSION_1_0[]
ifndef::VKSC_VERSION_1_0[]

[open,refpage='vkDestroyDescriptorPool',desc='Destroy a descriptor pool object',type='protos']
--
To destroy a descriptor pool, call:

include::{generated}/api/protos/vkDestroyDescriptorPool.adoc[]

  * pname:device is the logical device that destroys the descriptor pool.
  * pname:descriptorPool is the descriptor pool to destroy.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.

When a pool is destroyed, all descriptor sets allocated from the pool are
implicitly freed and become invalid.
Descriptor sets allocated from a given pool do not need to be freed before
destroying that descriptor pool.

.Valid Usage
****
  * [[VUID-vkDestroyDescriptorPool-descriptorPool-00303]]
    All submitted commands that refer to pname:descriptorPool (via any
    allocated descriptor sets) must: have completed execution
  * [[VUID-vkDestroyDescriptorPool-descriptorPool-00304]]
    If sname:VkAllocationCallbacks were provided when pname:descriptorPool
    was created, a compatible set of callbacks must: be provided here
  * [[VUID-vkDestroyDescriptorPool-descriptorPool-00305]]
    If no sname:VkAllocationCallbacks were provided when
    pname:descriptorPool was created, pname:pAllocator must: be `NULL`
****

include::{generated}/validity/protos/vkDestroyDescriptorPool.adoc[]
--

endif::VKSC_VERSION_1_0[]

[open,refpage='VkDescriptorSet',desc='Opaque handle to a descriptor set object',type='handles']
--
Descriptor sets are allocated from descriptor pool objects, and are
represented by sname:VkDescriptorSet handles:

include::{generated}/api/handles/VkDescriptorSet.adoc[]
--

[open,refpage='vkAllocateDescriptorSets',desc='Allocate one or more descriptor sets',type='protos']
--
:refpage: vkAllocateDescriptorSets
:objectnameplural: descriptor sets
:objectnamecamelcase: descriptorSet
:objectcount: slink:VkDescriptorSetAllocateInfo::pname:descriptorSetCount

To allocate descriptor sets from a descriptor pool, call:

include::{generated}/api/protos/vkAllocateDescriptorSets.adoc[]

  * pname:device is the logical device that owns the descriptor pool.
  * pname:pAllocateInfo is a pointer to a slink:VkDescriptorSetAllocateInfo
    structure describing parameters of the allocation.
  * pname:pDescriptorSets is a pointer to an array of slink:VkDescriptorSet
    handles in which the resulting descriptor set objects are returned.

The allocated descriptor sets are returned in pname:pDescriptorSets.

[[descriptor-set-initial-state]]
When a descriptor set is allocated, the initial state is largely
uninitialized and all descriptors are undefined:, with the exception that
samplers with a non-null pname:pImmutableSamplers are initialized on
allocation.
Descriptors also become undefined: if the underlying resource or view object
is destroyed.
Descriptor sets containing undefined: descriptors can: still be bound and
used, subject to the following conditions:

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * For descriptor set bindings created with the
    ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT bit set, all descriptors
    in that binding that are dynamically used must: have been populated
    before the descriptor set is <<descriptorsets-binding,consumed>>.
  * For descriptor set bindings created without the
    ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT bit set, all descriptors
    in that binding that are statically used must: have been populated
    before the descriptor set is <<descriptorsets-binding,consumed>>.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifndef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * Descriptors that are <<shaders-staticuse,statically used>> must: have
    been populated before the descriptor set is
    <<descriptorsets-binding,consumed>>.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * Descriptor bindings with descriptor type of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK can: be undefined: when
    the descriptor set is <<descriptorsets-binding,consumed>>; though values
    in that block will be undefined:.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * Entries that are not used by a pipeline can: have undefined:
    descriptors.

ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
If a call to fname:vkAllocateDescriptorSets would cause the total number of
descriptor sets allocated from the pool to exceed the value of
slink:VkDescriptorPoolCreateInfo::pname:maxSets used to create
pname:pAllocateInfo->descriptorPool, then the allocation may: fail due to
lack of space in the descriptor pool.
Similarly, the allocation may: fail due to lack of space if the call to
fname:vkAllocateDescriptorSets would cause the number of any given
descriptor type to exceed the sum of all the pname:descriptorCount members
of each element of slink:VkDescriptorPoolCreateInfo::pname:pPoolSizes with a
pname:type equal to that type.

ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
Additionally, the allocation may: also fail if a call to
fname:vkAllocateDescriptorSets would cause the total number of inline
uniform block bindings allocated from the pool to exceed the value of
slink:VkDescriptorPoolInlineUniformBlockCreateInfo::pname:maxInlineUniformBlockBindings
used to create the descriptor pool.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

If the allocation fails due to no more space in the descriptor pool, and not
because of system or device memory exhaustion, then
ename:VK_ERROR_OUT_OF_POOL_MEMORY must: be returned.
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]

ifndef::VK_VERSION_1_1,VK_KHR_maintenance2[]
If an allocation fails due to fragmentation, an indeterminate error is
returned with an unspecified error code.
Any returned error other than
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
ename:VK_ERROR_OUT_OF_POOL_MEMORY or
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
ename:VK_ERROR_FRAGMENTED_POOL does not imply its usual meaning:
applications should: assume that the allocation failed due to fragmentation,
and create a new descriptor pool.
endif::VK_VERSION_1_1,VK_KHR_maintenance2[]

ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
fname:vkAllocateDescriptorSets can: be used to create multiple descriptor
sets.
If the creation of any of those descriptor sets fails, then the
implementation must: destroy all successfully created descriptor set objects
from this command, set all entries of the pname:pDescriptorSets array to
dlink:VK_NULL_HANDLE and return the error.
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]

ifndef::VK_VERSION_1_1,VK_KHR_maintenance2[]
[NOTE]
.Note
====
Applications should: check for a negative return value when allocating new
descriptor sets, assume that any error
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
other than ename:VK_ERROR_OUT_OF_POOL_MEMORY
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
effectively means ename:VK_ERROR_FRAGMENTED_POOL, and try to create a new
descriptor pool.
If ename:VK_ERROR_FRAGMENTED_POOL is the actual return value, it adds
certainty to that decision.

The reason for this is that ename:VK_ERROR_FRAGMENTED_POOL was only added in
a later version of the 1.0 specification, and so drivers may: return other
errors if they were written against earlier versions.
To ensure full compatibility with earlier patch versions, these other errors
are allowed.
====
endif::VK_VERSION_1_1,VK_KHR_maintenance2[]

include::{chapters}/commonvalidity/no_dynamic_allocations_common.adoc[]

ifdef::VKSC_VERSION_1_0[]
.Valid Usage
****
include::{chapters}/commonvalidity/memory_reservation_request_count_common.adoc[]
****
endif::VKSC_VERSION_1_0[]

include::{generated}/validity/protos/vkAllocateDescriptorSets.adoc[]
--

[open,refpage='VkDescriptorSetAllocateInfo',desc='Structure specifying the allocation parameters for descriptor sets',type='structs']
--
The sname:VkDescriptorSetAllocateInfo structure is defined as:

include::{generated}/api/structs/VkDescriptorSetAllocateInfo.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:descriptorPool is the pool which the sets will be allocated from.
  * pname:descriptorSetCount determines the number of descriptor sets to be
    allocated from the pool.
  * pname:pSetLayouts is a pointer to an array of descriptor set layouts,
    with each member specifying how the corresponding descriptor set is
    allocated.

.Valid Usage
****
ifndef::VKSC_VERSION_1_0[]
  * [[VUID-VkDescriptorSetAllocateInfo-apiVersion-07895]]
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
    If the apiext:VK_KHR_maintenance1 extension is not enabled and
    slink:VkPhysicalDeviceProperties::pname:apiVersion is less than Vulkan
    1.1,
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
    pname:descriptorSetCount must: not be greater than the number of sets
    that are currently available for allocation in pname:descriptorPool
  * [[VUID-VkDescriptorSetAllocateInfo-apiVersion-07896]]
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
    If the apiext:VK_KHR_maintenance1 extension is not enabled and
    slink:VkPhysicalDeviceProperties::pname:apiVersion is less than Vulkan
    1.1,
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
    pname:descriptorPool must: have enough free descriptor capacity
    remaining to allocate the descriptor sets of the specified layouts
endif::VKSC_VERSION_1_0[]
ifdef::VK_KHR_push_descriptor[]
  * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-00308]]
    Each element of pname:pSetLayouts must: not have been created with
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set
endif::VK_KHR_push_descriptor[]
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-03044]]
    If any element of pname:pSetLayouts was created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT bit
    set, pname:descriptorPool must: have been created with the
    ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set
  * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-09380]]
    If pname:pSetLayouts[i] was created with an element of
    pname:pBindingFlags that includes
    ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, and
    slink:VkDescriptorSetVariableDescriptorCountAllocateInfo is included in
    the pname:pNext chain, and
    sname:VkDescriptorSetVariableDescriptorCountAllocateInfo::pname:descriptorSetCount
    is not zero, then
    slink:VkDescriptorSetVariableDescriptorCountAllocateInfo::pname:pDescriptorCounts[i]
    must: be less than or equal to
    slink:VkDescriptorSetLayoutBinding::pname:descriptorCount for the
    corresponding binding used to create pname:pSetLayouts[i]
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-04610]]
    If any element of pname:pSetLayouts was created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT bit set,
    pname:descriptorPool must: have been created with the
    ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT flag set
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VK_EXT_descriptor_buffer[]
  * [[VUID-VkDescriptorSetAllocateInfo-pSetLayouts-08009]]
    Each element of pname:pSetLayouts must: not have been created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT bit set
endif::VK_EXT_descriptor_buffer[]
****

include::{generated}/validity/structs/VkDescriptorSetAllocateInfo.adoc[]
--

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
[open,refpage='VkDescriptorSetVariableDescriptorCountAllocateInfo',desc='Structure specifying additional allocation parameters for descriptor sets',type='structs',alias='VkDescriptorSetVariableDescriptorCountAllocateInfoEXT']
--
If the pname:pNext chain of a slink:VkDescriptorSetAllocateInfo structure
includes a sname:VkDescriptorSetVariableDescriptorCountAllocateInfo
structure, then that structure includes an array of descriptor counts for
variable-sized descriptor bindings, one for each descriptor set being
allocated.

The sname:VkDescriptorSetVariableDescriptorCountAllocateInfo structure is
defined as:

include::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountAllocateInfo.adoc[]

ifdef::VK_EXT_descriptor_indexing[]
or the equivalent

include::{generated}/api/structs/VkDescriptorSetVariableDescriptorCountAllocateInfoEXT.adoc[]
endif::VK_EXT_descriptor_indexing[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:descriptorSetCount is zero or the number of elements in
    pname:pDescriptorCounts.
  * pname:pDescriptorCounts is a pointer to an array of descriptor counts,
    with each member specifying the number of descriptors in a
    variable-sized descriptor binding in the corresponding descriptor set
    being allocated.

If pname:descriptorSetCount is zero or this structure is not included in the
pname:pNext chain, then the variable lengths are considered to be zero.
Otherwise, pname:pDescriptorCounts[i] is the number of descriptors in the
variable-sized descriptor binding in the corresponding descriptor set
layout.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
If the variable-sized descriptor binding in the corresponding descriptor set
layout has a descriptor type of
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then
pname:pDescriptorCounts[i] specifies the binding's capacity in bytes.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
If slink:VkDescriptorSetAllocateInfo::pname:pSetLayouts[i] does not include
a variable-sized descriptor binding, then pname:pDescriptorCounts[i] is
ignored.

.Valid Usage
****
  * [[VUID-VkDescriptorSetVariableDescriptorCountAllocateInfo-descriptorSetCount-03045]]
    If pname:descriptorSetCount is not zero, pname:descriptorSetCount must:
    equal slink:VkDescriptorSetAllocateInfo::pname:descriptorSetCount
****

include::{generated}/validity/structs/VkDescriptorSetVariableDescriptorCountAllocateInfo.adoc[]
--
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

[open,refpage='vkFreeDescriptorSets',desc='Free one or more descriptor sets',type='protos']
--
To free allocated descriptor sets, call:

include::{generated}/api/protos/vkFreeDescriptorSets.adoc[]

  * pname:device is the logical device that owns the descriptor pool.
  * pname:descriptorPool is the descriptor pool from which the descriptor
    sets were allocated.
  * pname:descriptorSetCount is the number of elements in the
    pname:pDescriptorSets array.
  * pname:pDescriptorSets is a pointer to an array of handles to
    slink:VkDescriptorSet objects.

After calling fname:vkFreeDescriptorSets, all descriptor sets in
pname:pDescriptorSets are invalid.

ifdef::VKSC_VERSION_1_0[]
If <<limits-recycleDescriptorSetMemory,recycleDescriptorSetMemory>> is
ename:VK_FALSE, then freeing a descriptor set does not make the pool memory
it used available to be reallocated until the descriptor pool is reset.
If <<limits-recycleDescriptorSetMemory,recycleDescriptorSetMemory>> is
ename:VK_TRUE, then the memory is available to be reallocated immediately
after freeing the descriptor set.
ifdef::hidden[]
// tag::scdeviation[]
  * If <<limits-recycleDescriptorSetMemory,recycleDescriptorSetMemory>> is
    ename:VK_FALSE, then freeing a descriptor set does not make the pool
    memory it used available to be reallocated until the descriptor pool is
    reset <<SCID-4>>.
// end::scdeviation[]
endif::hidden[]
endif::VKSC_VERSION_1_0[]

.Valid Usage
****
  * [[VUID-vkFreeDescriptorSets-pDescriptorSets-00309]]
    All submitted commands that refer to any element of
    pname:pDescriptorSets must: have completed execution
  * [[VUID-vkFreeDescriptorSets-pDescriptorSets-00310]]
    pname:pDescriptorSets must: be a valid pointer to an array of
    pname:descriptorSetCount sname:VkDescriptorSet handles, each element of
    which must: either be a valid handle or dlink:VK_NULL_HANDLE
  * [[VUID-vkFreeDescriptorSets-descriptorPool-00312]]
    pname:descriptorPool must: have been created with the
    ename:VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT flag
****

include::{generated}/validity/protos/vkFreeDescriptorSets.adoc[]
--

[open,refpage='vkResetDescriptorPool',desc='Resets a descriptor pool object',type='protos']
--
To return all descriptor sets allocated from a given pool to the pool,
rather than freeing individual descriptor sets, call:

include::{generated}/api/protos/vkResetDescriptorPool.adoc[]

  * pname:device is the logical device that owns the descriptor pool.
  * pname:descriptorPool is the descriptor pool to be reset.
  * pname:flags is reserved for future use.

Resetting a descriptor pool recycles all of the resources from all of the
descriptor sets allocated from the descriptor pool back to the descriptor
pool, and the descriptor sets are implicitly freed.

.Valid Usage
****
  * [[VUID-vkResetDescriptorPool-descriptorPool-00313]]
    All uses of pname:descriptorPool (via any allocated descriptor sets)
    must: have completed execution
****

include::{generated}/validity/protos/vkResetDescriptorPool.adoc[]
--

[open,refpage='VkDescriptorPoolResetFlags',desc='Reserved for future use',type='flags']
--
include::{generated}/api/flags/VkDescriptorPoolResetFlags.adoc[]

tname:VkDescriptorPoolResetFlags is a bitmask type for setting a mask, but
is currently reserved for future use.
--


[[descriptorsets-updates]]
=== Descriptor Set Updates

[open,refpage='vkUpdateDescriptorSets',desc='Update the contents of a descriptor set object',type='protos']
--
Once allocated, descriptor sets can: be updated with a combination of write
and copy operations.
To update descriptor sets, call:

include::{generated}/api/protos/vkUpdateDescriptorSets.adoc[]

  * pname:device is the logical device that updates the descriptor sets.
  * pname:descriptorWriteCount is the number of elements in the
    pname:pDescriptorWrites array.
  * pname:pDescriptorWrites is a pointer to an array of
    slink:VkWriteDescriptorSet structures describing the descriptor sets to
    write to.
  * pname:descriptorCopyCount is the number of elements in the
    pname:pDescriptorCopies array.
  * pname:pDescriptorCopies is a pointer to an array of
    slink:VkCopyDescriptorSet structures describing the descriptor sets to
    copy between.

The operations described by pname:pDescriptorWrites are performed first,
followed by the operations described by pname:pDescriptorCopies.
Within each array, the operations are performed in the order they appear in
the array.

Each element in the pname:pDescriptorWrites array describes an operation
updating the descriptor set using descriptors for resources specified in the
structure.

Each element in the pname:pDescriptorCopies array is a
slink:VkCopyDescriptorSet structure describing an operation copying
descriptors between sets.

If the pname:dstSet member of any element of pname:pDescriptorWrites or
pname:pDescriptorCopies is bound, accessed, or modified by any command that
was recorded to a command buffer which is currently in the
<<commandbuffers-lifecycle, recording or executable state>>,
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
and any of the descriptor bindings that are updated were not created with
the ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT or
ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT bits set,
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
that command buffer becomes <<commandbuffers-lifecycle, invalid>>.

.Valid Usage
****
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06236]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, elements of the
    pname:pTexelBufferView member of pname:pDescriptorWrites[i] must: have
    been created on pname:device
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06237]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:buffer member
    of any element of the pname:pBufferInfo member of
    pname:pDescriptorWrites[i] must: have been created on pname:device
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06238]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_SAMPLER or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:dstSet was
    not allocated with a layout that included immutable samplers for
    pname:dstBinding with pname:descriptorType, the pname:sampler member of
    any element of the pname:pImageInfo member of pname:pDescriptorWrites[i]
    must: have been created on pname:device
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06239]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER the pname:imageView
    member of any element of pname:pDescriptorWrites[i] must: have been
    created on pname:device
ifdef::VK_KHR_acceleration_structure[]
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06240]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, elements of the
    pname:pAccelerationStructures member of a
    slink:VkWriteDescriptorSetAccelerationStructureKHR structure in the
    pname:pNext chain of pname:pDescriptorWrites[i] must: have been created
    on pname:device
endif::VK_KHR_acceleration_structure[]
ifdef::VK_NV_ray_tracing[]
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06241]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, elements of the
    pname:pAccelerationStructures member of a
    slink:VkWriteDescriptorSetAccelerationStructureNV structure in the
    pname:pNext chain of pname:pDescriptorWrites[i] must: have been created
    on pname:device
endif::VK_NV_ray_tracing[]
ifdef::VK_QCOM_image_processing[]
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06940]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM or
    ename:VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, the pname:imageView
    member of any element of pname:pDescriptorWrites[i] must: have been
    created on pname:device
endif::VK_QCOM_image_processing[]
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06493]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
    pname:pDescriptorWrites[i].pname:pImageInfo must: be a valid pointer to
    an array of pname:pDescriptorWrites[i].pname:descriptorCount valid
    sname:VkDescriptorImageInfo structures
ifdef::VK_QCOM_image_processing[]
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06941]]
    For each element [eq]#i# where
    pname:pDescriptorWrites[i].pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM or
    ename:VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM,
    pname:pDescriptorWrites[i].pname:pImageInfo must: be a valid pointer to
    an array of pname:pDescriptorWrites[i].pname:descriptorCount valid
    sname:VkDescriptorImageInfo structures
endif::VK_QCOM_image_processing[]
  * [[VUID-vkUpdateDescriptorSets-None-03047]]
    The pname:dstSet member of each element of pname:pDescriptorWrites or
    pname:pDescriptorCopies
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    for bindings which were created without the
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT or
    ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT bits set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    must: not be used by any command that was recorded to a command buffer
    which is in the <<commandbuffers-lifecycle,pending state>>
  * [[VUID-vkUpdateDescriptorSets-pDescriptorWrites-06993]]
    Host access to pname:pDescriptorWrites[i].pname:dstSet and
    pname:pDescriptorCopies[i].pname:dstSet must: be
    <<fundamentals-threadingbehavior,externally synchronized>>
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    unless explicitly denoted otherwise for specific flags
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
****

include::{generated}/validity/protos/vkUpdateDescriptorSets.adoc[]
--

[open,refpage='VkWriteDescriptorSet',desc='Structure specifying the parameters of a descriptor set write operation',type='structs']
--
The sname:VkWriteDescriptorSet structure is defined as:

include::{generated}/api/structs/VkWriteDescriptorSet.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:dstSet is the destination descriptor set to update.
  * pname:dstBinding is the descriptor binding within that set.
  * pname:dstArrayElement is the starting element in that array.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the descriptor binding identified by pname:dstSet and
    pname:dstBinding has a descriptor type of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then pname:dstArrayElement
    specifies the starting byte offset within the binding.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * pname:descriptorCount is the number of descriptors to update.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the descriptor binding identified by pname:dstSet and
    pname:dstBinding has a descriptor type of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, then
    pname:descriptorCount specifies the number of bytes to update.
    Otherwise,
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    pname:descriptorCount is one of
  ** the number of elements in pname:pImageInfo
  ** the number of elements in pname:pBufferInfo
  ** the number of elements in pname:pTexelBufferView
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  ** a value matching the pname:dataSize member of a
     slink:VkWriteDescriptorSetInlineUniformBlock structure in the
     pname:pNext chain
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
  ** a value matching the pname:accelerationStructureCount of a
     slink:VkWriteDescriptorSetAccelerationStructureKHR structure in the
     pname:pNext chain
endif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
  * pname:descriptorType is a elink:VkDescriptorType specifying the type of
    each descriptor in pname:pImageInfo, pname:pBufferInfo, or
    pname:pTexelBufferView, as described below.
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
    If sname:VkDescriptorSetLayoutBinding for pname:dstSet at
    pname:dstBinding is not equal to ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT,
    pname:descriptorType must:
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifndef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
    It must:
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
    be the same type as the pname:descriptorType specified in
    sname:VkDescriptorSetLayoutBinding for pname:dstSet at pname:dstBinding.
    The type of the descriptor also controls which array the descriptors are
    taken from.
  * pname:pImageInfo is a pointer to an array of slink:VkDescriptorImageInfo
    structures or is ignored, as described below.
  * pname:pBufferInfo is a pointer to an array of
    slink:VkDescriptorBufferInfo structures or is ignored, as described
    below.
  * pname:pTexelBufferView is a pointer to an array of slink:VkBufferView
    handles as described in the <<resources-buffer-views,Buffer Views>>
    section or is ignored, as described below.

Only one of pname:pImageInfo, pname:pBufferInfo, or pname:pTexelBufferView
members is used according to the descriptor type specified in the
pname:descriptorType member of the containing sname:VkWriteDescriptorSet
structure,
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
or none of them in case pname:descriptorType is
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, in which case the source data
for the descriptor writes is taken from the
slink:VkWriteDescriptorSetInlineUniformBlock structure included in the
pname:pNext chain of sname:VkWriteDescriptorSet,
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_KHR_acceleration_structure[]
or if pname:descriptorType is
ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, in which case the
source data for the descriptor writes is taken from the
slink:VkWriteDescriptorSetAccelerationStructureKHR structure in the
pname:pNext chain of sname:VkWriteDescriptorSet,
endif::VK_KHR_acceleration_structure[]
ifdef::VK_NV_ray_tracing[]
or if pname:descriptorType is
ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, in which case the source
data for the descriptor writes is taken from the
slink:VkWriteDescriptorSetAccelerationStructureNV structure in the
pname:pNext chain of sname:VkWriteDescriptorSet,
endif::VK_NV_ray_tracing[]
as specified below.

ifdef::VK_EXT_robustness2[]
If the <<features-nullDescriptor, pname:nullDescriptor>> feature is enabled,
the buffer,
ifdef::VK_KHR_acceleration_structure[]
acceleration structure,
endif::VK_KHR_acceleration_structure[]
imageView, or bufferView can: be dlink:VK_NULL_HANDLE.
Loads from a null descriptor return zero values and stores and atomics to a
null descriptor are discarded.
ifdef::VK_KHR_acceleration_structure[]
A null acceleration structure descriptor results in the miss shader being
invoked.
endif::VK_KHR_acceleration_structure[]
endif::VK_EXT_robustness2[]

ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
If the destination descriptor is a mutable descriptor, the active descriptor
type for the destination descriptor becomes pname:descriptorType.
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]

[[descriptorsets-updates-consecutive, consecutive binding updates]]
If the pname:dstBinding has fewer than pname:descriptorCount array elements
remaining starting from pname:dstArrayElement, then the remainder will be
used to update the subsequent binding - [eq]#pname:dstBinding+1# starting at
array element zero.
If a binding has a pname:descriptorCount of zero, it is skipped.
This behavior applies recursively, with the update affecting consecutive
bindings as needed to update all pname:descriptorCount descriptors.
Consecutive bindings must: have identical elink:VkDescriptorType,
tlink:VkShaderStageFlags,
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
elink:VkDescriptorBindingFlagBits,
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
and immutable samplers references.
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
In addition, if the elink:VkDescriptorType is
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the supported descriptor types in
slink:VkMutableDescriptorTypeCreateInfoEXT must: be equally defined.
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]

ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
[NOTE]
.Note
====
The same behavior applies to bindings with a descriptor type of
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK where pname:descriptorCount
specifies the number of bytes to update while pname:dstArrayElement
specifies the starting byte offset, thus in this case if the
pname:dstBinding has a smaller byte size than the sum of
pname:dstArrayElement and pname:descriptorCount, then the remainder will be
used to update the subsequent binding - [eq]#pname:dstBinding+1# starting at
offset zero.
This falls out as a special case of the above rule.
====
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

.Valid Usage
****
  * [[VUID-VkWriteDescriptorSet-dstBinding-00315]]
    pname:dstBinding must: be less than or equal to the maximum value of
    pname:binding of all slink:VkDescriptorSetLayoutBinding structures
    specified when pname:dstSet's descriptor set layout was created
  * [[VUID-VkWriteDescriptorSet-dstBinding-00316]]
    pname:dstBinding must: be a binding with a non-zero
    pname:descriptorCount
  * [[VUID-VkWriteDescriptorSet-descriptorCount-00317]]
    All consecutive bindings updated via a single sname:VkWriteDescriptorSet
    structure, except those with a pname:descriptorCount of zero, must: have
    identical pname:descriptorType and pname:stageFlags
  * [[VUID-VkWriteDescriptorSet-descriptorCount-00318]]
    All consecutive bindings updated via a single sname:VkWriteDescriptorSet
    structure, except those with a pname:descriptorCount of zero, must: all
    either use immutable samplers or must: all not use immutable samplers
  * [[VUID-VkWriteDescriptorSet-descriptorType-00319]]
    pname:descriptorType must: match the type of pname:dstBinding within
    pname:dstSet
  * [[VUID-VkWriteDescriptorSet-dstSet-00320]]
    pname:dstSet must: be a valid slink:VkDescriptorSet handle
  * [[VUID-VkWriteDescriptorSet-dstArrayElement-00321]]
    The sum of pname:dstArrayElement and pname:descriptorCount must: be less
    than or equal to the number of array elements in the descriptor set
    binding specified by pname:dstBinding, and all applicable consecutive
    bindings, as described by <<descriptorsets-updates-consecutive>>
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-02219]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, pname:dstArrayElement
    must: be an integer multiple of `4`
  * [[VUID-VkWriteDescriptorSet-descriptorType-02220]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, pname:descriptorCount
    must: be an integer multiple of `4`
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-02994]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
    or ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, each element of
    pname:pTexelBufferView must: be either a valid sname:VkBufferView handle
    or dlink:VK_NULL_HANDLE
  * [[VUID-VkWriteDescriptorSet-descriptorType-02995]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
    or ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, each element of pname:pTexelBufferView must: not be
    dlink:VK_NULL_HANDLE
  * [[VUID-VkWriteDescriptorSet-descriptorType-00324]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, pname:pBufferInfo must:
    be a valid pointer to an array of pname:descriptorCount valid
    sname:VkDescriptorBufferInfo structures
  * [[VUID-VkWriteDescriptorSet-descriptorType-00325]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:dstSet was
    not allocated with a layout that included immutable samplers for
    pname:dstBinding with pname:descriptorType, the pname:sampler member of
    each element of pname:pImageInfo must: be a valid sname:VkSampler object
  * [[VUID-VkWriteDescriptorSet-descriptorType-02996]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, the pname:imageView member of
    each element of pname:pImageInfo must: be either a valid
    sname:VkImageView handle or dlink:VK_NULL_HANDLE
  * [[VUID-VkWriteDescriptorSet-descriptorType-02997]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, the pname:imageView member of each element of pname:pImageInfo
    must: not be dlink:VK_NULL_HANDLE
  * [[VUID-VkWriteDescriptorSet-descriptorType-07683]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
    the pname:imageView member of each element of pname:pImageInfo must: not
    be dlink:VK_NULL_HANDLE
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-02221]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, the pname:pNext chain
    must: include a slink:VkWriteDescriptorSetInlineUniformBlock structure
    whose pname:dataSize member equals pname:descriptorCount
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_KHR_acceleration_structure[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-02382]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, the pname:pNext
    chain must: include a slink:VkWriteDescriptorSetAccelerationStructureKHR
    structure whose pname:accelerationStructureCount member equals
    pname:descriptorCount
endif::VK_KHR_acceleration_structure[]
ifdef::VK_NV_ray_tracing[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-03817]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, the pname:pNext
    chain must: include a slink:VkWriteDescriptorSetAccelerationStructureNV
    structure whose pname:accelerationStructureCount member equals
    pname:descriptorCount
endif::VK_NV_ray_tracing[]
ifdef::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-01946]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, then
    the pname:imageView member of each pname:pImageInfo element must: have
    been created without a sname:VkSamplerYcbcrConversionInfo structure in
    its pname:pNext chain
  * [[VUID-VkWriteDescriptorSet-descriptorType-02738]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and if any element of
    pname:pImageInfo has an pname:imageView member that was created with a
    sname:VkSamplerYcbcrConversionInfo structure in its pname:pNext chain,
    then pname:dstSet must: have been allocated with a layout that included
    immutable samplers for pname:dstBinding, and the corresponding immutable
    sampler must: have been created with an _identically defined_
    sname:VkSamplerYcbcrConversionInfo object
  * [[VUID-VkWriteDescriptorSet-descriptorType-01948]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and pname:dstSet was
    allocated with a layout that included immutable samplers for
    pname:dstBinding, then the pname:imageView member of each element of
    pname:pImageInfo which corresponds to an immutable sampler that enables
    <<samplers-YCbCr-conversion,sampler {YCbCr} conversion>> must: have been
    created with a sname:VkSamplerYcbcrConversionInfo structure in its
    pname:pNext chain with an _identically defined_
    sname:VkSamplerYcbcrConversionInfo to the corresponding immutable
    sampler
  * [[VUID-VkWriteDescriptorSet-descriptorType-09506]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, pname:dstSet was
    allocated with a layout that included immutable samplers for
    pname:dstBinding, and those samplers enable
    <<samplers-YCbCr-conversion,sampler {YCbCr} conversion>>, then
    pname:imageView must: not be dlink:VK_NULL_HANDLE
endif::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-00327]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:offset member
    of each element of pname:pBufferInfo must: be a multiple of
    sname:VkPhysicalDeviceLimits::pname:minUniformBufferOffsetAlignment
  * [[VUID-VkWriteDescriptorSet-descriptorType-00328]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:offset member
    of each element of pname:pBufferInfo must: be a multiple of
    sname:VkPhysicalDeviceLimits::pname:minStorageBufferOffsetAlignment
  * [[VUID-VkWriteDescriptorSet-descriptorType-00329]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, and the pname:buffer
    member of any element of pname:pBufferInfo is the handle of a non-sparse
    buffer, then that buffer must: be bound completely and contiguously to a
    single sname:VkDeviceMemory object
  * [[VUID-VkWriteDescriptorSet-descriptorType-00330]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:buffer member
    of each element of pname:pBufferInfo must: have been created with
    ename:VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT set
  * [[VUID-VkWriteDescriptorSet-descriptorType-00331]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:buffer member
    of each element of pname:pBufferInfo must: have been created with
    ename:VK_BUFFER_USAGE_STORAGE_BUFFER_BIT set
  * [[VUID-VkWriteDescriptorSet-descriptorType-00332]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, the pname:range member
    of each element of pname:pBufferInfo, or the
    <<buffer-info-effective-range,effective range>> if pname:range is
    ename:VK_WHOLE_SIZE, must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxUniformBufferRange
  * [[VUID-VkWriteDescriptorSet-descriptorType-00333]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, the pname:range member
    of each element of pname:pBufferInfo, or the
    <<buffer-info-effective-range,effective range>> if pname:range is
    ename:VK_WHOLE_SIZE, must: be less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxStorageBufferRange
  * [[VUID-VkWriteDescriptorSet-descriptorType-08765]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, the
    pname:pTexelBufferView <<resources-buffer-views-usage, buffer view
    usage>> must: include ename:VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
  * [[VUID-VkWriteDescriptorSet-descriptorType-08766]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, the
    pname:pTexelBufferView <<resources-buffer-views-usage, buffer view
    usage>> must: include ename:VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT
  * [[VUID-VkWriteDescriptorSet-descriptorType-00336]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE or
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the pname:imageView member of
    each element of pname:pImageInfo must: have been created with the
    <<resources-image-views-identity-mappings,identity swizzle>>
  * [[VUID-VkWriteDescriptorSet-descriptorType-00337]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the pname:imageView
    member of each element of pname:pImageInfo must: have been created with
    ename:VK_IMAGE_USAGE_SAMPLED_BIT set
  * [[VUID-VkWriteDescriptorSet-descriptorType-04149]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE the
    pname:imageLayout member of each element of pname:pImageInfo must: be a
    member of the list given in <<descriptorsets-sampledimage, Sampled
    Image>>
  * [[VUID-VkWriteDescriptorSet-descriptorType-04150]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER the pname:imageLayout
    member of each element of pname:pImageInfo must: be a member of the list
    given in <<descriptorsets-combinedimagesampler, Combined Image Sampler>>
  * [[VUID-VkWriteDescriptorSet-descriptorType-04151]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT the
    pname:imageLayout member of each element of pname:pImageInfo must: be a
    member of the list given in <<descriptorsets-inputattachment, Input
    Attachment>>
  * [[VUID-VkWriteDescriptorSet-descriptorType-04152]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE the
    pname:imageLayout member of each element of pname:pImageInfo must: be a
    member of the list given in <<descriptorsets-storageimage, Storage
    Image>>
  * [[VUID-VkWriteDescriptorSet-descriptorType-00338]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
    the pname:imageView member of each element of pname:pImageInfo must:
    have been created with ename:VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set
  * [[VUID-VkWriteDescriptorSet-descriptorType-00339]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, the
    pname:imageView member of each element of pname:pImageInfo must: have
    been created with ename:VK_IMAGE_USAGE_STORAGE_BIT set
  * [[VUID-VkWriteDescriptorSet-descriptorType-02752]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_SAMPLER, then
    pname:dstSet must: not have been allocated with a layout that included
    immutable samplers for pname:dstBinding
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkWriteDescriptorSet-dstSet-04611]]
    If the sname:VkDescriptorSetLayoutBinding for pname:dstSet at
    pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the new active
    descriptor type pname:descriptorType must: exist in the corresponding
    pname:pMutableDescriptorTypeLists list for pname:dstBinding
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VK_EXT_image_view_min_lod[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-06450]]
    If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
    the pname:imageView member of each element of pname:pImageInfo must:
    have either been created without a slink:VkImageViewMinLodCreateInfoEXT
    included in the pname:pNext chain or with a
    slink:VkImageViewMinLodCreateInfoEXT::pname:minLod of `0.0`
endif::VK_EXT_image_view_min_lod[]
ifdef::VK_QCOM_image_processing[]
  * [[VUID-VkWriteDescriptorSet-descriptorType-06942]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM, the pname:imageView
    member of each element of pname:pImageInfo must: have been created with
    a view created with an pname:image created with
    ename:VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM
  * [[VUID-VkWriteDescriptorSet-descriptorType-06943]]
    If pname:descriptorType is
    ename:VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM, the pname:imageView
    member of each element of pname:pImageInfo must: have been created with
    a view created with an pname:image created with
    ename:VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM
endif::VK_QCOM_image_processing[]


****

include::{generated}/validity/structs/VkWriteDescriptorSet.adoc[]
--

[open,refpage='VkDescriptorType',desc='Specifies the type of a descriptor in a descriptor set',type='enums']
--
The type of descriptors in a descriptor set is specified by
slink:VkWriteDescriptorSet::pname:descriptorType, which must: be one of the
values:

include::{generated}/api/enums/VkDescriptorType.adoc[]

  * ename:VK_DESCRIPTOR_TYPE_SAMPLER specifies a <<descriptorsets-sampler,
    sampler descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER specifies a
    <<descriptorsets-combinedimagesampler, combined image sampler
    descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE specifies a
    <<descriptorsets-sampledimage, sampled image descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE specifies a
    <<descriptorsets-storageimage, storage image descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER specifies a
    <<descriptorsets-uniformtexelbuffer, uniform texel buffer descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER specifies a
    <<descriptorsets-storagetexelbuffer, storage texel buffer descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER specifies a
    <<descriptorsets-uniformbuffer, uniform buffer descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER specifies a
    <<descriptorsets-storagebuffer, storage buffer descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC specifies a
    <<descriptorsets-uniformbufferdynamic, dynamic uniform buffer
    descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC specifies a
    <<descriptorsets-storagebufferdynamic, dynamic storage buffer
    descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT specifies an
    <<descriptorsets-inputattachment, input attachment descriptor>>.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK specifies an
    <<descriptorsets-inlineuniformblock, inline uniform block>>.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT specifies a
    <<descriptorsets-mutable, descriptor of mutable type>>.
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
ifdef::VK_QCOM_image_processing[]
  * ename:VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM specifies a
    <<descriptorsets-weightimage, sampled weight image descriptor>>.
  * ename:VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM specifies a
    <<descriptorsets-blockmatch, block matching image descriptor>>.

endif::VK_QCOM_image_processing[]

When a descriptor set is updated via elements of slink:VkWriteDescriptorSet,
members of pname:pImageInfo, pname:pBufferInfo and pname:pTexelBufferView
are only accessed by the implementation when they correspond to descriptor
type being defined - otherwise they are ignored.
The members accessed are as follows for each descriptor type:

  * For ename:VK_DESCRIPTOR_TYPE_SAMPLER, only the pname:sampler member of
    each element of slink:VkWriteDescriptorSet::pname:pImageInfo is
    accessed.
  * For ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, or
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, only the pname:imageView and
    pname:imageLayout members of each element of
    slink:VkWriteDescriptorSet::pname:pImageInfo are accessed.
  * For ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, all members of each
    element of slink:VkWriteDescriptorSet::pname:pImageInfo are accessed.
  * For ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, all members of each
    element of slink:VkWriteDescriptorSet::pname:pBufferInfo are accessed.
  * For ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER or
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, each element of
    slink:VkWriteDescriptorSet::pname:pTexelBufferView is accessed.

ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
When updating descriptors with a pname:descriptorType of
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, none of the pname:pImageInfo,
pname:pBufferInfo, or pname:pTexelBufferView members are accessed, instead
the source data of the descriptor update operation is taken from the
slink:VkWriteDescriptorSetInlineUniformBlock structure in the pname:pNext
chain of sname:VkWriteDescriptorSet.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_KHR_acceleration_structure[]
When updating descriptors with a pname:descriptorType of
ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, none of the
pname:pImageInfo, pname:pBufferInfo, or pname:pTexelBufferView members are
accessed, instead the source data of the descriptor update operation is
taken from the slink:VkWriteDescriptorSetAccelerationStructureKHR structure
in the pname:pNext chain of sname:VkWriteDescriptorSet.
endif::VK_KHR_acceleration_structure[]
ifdef::VK_NV_ray_tracing[]
When updating descriptors with a pname:descriptorType of
ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, none of the
pname:pImageInfo, pname:pBufferInfo, or pname:pTexelBufferView members are
accessed, instead the source data of the descriptor update operation is
taken from the slink:VkWriteDescriptorSetAccelerationStructureNV structure
in the pname:pNext chain of sname:VkWriteDescriptorSet.
endif::VK_NV_ray_tracing[]
--

[open,refpage='VkDescriptorBufferInfo',desc='Structure specifying descriptor buffer information',type='structs']
--
The sname:VkDescriptorBufferInfo structure is defined as:

include::{generated}/api/structs/VkDescriptorBufferInfo.adoc[]

  * pname:buffer is
ifdef::VK_EXT_robustness2[]
dlink:VK_NULL_HANDLE or
endif::VK_EXT_robustness2[]
the buffer resource.
  * pname:offset is the offset in bytes from the start of pname:buffer.
    Access to buffer memory via this descriptor uses addressing that is
    relative to this starting offset.
  * pname:range is the size in bytes that is used for this descriptor
    update, or ename:VK_WHOLE_SIZE to use the range from pname:offset to the
    end of the buffer.
+
[NOTE]
.Note
====
When setting pname:range to ename:VK_WHOLE_SIZE, the
<<buffer-info-effective-range, effective range>> must: not be larger than
the maximum range for the descriptor type (<<limits-maxUniformBufferRange,
pname:maxUniformBufferRange>> or <<limits-maxStorageBufferRange,
pname:maxStorageBufferRange>>).
This means that ename:VK_WHOLE_SIZE is not typically useful in the common
case where uniform buffer descriptors are suballocated from a buffer that is
much larger than pname:maxUniformBufferRange.
====

For ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC and
ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC descriptor types,
pname:offset is the base offset from which the dynamic offset is applied and
pname:range is the static size used for all dynamic offsets.

[[buffer-info-effective-range]]
When pname:range is ename:VK_WHOLE_SIZE the effective range is calculated at
flink:vkUpdateDescriptorSets is by taking the size of pname:buffer minus the
pname:offset.

.Valid Usage
****
  * [[VUID-VkDescriptorBufferInfo-offset-00340]]
    pname:offset must: be less than the size of pname:buffer
  * [[VUID-VkDescriptorBufferInfo-range-00341]]
    If pname:range is not equal to ename:VK_WHOLE_SIZE, pname:range must: be
    greater than `0`
  * [[VUID-VkDescriptorBufferInfo-range-00342]]
    If pname:range is not equal to ename:VK_WHOLE_SIZE, pname:range must: be
    less than or equal to the size of pname:buffer minus pname:offset
  * [[VUID-VkDescriptorBufferInfo-buffer-02998]]
    If the <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:buffer must: not be dlink:VK_NULL_HANDLE
ifdef::VK_EXT_robustness2[]
  * [[VUID-VkDescriptorBufferInfo-buffer-02999]]
    If pname:buffer is dlink:VK_NULL_HANDLE, pname:offset must: be zero and
    pname:range must: be ename:VK_WHOLE_SIZE
endif::VK_EXT_robustness2[]
****

include::{generated}/validity/structs/VkDescriptorBufferInfo.adoc[]
--

[open,refpage='VkDescriptorImageInfo',desc='Structure specifying descriptor image information',type='structs']
--
The sname:VkDescriptorImageInfo structure is defined as:

include::{generated}/api/structs/VkDescriptorImageInfo.adoc[]

  * pname:sampler is a sampler handle, and is used in descriptor updates for
    types ename:VK_DESCRIPTOR_TYPE_SAMPLER and
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER if the binding being
    updated does not use immutable samplers.
  * pname:imageView is
ifdef::VK_EXT_robustness2[]
    dlink:VK_NULL_HANDLE or
endif::VK_EXT_robustness2[]
    an image view handle, and is used in descriptor updates for types
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT.
  * pname:imageLayout is the layout that the image subresources accessible
    from pname:imageView will be in at the time this descriptor is accessed.
    pname:imageLayout is used in descriptor updates for types
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT.

Members of sname:VkDescriptorImageInfo that are not used in an update (as
described above) are ignored.

.Valid Usage
****
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
  * [[VUID-VkDescriptorImageInfo-imageView-06712]]
    pname:imageView must: not be a 2D array image view created from a 3D
    image
ifdef::VK_EXT_image_2d_view_of_3d[]
  * [[VUID-VkDescriptorImageInfo-imageView-07795]]
    If pname:imageView is a 2D view created from a 3D image, then
    pname:descriptorType must: be ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
  * [[VUID-VkDescriptorImageInfo-imageView-07796]]
    If pname:imageView is a 2D view created from a 3D image, then the image
    must: have been created with
    ename:VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT set
endif::VK_EXT_image_2d_view_of_3d[]
  * [[VUID-VkDescriptorImageInfo-descriptorType-06713]]
ifdef::VK_EXT_image_2d_view_of_3d[]
    If the <<features-image2DViewOf3D, pname:image2DViewOf3D>> feature is
    not enabled or pname:descriptorType is not
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE then
endif::VK_EXT_image_2d_view_of_3d[]
    pname:imageView must: not be a 2D view created from a 3D image
  * [[VUID-VkDescriptorImageInfo-descriptorType-06714]]
ifdef::VK_EXT_image_2d_view_of_3d[]
    If the <<features-sampler2DViewOf3D, pname:sampler2DViewOf3D>> feature
    is not enabled or pname:descriptorType is not
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE or
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER then
endif::VK_EXT_image_2d_view_of_3d[]
    pname:imageView must: not be a 2D view created from a 3D image
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
  * [[VUID-VkDescriptorImageInfo-imageView-01976]]
    If pname:imageView is created from a depth/stencil image, the
    pname:aspectMask used to create the pname:imageView must: include either
    ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT but
    not both
  * [[VUID-VkDescriptorImageInfo-imageLayout-09425]]
    If pname:imageLayout is ename:VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
    then the pname:aspectMask used to create pname:imageView must: not
    include either ename:VK_IMAGE_ASPECT_DEPTH_BIT or
    ename:VK_IMAGE_ASPECT_STENCIL_BIT
  * [[VUID-VkDescriptorImageInfo-imageLayout-09426]]
    If pname:imageLayout is
ifdef::VK_VERSION_1_1,VK_KHR_maintenance2[]
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL,
endif::VK_VERSION_1_1,VK_KHR_maintenance2[]
ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
    ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL,
endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[]
    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, then the
    pname:aspectMask used to create pname:imageView must: not include
    ename:VK_IMAGE_ASPECT_COLOR_BIT
  * [[VUID-VkDescriptorImageInfo-imageLayout-00344]]
    pname:imageLayout must: match the actual elink:VkImageLayout of each
    subresource accessible from pname:imageView at the time this descriptor
    is accessed as defined by the <<resources-image-layouts-matching-rule,
    image layout matching rules>>
ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
  * [[VUID-VkDescriptorImageInfo-sampler-01564]]
    If pname:sampler is used and the elink:VkFormat of the image is a
    <<formats-requiring-sampler-ycbcr-conversion,multi-planar format>>, the
    image must: have been created with
    ename:VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, and the pname:aspectMask of
    the pname:imageView must: be a valid
    <<formats-planes-image-aspect,multi-planar aspect mask>> bit
endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[]
ifdef::VK_KHR_portability_subset[]
  * [[VUID-VkDescriptorImageInfo-mutableComparisonSamplers-04450]]
    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:mutableComparisonSamplers
    is ename:VK_FALSE, then pname:sampler must: have been created with
    slink:VkSamplerCreateInfo::pname:compareEnable set to ename:VK_FALSE
endif::VK_KHR_portability_subset[]
****


include::{generated}/validity/structs/VkDescriptorImageInfo.adoc[]
--

ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
[open,refpage='VkWriteDescriptorSetInlineUniformBlock',desc='Structure specifying inline uniform block data',type='structs',alias='VkWriteDescriptorSetInlineUniformBlockEXT']
--
If the pname:descriptorType member of slink:VkWriteDescriptorSet is
ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then the data to write to the
descriptor set is specified through a
sname:VkWriteDescriptorSetInlineUniformBlock structure included in the
pname:pNext chain of sname:VkWriteDescriptorSet.

The sname:VkWriteDescriptorSetInlineUniformBlock structure is defined as:

include::{generated}/api/structs/VkWriteDescriptorSetInlineUniformBlock.adoc[]

ifdef::VK_EXT_inline_uniform_block[]
or the equivalent

include::{generated}/api/structs/VkWriteDescriptorSetInlineUniformBlockEXT.adoc[]
endif::VK_EXT_inline_uniform_block[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:dataSize is the number of bytes of inline uniform block data
    pointed to by pname:pData.
  * pname:pData is a pointer to pname:dataSize number of bytes of data to
    write to the inline uniform block.

.Valid Usage
****
  * [[VUID-VkWriteDescriptorSetInlineUniformBlock-dataSize-02222]]
    pname:dataSize must: be an integer multiple of `4`
****

include::{generated}/validity/structs/VkWriteDescriptorSetInlineUniformBlock.adoc[]
--
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

ifdef::VK_KHR_acceleration_structure[]
[open,refpage='VkWriteDescriptorSetAccelerationStructureKHR',desc='Structure specifying acceleration structure descriptor information',type='structs']
--
:refpage: VkWriteDescriptorSetAccelerationStructureKHR

The sname:VkWriteDescriptorSetAccelerationStructureKHR structure is defined
as:

include::{generated}/api/structs/VkWriteDescriptorSetAccelerationStructureKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:accelerationStructureCount is the number of elements in
    pname:pAccelerationStructures.
  * pname:pAccelerationStructures is a pointer to an array of
    slink:VkAccelerationStructureKHR structures specifying the acceleration
    structures to update.

.Valid Usage
****
  * [[VUID-VkWriteDescriptorSetAccelerationStructureKHR-accelerationStructureCount-02236]]
    pname:accelerationStructureCount must: be equal to pname:descriptorCount
    in the extended structure
  * [[VUID-VkWriteDescriptorSetAccelerationStructureKHR-pAccelerationStructures-03579]]
    Each acceleration structure in pname:pAccelerationStructures must: have
    been created with a pname:type of
    ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR or
    ename:VK_ACCELERATION_STRUCTURE_TYPE_GENERIC_KHR
  * [[VUID-VkWriteDescriptorSetAccelerationStructureKHR-pAccelerationStructures-03580]]
    If the <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, each element of pname:pAccelerationStructures must: not be
    dlink:VK_NULL_HANDLE
****

include::{generated}/validity/structs/VkWriteDescriptorSetAccelerationStructureKHR.adoc[]
--
endif::VK_KHR_acceleration_structure[]

ifdef::VK_NV_ray_tracing[]
[open,refpage='VkWriteDescriptorSetAccelerationStructureNV',desc='Structure specifying acceleration structure descriptor information',type='structs']
--
:refpage: VkWriteDescriptorSetAccelerationStructureNV

The sname:VkWriteDescriptorSetAccelerationStructureNV structure is defined
as:

include::{generated}/api/structs/VkWriteDescriptorSetAccelerationStructureNV.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:accelerationStructureCount is the number of elements in
    pname:pAccelerationStructures.
  * pname:pAccelerationStructures is a pointer to an array of
    slink:VkAccelerationStructureNV structures specifying the acceleration
    structures to update.

.Valid Usage
****
  * [[VUID-VkWriteDescriptorSetAccelerationStructureNV-accelerationStructureCount-03747]]
    pname:accelerationStructureCount must: be equal to pname:descriptorCount
    in the extended structure
  * [[VUID-VkWriteDescriptorSetAccelerationStructureNV-pAccelerationStructures-03748]]
    Each acceleration structure in pname:pAccelerationStructures must: have
    been created with ename:VK_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL_KHR
  * [[VUID-VkWriteDescriptorSetAccelerationStructureNV-pAccelerationStructures-03749]]
    If the <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, each member of pname:pAccelerationStructures must: not be
    dlink:VK_NULL_HANDLE
****

include::{generated}/validity/structs/VkWriteDescriptorSetAccelerationStructureNV.adoc[]
--
endif::VK_NV_ray_tracing[]

[open,refpage='VkCopyDescriptorSet',desc='Structure specifying a copy descriptor set operation',type='structs']
--
The sname:VkCopyDescriptorSet structure is defined as:

include::{generated}/api/structs/VkCopyDescriptorSet.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:srcSet, pname:srcBinding, and pname:srcArrayElement are the source
    set, binding, and array element, respectively.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the descriptor binding identified by pname:srcSet and
    pname:srcBinding has a descriptor type of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then pname:srcArrayElement
    specifies the starting byte offset within the binding to copy from.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * pname:dstSet, pname:dstBinding, and pname:dstArrayElement are the
    destination set, binding, and array element, respectively.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the descriptor binding identified by pname:dstSet and
    pname:dstBinding has a descriptor type of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then pname:dstArrayElement
    specifies the starting byte offset within the binding to copy to.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * pname:descriptorCount is the number of descriptors to copy from the
    source to destination.
    If pname:descriptorCount is greater than the number of remaining array
    elements in the source or destination binding, those affect consecutive
    bindings in a manner similar to slink:VkWriteDescriptorSet above.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the descriptor binding identified by pname:srcSet and
    pname:srcBinding has a descriptor type of
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then pname:descriptorCount
    specifies the number of bytes to copy and the remaining array elements
    in the source or destination binding refer to the remaining number of
    bytes in those.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
If the sname:VkDescriptorSetLayoutBinding for pname:dstBinding is
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT and pname:srcBinding is not
ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the new active descriptor type becomes
the descriptor type of pname:srcBinding.
If both sname:VkDescriptorSetLayoutBinding for pname:srcBinding and
pname:dstBinding are ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the active
descriptor type in each source descriptor is copied into the corresponding
destination descriptor.
The active descriptor type can: be different for each source descriptor.

[NOTE]
.Note
====
The intention is that copies to and from mutable descriptors is a simple
memcpy.
Copies between non-mutable and mutable descriptors are expected to require
one memcpy per descriptor to handle the difference in size, but this use
case with more than one pname:descriptorCount is considered rare.
====
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]

.Valid Usage
****
  * [[VUID-VkCopyDescriptorSet-srcBinding-00345]]
    pname:srcBinding must: be a valid binding within pname:srcSet
  * [[VUID-VkCopyDescriptorSet-srcArrayElement-00346]]
    The sum of pname:srcArrayElement and pname:descriptorCount must: be less
    than or equal to the number of array elements in the descriptor set
    binding specified by pname:srcBinding, and all applicable consecutive
    bindings, as described by <<descriptorsets-updates-consecutive>>
  * [[VUID-VkCopyDescriptorSet-dstBinding-00347]]
    pname:dstBinding must: be a valid binding within pname:dstSet
  * [[VUID-VkCopyDescriptorSet-dstArrayElement-00348]]
    The sum of pname:dstArrayElement and pname:descriptorCount must: be less
    than or equal to the number of array elements in the descriptor set
    binding specified by pname:dstBinding, and all applicable consecutive
    bindings, as described by <<descriptorsets-updates-consecutive>>
  * [[VUID-VkCopyDescriptorSet-dstBinding-02632]]
    The type of pname:dstBinding within pname:dstSet must: be equal to the
    type of pname:srcBinding within pname:srcSet
  * [[VUID-VkCopyDescriptorSet-srcSet-00349]]
    If pname:srcSet is equal to pname:dstSet, then the source and
    destination ranges of descriptors must: not overlap, where the ranges
    may: include array elements from consecutive bindings as described by
    <<descriptorsets-updates-consecutive>>
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkCopyDescriptorSet-srcBinding-02223]]
    If the descriptor type of the descriptor set binding specified by
    pname:srcBinding is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK,
    pname:srcArrayElement must: be an integer multiple of `4`
  * [[VUID-VkCopyDescriptorSet-dstBinding-02224]]
    If the descriptor type of the descriptor set binding specified by
    pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK,
    pname:dstArrayElement must: be an integer multiple of `4`
  * [[VUID-VkCopyDescriptorSet-srcBinding-02225]]
    If the descriptor type of the descriptor set binding specified by either
    pname:srcBinding or pname:dstBinding is
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, pname:descriptorCount
    must: be an integer multiple of `4`
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkCopyDescriptorSet-srcSet-01918]]
    If pname:srcSet's layout was created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag
    set, then pname:dstSet's layout must: also have been created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag
    set
  * [[VUID-VkCopyDescriptorSet-srcSet-04885]]
    If pname:srcSet's layout was created without
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
    either the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT
    flag or
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
    the ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT
    flag set, then pname:dstSet's layout must: have been created without the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT flag
    set
  * [[VUID-VkCopyDescriptorSet-srcSet-01920]]
    If the descriptor pool from which pname:srcSet was allocated was created
    with the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set,
    then the descriptor pool from which pname:dstSet was allocated must:
    also have been created with the
    ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set
  * [[VUID-VkCopyDescriptorSet-srcSet-04887]]
    If the descriptor pool from which pname:srcSet was allocated was created
    without
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
    either the ename:VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT flag or
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
    the ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set, then
    the descriptor pool from which pname:dstSet was allocated must: have
    been created without the
    ename:VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT flag set
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-VkCopyDescriptorSet-dstBinding-02753]]
    If the descriptor type of the descriptor set binding specified by
    pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_SAMPLER, then pname:dstSet
    must: not have been allocated with a layout that included immutable
    samplers for pname:dstBinding
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkCopyDescriptorSet-dstSet-04612]]
    If sname:VkDescriptorSetLayoutBinding for pname:dstSet at
    pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the new active
    descriptor type must: exist in the corresponding
    pname:pMutableDescriptorTypeLists list for pname:dstBinding if the new
    active descriptor type is not ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
  * [[VUID-VkCopyDescriptorSet-srcSet-04613]]
    If sname:VkDescriptorSetLayoutBinding for pname:srcSet at
    pname:srcBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT and the
    sname:VkDescriptorSetLayoutBinding for pname:dstSet at pname:dstBinding
    is not ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the active descriptor type
    for the source descriptor must: match the descriptor type of
    pname:dstBinding
  * [[VUID-VkCopyDescriptorSet-dstSet-04614]]
    If sname:VkDescriptorSetLayoutBinding for pname:dstSet at
    pname:dstBinding is ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, and the new
    active descriptor type is ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT, the
    pname:pMutableDescriptorTypeLists for pname:srcBinding and
    pname:dstBinding must: match exactly
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
****

include::{generated}/validity/structs/VkCopyDescriptorSet.adoc[]
--


ifdef::VKSC_VERSION_1_0[]
ifdef::hidden[]
// tag::scremoved[]
  * elink:VkStructureType
  ** ename:VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR
     <<SCID-8>>
  * elink:VkObjectType
  ** ename:VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR <<SCID-8>>
  * fname:vkCreateDescriptorUpdateTemplateKHR,
    fname:vkDestroyDescriptorUpdateTemplateKHR,
    fname:vkUpdateDescriptorSetWithTemplateKHR,
    fname:vkCmdPushDescriptorSetWithTemplateKHR <<SCID-8>>
  * sname:VkDescriptorUpdateTemplateKHR,
    sname:VkDescriptorUpdateTemplateEntryKHR,
    sname:VkDescriptorUpdateTemplateCreateInfoKHR <<SCID-8>>
  * ename:VkDescriptorUpdateTemplateTypeKHR <<SCID-8>>
  * tname:VkDescriptorUpdateTemplateCreateFlagsKHR <<SCID-8>>
  * ename:VkDescriptorUpdateTemplateType
  ** ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR <<SCID-8>>
  ** ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR
     <<SCID-8>>
// end::scremoved[]
endif::hidden[]
endif::VKSC_VERSION_1_0[]


ifndef::VKSC_VERSION_1_0[]

ifdef::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]
[[descriptorsets-updates-with-template]]
=== Descriptor Update Templates

[open,refpage='VkDescriptorUpdateTemplate',desc='Opaque handle to a descriptor update template',type='handles']
--
A descriptor update template specifies a mapping from descriptor update
information in host memory to descriptors in a descriptor set.
It is designed to avoid passing redundant information to the driver when
frequently updating the same set of descriptors in descriptor sets.

Descriptor update template objects are represented by
sname:VkDescriptorUpdateTemplate handles:

include::{generated}/api/handles/VkDescriptorUpdateTemplate.adoc[]

ifdef::VK_KHR_descriptor_update_template[]
or the equivalent

include::{generated}/api/handles/VkDescriptorUpdateTemplateKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]
--


=== Descriptor Set Updates With Templates

[open,refpage='vkCreateDescriptorUpdateTemplate',desc='Create a new descriptor update template',type='protos']
--
Updating a large sname:VkDescriptorSet array can: be an expensive operation
since an application must: specify one slink:VkWriteDescriptorSet structure
for each descriptor or descriptor array to update, each of which
re-specifies the same state when updating the same descriptor in multiple
descriptor sets.
For cases when an application wishes to update the same set of descriptors
in multiple descriptor sets allocated using the same
sname:VkDescriptorSetLayout, flink:vkUpdateDescriptorSetWithTemplate can: be
used as a replacement for flink:vkUpdateDescriptorSets.

sname:VkDescriptorUpdateTemplate allows implementations to convert a set of
descriptor update operations on a single descriptor set to an internal
format that, in conjunction with flink:vkUpdateDescriptorSetWithTemplate
ifdef::VK_KHR_push_descriptor[]
or flink:vkCmdPushDescriptorSetWithTemplateKHR
endif::VK_KHR_push_descriptor[]
, can: be more efficient compared to calling flink:vkUpdateDescriptorSets
ifdef::VK_KHR_push_descriptor[]
or flink:vkCmdPushDescriptorSetKHR
endif::VK_KHR_push_descriptor[]
.
The descriptors themselves are not specified in the
sname:VkDescriptorUpdateTemplate, rather, offsets into an application
provided pointer to host memory are specified, which are combined with a
pointer passed to flink:vkUpdateDescriptorSetWithTemplate
ifdef::VK_KHR_push_descriptor[]
or flink:vkCmdPushDescriptorSetWithTemplateKHR
endif::VK_KHR_push_descriptor[]
.
This allows large batches of updates to be executed without having to
convert application data structures into a strictly-defined Vulkan data
structure.

To create a descriptor update template, call:

ifdef::VK_VERSION_1_1[]
include::{generated}/api/protos/vkCreateDescriptorUpdateTemplate.adoc[]
endif::VK_VERSION_1_1[]

ifdef::VK_VERSION_1_1+VK_KHR_descriptor_update_template[or the equivalent command]

ifdef::VK_KHR_descriptor_update_template[]
include::{generated}/api/protos/vkCreateDescriptorUpdateTemplateKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]

  * pname:device is the logical device that creates the descriptor update
    template.
  * pname:pCreateInfo is a pointer to a
    slink:VkDescriptorUpdateTemplateCreateInfo structure specifying the set
    of descriptors to update with a single call to
ifdef::VK_KHR_push_descriptor[]
    flink:vkCmdPushDescriptorSetWithTemplateKHR or
endif::VK_KHR_push_descriptor[]
    flink:vkUpdateDescriptorSetWithTemplate.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.
  * pname:pDescriptorUpdateTemplate is a pointer to a
    sname:VkDescriptorUpdateTemplate handle in which the resulting
    descriptor update template object is returned.

include::{generated}/validity/protos/vkCreateDescriptorUpdateTemplate.adoc[]
--

[open,refpage='VkDescriptorUpdateTemplateCreateInfo',desc='Structure specifying parameters of a newly created descriptor update template',type='structs']
--
The slink:VkDescriptorUpdateTemplateCreateInfo structure is defined as:
include::{generated}/api/structs/VkDescriptorUpdateTemplateCreateInfo.adoc[]

ifdef::VK_KHR_descriptor_update_template[]
or the equivalent

include::{generated}/api/structs/VkDescriptorUpdateTemplateCreateInfoKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:flags is reserved for future use.
  * pname:descriptorUpdateEntryCount is the number of elements in the
    pname:pDescriptorUpdateEntries array.
  * pname:pDescriptorUpdateEntries is a pointer to an array of
    slink:VkDescriptorUpdateTemplateEntry structures describing the
    descriptors to be updated by the descriptor update template.
  * pname:templateType Specifies the type of the descriptor update template.
    If set to ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET it
    can: only be used to update descriptor sets with a fixed
    pname:descriptorSetLayout.
ifdef::VK_KHR_push_descriptor[]
    If set to ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR
    it can: only be used to push descriptor sets using the provided
    pname:pipelineBindPoint, pname:pipelineLayout, and pname:set number.
endif::VK_KHR_push_descriptor[]
  * pname:descriptorSetLayout is the descriptor set layout used to build the
    descriptor update template.
    All descriptor sets which are going to be updated through the newly
    created descriptor update template must: be created with a layout that
    matches (is the same as, or defined identically to) this layout.
    This parameter is ignored if pname:templateType is not
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET.
ifdef::VK_KHR_push_descriptor[]
  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the
    type of the pipeline that will use the descriptors.
    This parameter is ignored if pname:templateType is not
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR
  * pname:pipelineLayout is a slink:VkPipelineLayout object used to program
    the bindings.
    This parameter is ignored if pname:templateType is not
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR
  * pname:set is the set number of the descriptor set in the pipeline layout
    that will be updated.
    This parameter is ignored if pname:templateType is not
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR
endif::VK_KHR_push_descriptor[]
ifndef::VK_KHR_push_descriptor[]
  * pname:pipelineBindPoint is reserved for future use and is ignored
  * pname:pipelineLayout is reserved for future use and is ignored
  * pname:set is reserved for future use and is ignored
endif::VK_KHR_push_descriptor[]

.Valid Usage
****
  * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00350]]
    If pname:templateType is
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET,
    pname:descriptorSetLayout must: be a valid sname:VkDescriptorSetLayout
    handle
ifdef::VK_KHR_push_descriptor[]
  * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00351]]
    If pname:templateType is
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR,
    pname:pipelineBindPoint must: be a valid elink:VkPipelineBindPoint value
  * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00352]]
    If pname:templateType is
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR,
    pname:pipelineLayout must: be a valid sname:VkPipelineLayout handle
  * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-00353]]
    If pname:templateType is
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pname:set
    must: be the unique set number in the pipeline layout that uses a
    descriptor set layout that was created with
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
endif::VK_KHR_push_descriptor[]
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
  * [[VUID-VkDescriptorUpdateTemplateCreateInfo-templateType-04615]]
    If pname:templateType is
    ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET,
    pname:descriptorSetLayout must: not contain a binding with type
    ename:VK_DESCRIPTOR_TYPE_MUTABLE_EXT
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
****


include::{generated}/validity/structs/VkDescriptorUpdateTemplateCreateInfo.adoc[]
--

[open,refpage='VkDescriptorUpdateTemplateCreateFlags',desc='Reserved for future use',type='flags']
--
include::{generated}/api/flags/VkDescriptorUpdateTemplateCreateFlags.adoc[]

ifdef::VK_KHR_descriptor_update_template[]
or the equivalent

include::{generated}/api/flags/VkDescriptorUpdateTemplateCreateFlagsKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]

tname:VkDescriptorUpdateTemplateCreateFlags is a bitmask type for setting a
mask, but is currently reserved for future use.
--

[open,refpage='VkDescriptorUpdateTemplateType',desc='Indicates the valid usage of the descriptor update template',type='enums']
--
The descriptor update template type is determined by the
slink:VkDescriptorUpdateTemplateCreateInfo::pname:templateType property,
which takes the following values:

include::{generated}/api/enums/VkDescriptorUpdateTemplateType.adoc[]

ifdef::VK_KHR_descriptor_update_template[]
or the equivalent

include::{generated}/api/enums/VkDescriptorUpdateTemplateTypeKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]

  * ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET specifies that
    the descriptor update template will be used for descriptor set updates
    only.
ifdef::VK_KHR_push_descriptor[]
  * ename:VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR specifies
    that the descriptor update template will be used for push descriptor
    updates only.
endif::VK_KHR_push_descriptor[]
--


[open,refpage='VkDescriptorUpdateTemplateEntry',desc='Describes a single descriptor update of the descriptor update template',type='structs']
--
The sname:VkDescriptorUpdateTemplateEntry structure is defined as:
include::{generated}/api/structs/VkDescriptorUpdateTemplateEntry.adoc[]

ifdef::VK_KHR_descriptor_update_template[]
or the equivalent

include::{generated}/api/structs/VkDescriptorUpdateTemplateEntryKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]

  * pname:dstBinding is the descriptor binding to update when using this
    descriptor update template.
  * pname:dstArrayElement is the starting element in the array belonging to
    pname:dstBinding.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the descriptor binding identified by pname:dstBinding has a
    descriptor type of ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then
    pname:dstArrayElement specifies the starting byte offset to update.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * pname:descriptorCount is the number of descriptors to update.
    If pname:descriptorCount is greater than the number of remaining array
    elements in the destination binding, those affect consecutive bindings
    in a manner similar to slink:VkWriteDescriptorSet above.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
    If the descriptor binding identified by pname:dstBinding has a
    descriptor type of ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK then
    pname:descriptorCount specifies the number of bytes to update and the
    remaining array elements in the destination binding refer to the
    remaining number of bytes in it.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * pname:descriptorType is a elink:VkDescriptorType specifying the type of
    the descriptor.
  * pname:offset is the offset in bytes of the first binding in the raw data
    structure.
  * pname:stride is the stride in bytes between two consecutive array
    elements of the descriptor update information in the raw data structure.
    The actual pointer ptr for each array element j of update entry i is
    computed using the following formula:
+
[source,c++]
----
    const char *ptr = (const char *)pData + pDescriptorUpdateEntries[i].offset + j * pDescriptorUpdateEntries[i].stride
----
+
The stride is useful in case the bindings are stored in structs along with
other data.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
If pname:descriptorType is ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
then the value of pname:stride is ignored and the stride is assumed to be
`1`, i.e. the descriptor update information for them is always specified as
a contiguous range.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

.Valid Usage
****
  * [[VUID-VkDescriptorUpdateTemplateEntry-dstBinding-00354]]
    pname:dstBinding must: be a valid binding in the descriptor set layout
    implicitly specified when using a descriptor update template to update
    descriptors
  * [[VUID-VkDescriptorUpdateTemplateEntry-dstArrayElement-00355]]
    pname:dstArrayElement and pname:descriptorCount must: be less than or
    equal to the number of array elements in the descriptor set binding
    implicitly specified when using a descriptor update template to update
    descriptors, and all applicable consecutive bindings, as described by
    <<descriptorsets-updates-consecutive>>
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
  * [[VUID-VkDescriptorUpdateTemplateEntry-descriptor-02226]]
    If pname:descriptor type is
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, pname:dstArrayElement
    must: be an integer multiple of `4`
  * [[VUID-VkDescriptorUpdateTemplateEntry-descriptor-02227]]
    If pname:descriptor type is
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK, pname:descriptorCount
    must: be an integer multiple of `4`
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
****

include::{generated}/validity/structs/VkDescriptorUpdateTemplateEntry.adoc[]
--

[open,refpage='vkDestroyDescriptorUpdateTemplate',desc='Destroy a descriptor update template object',type='protos']
--
To destroy a descriptor update template, call:

ifdef::VK_VERSION_1_1[]
include::{generated}/api/protos/vkDestroyDescriptorUpdateTemplate.adoc[]
endif::VK_VERSION_1_1[]

ifdef::VK_VERSION_1_1+VK_KHR_descriptor_update_template[or the equivalent command]

ifdef::VK_KHR_descriptor_update_template[]
include::{generated}/api/protos/vkDestroyDescriptorUpdateTemplateKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]

  * pname:device is the logical device that has been used to create the
    descriptor update template
  * pname:descriptorUpdateTemplate is the descriptor update template to
    destroy.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.

ifndef::VKSC_VERSION_1_0[]
.Valid Usage
****
  * [[VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00356]]
    If sname:VkAllocationCallbacks were provided when
    pname:descriptorUpdateTemplate was created, a compatible set of
    callbacks must: be provided here
  * [[VUID-vkDestroyDescriptorUpdateTemplate-descriptorSetLayout-00357]]
    If no sname:VkAllocationCallbacks were provided when
    pname:descriptorUpdateTemplate was created, pname:pAllocator must: be
    `NULL`
****
endif::VKSC_VERSION_1_0[]

include::{generated}/validity/protos/vkDestroyDescriptorUpdateTemplate.adoc[]
--

[open,refpage='vkUpdateDescriptorSetWithTemplate',desc='Update the contents of a descriptor set object using an update template',type='protos']
--
Once a sname:VkDescriptorUpdateTemplate has been created, descriptor sets
can: be updated by calling:

ifdef::VK_VERSION_1_1[]
include::{generated}/api/protos/vkUpdateDescriptorSetWithTemplate.adoc[]
endif::VK_VERSION_1_1[]

ifdef::VK_VERSION_1_1+VK_KHR_descriptor_update_template[or the equivalent command]

ifdef::VK_KHR_descriptor_update_template[]
include::{generated}/api/protos/vkUpdateDescriptorSetWithTemplateKHR.adoc[]
endif::VK_KHR_descriptor_update_template[]

  * pname:device is the logical device that updates the descriptor set.
  * pname:descriptorSet is the descriptor set to update
  * pname:descriptorUpdateTemplate is a slink:VkDescriptorUpdateTemplate
    object specifying the update mapping between pname:pData and the
    descriptor set to update.
  * pname:pData is a pointer to memory containing one or more
    slink:VkDescriptorImageInfo, slink:VkDescriptorBufferInfo, or
    slink:VkBufferView structures
ifdef::VK_KHR_acceleration_structure[or slink:VkAccelerationStructureKHR]
ifdef::VK_NV_ray_tracing[or slink:VkAccelerationStructureNV]
ifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[handles]
    used to write the descriptors.

.Valid Usage
****
  * [[VUID-vkUpdateDescriptorSetWithTemplate-pData-01685]]
    pname:pData must: be a valid pointer to a memory containing one or more
    valid instances of slink:VkDescriptorImageInfo,
    slink:VkDescriptorBufferInfo, or slink:VkBufferView in a layout defined
    by pname:descriptorUpdateTemplate when it was created with
    flink:vkCreateDescriptorUpdateTemplate
  * [[VUID-vkUpdateDescriptorSetWithTemplate-descriptorSet-06995]]
    Host access to pname:descriptorSet must: be
    <<fundamentals-threadingbehavior,externally synchronized>>
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
    unless explicitly denoted otherwise for specific flags
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
****

include::{generated}/validity/protos/vkUpdateDescriptorSetWithTemplate.adoc[]

.API example
[source,c++]
----
struct AppBufferView {
    VkBufferView bufferView;
    uint32_t     applicationRelatedInformation;
};

struct AppDataStructure
{
    VkDescriptorImageInfo  imageInfo;          // a single image info
    VkDescriptorBufferInfo bufferInfoArray[3]; // 3 buffer infos in an array
    AppBufferView          bufferView[2];      // An application defined structure containing a bufferView
    // ... some more application related data
};

const VkDescriptorUpdateTemplateEntry descriptorUpdateTemplateEntries[] =
{
    // binding to a single image descriptor
    {
        .binding = 0,
        .dstArrayElement = 0,
        .descriptorCount = 1,
        .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
        .offset = offsetof(AppDataStructure, imageInfo),
        .stride = 0         // stride not required if descriptorCount is 1
    },

    // binding to an array of buffer descriptors
    {
        .binding = 1,
        .dstArrayElement = 0,
        .descriptorCount = 3,
        .descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
        .offset = offsetof(AppDataStructure, bufferInfoArray),
        .stride = sizeof(VkDescriptorBufferInfo)    // descriptor buffer infos are compact
    },

    // binding to an array of buffer views
    {
        .binding = 2,
        .dstArrayElement = 0,
        .descriptorCount = 2,
        .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
        .offset = offsetof(AppDataStructure, bufferView) +
                  offsetof(AppBufferView, bufferView),
        .stride = sizeof(AppBufferView)             // bufferViews do not have to be compact
    },
};

// create a descriptor update template for descriptor set updates
const VkDescriptorUpdateTemplateCreateInfo createInfo =
{
    .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO,
    .pNext = NULL,
    .flags = 0,
    .descriptorUpdateEntryCount = 3,
    .pDescriptorUpdateEntries = descriptorUpdateTemplateEntries,
    .templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET,
    .descriptorSetLayout = myLayout,
    .pipelineBindPoint = 0,     // ignored by given templateType
    .pipelineLayout = 0,        // ignored by given templateType
    .set = 0,                   // ignored by given templateType
};

VkDescriptorUpdateTemplate myDescriptorUpdateTemplate;
myResult = vkCreateDescriptorUpdateTemplate(
    myDevice,
    &createInfo,
    NULL,
    &myDescriptorUpdateTemplate);

AppDataStructure appData;

// fill appData here or cache it in your engine
vkUpdateDescriptorSetWithTemplate(myDevice, myDescriptorSet, myDescriptorUpdateTemplate, &appData);
----
--
endif::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]

endif::VKSC_VERSION_1_0[]


[[descriptorsets-binding]]
=== Descriptor Set Binding

[open,refpage='vkCmdBindDescriptorSets',desc='Binds descriptor sets to a command buffer',type='protos']
--
:refpage: vkCmdBindDescriptorSets

To bind one or more descriptor sets to a command buffer, call:

include::{generated}/api/protos/vkCmdBindDescriptorSets.adoc[]

  * pname:commandBuffer is the command buffer that the descriptor sets will
    be bound to.
  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the
    type of the pipeline that will use the descriptors.
    There is a separate set of bind points for each pipeline type, so
    binding one does not disturb the others.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
  * pname:firstSet is the set number of the first descriptor set to be
    bound.
  * pname:descriptorSetCount is the number of elements in the
    pname:pDescriptorSets array.
  * pname:pDescriptorSets is a pointer to an array of handles to
    slink:VkDescriptorSet objects describing the descriptor sets to bind to.
  * pname:dynamicOffsetCount is the number of dynamic offsets in the
    pname:pDynamicOffsets array.
  * pname:pDynamicOffsets is a pointer to an array of code:uint32_t values
    specifying dynamic offsets.

fname:vkCmdBindDescriptorSets binds descriptor sets
pname:pDescriptorSets[0..pname:descriptorSetCount-1] to set numbers
[pname:firstSet..pname:firstSet+pname:descriptorSetCount-1] for subsequent
<<pipelines-bindpoint-commands, bound pipeline commands>> set by
pname:pipelineBindPoint.
Any bindings that were previously applied via these sets
ifdef::VK_EXT_descriptor_buffer[]
, or calls to flink:vkCmdSetDescriptorBufferOffsetsEXT or
flink:vkCmdBindDescriptorBufferEmbeddedSamplersEXT,
endif::VK_EXT_descriptor_buffer[]
are no longer valid.

Once bound, a descriptor set affects rendering of subsequent commands that
interact with the given pipeline type in the command buffer until either a
different set is bound to the same set number, or the set is disturbed as
described in <<descriptorsets-compatibility, Pipeline Layout
Compatibility>>.

A compatible descriptor set must: be bound for all set numbers that any
shaders in a pipeline access, at the time that a drawing or dispatching
command is recorded to execute using that pipeline.
However, if none of the shaders in a pipeline statically use any bindings
with a particular set number, then no descriptor set need be bound for that
set number, even if the pipeline layout includes a non-trivial descriptor
set layout for that set number.

[[descriptor-validity]]
When consuming a descriptor, a descriptor is considered valid if the
descriptor is not undefined: as described by
<<descriptor-set-initial-state,descriptor set allocation>>.
ifdef::VK_EXT_robustness2[]
If the <<features-nullDescriptor, pname:nullDescriptor>> feature is enabled,
a null descriptor is also considered valid.
endif::VK_EXT_robustness2[]
A descriptor that was disturbed by <<descriptorsets-compatibility, Pipeline
Layout Compatibility>>, or was never bound by fname:vkCmdBindDescriptorSets
is not considered valid.
If a pipeline accesses a descriptor either statically or dynamically
depending on the elink:VkDescriptorBindingFlagBits, the consuming descriptor
type in the pipeline must: match the elink:VkDescriptorType in
slink:VkDescriptorSetLayoutCreateInfo for the descriptor to be considered
valid.
ifdef::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]
If a descriptor is a mutable descriptor, the consuming descriptor type in
the pipeline must: match the active descriptor type for the descriptor to be
considered valid.
endif::VK_EXT_mutable_descriptor_type,VK_VALVE_mutable_descriptor_type[]

[NOTE]
.Note
====
Further validation may be carried out beyond validation for descriptor
types, e.g. <<textures-input-validation,Texel Input Validation>>.
====

[[descriptorsets-binding-dynamicoffsets]]
If any of the sets being bound include dynamic uniform or storage buffers,
then pname:pDynamicOffsets includes one element for each array element in
each dynamic descriptor type binding in each set.
Values are taken from pname:pDynamicOffsets in an order such that all
entries for set N come before set N+1; within a set, entries are ordered by
the binding numbers in the descriptor set layouts; and within a binding
array, elements are in order.
pname:dynamicOffsetCount must: equal the total number of dynamic descriptors
in the sets being bound.

[[dynamic-effective-offset]]
The effective offset used for dynamic uniform and storage buffer bindings is
the sum of the relative offset taken from pname:pDynamicOffsets, and the
base address of the buffer plus base offset in the descriptor set.
The range of the dynamic uniform and storage buffer bindings is the buffer
range as specified in the descriptor set.

Each of the pname:pDescriptorSets must: be compatible with the pipeline
layout specified by pname:layout.
The layout used to program the bindings must: also be compatible with the
pipeline used in subsequent <<pipelines-bindpoint-commands, bound pipeline
commands>> with that pipeline type, as defined in the
<<descriptorsets-compatibility, Pipeline Layout Compatibility>> section.

The descriptor set contents bound by a call to fname:vkCmdBindDescriptorSets
may: be consumed at the following times:

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * For descriptor bindings created with the
    ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT bit set, the contents
    may: be consumed when the command buffer is submitted to a queue, or
    during shader execution of the resulting draws and dispatches, or any
    time in between.
    Otherwise,
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * during host execution of the command, or during shader execution of the
    resulting draws and dispatches, or any time in between.

Thus, the contents of a descriptor set binding must: not be altered
(overwritten by an update command, or freed) between the first point in time
that it may: be consumed, and when the command completes executing on the
queue.

The contents of pname:pDynamicOffsets are consumed immediately during
execution of fname:vkCmdBindDescriptorSets.
Once all pending uses have completed, it is legal to update and reuse a
descriptor set.

.Valid Usage
****
include::{chapters}/commonvalidity/bind_descriptor_sets_common.adoc[]
  * [[VUID-vkCmdBindDescriptorSets-pipelineBindPoint-00361]]
    pname:pipelineBindPoint must: be supported by the pname:commandBuffer's
    parent sname:VkCommandPool's queue family
****

include::{generated}/validity/protos/vkCmdBindDescriptorSets.adoc[]
--

ifdef::VK_KHR_maintenance6[]
[open,refpage='vkCmdBindDescriptorSets2KHR',desc='Binds descriptor sets to a command buffer',type='protos']
--
Alternatively, to bind one or more descriptor sets to a command buffer,
call:

include::{generated}/api/protos/vkCmdBindDescriptorSets2KHR.adoc[]

  * pname:commandBuffer is the command buffer that the descriptor sets will
    be bound to.
  * pname:pBindDescriptorSetsInfo is a pointer to a
    sname:VkBindDescriptorSetsInfoKHR structure.

.Valid Usage
****
  * [[VUID-vkCmdBindDescriptorSets2KHR-pBindDescriptorSetsInfo-09467]]
    Each bit in pname:pBindDescriptorSetsInfo->stageFlags must: be a stage
    supported by the pname:commandBuffer's parent sname:VkCommandPool's
    queue family
****

include::{generated}/validity/protos/vkCmdBindDescriptorSets2KHR.adoc[]
--

[open,refpage='VkBindDescriptorSetsInfoKHR',desc='Structure specifying a descriptor set binding operation',type='structs']
--
:refpage: VkBindDescriptorSetsInfoKHR

The sname:VkBindDescriptorSetsInfoKHR structure is defined as:

include::{generated}/api/structs/VkBindDescriptorSetsInfoKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:stageFlags is a bitmask of elink:VkShaderStageFlagBits specifying
    the shader stages the descriptor sets will be bound to.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
ifdef::VK_NV_per_stage_descriptor_set[]
    If the <<features-dynamicPipelineLayout, pname:dynamicPipelineLayout>>
    feature is enabled, pname:layout can: be dlink:VK_NULL_HANDLE and the
    layout must: be specified by chaining the
    slink:VkPipelineLayoutCreateInfo structure off the pname:pNext
endif::VK_NV_per_stage_descriptor_set[]
  * pname:firstSet is the set number of the first descriptor set to be
    bound.
  * pname:descriptorSetCount is the number of elements in the
    pname:pDescriptorSets array.
  * pname:pDescriptorSets is a pointer to an array of handles to
    slink:VkDescriptorSet objects describing the descriptor sets to bind to.
  * pname:dynamicOffsetCount is the number of dynamic offsets in the
    pname:pDynamicOffsets array.
  * pname:pDynamicOffsets is a pointer to an array of code:uint32_t values
    specifying dynamic offsets.

If pname:stageFlags specifies a subset of all stages corresponding to one or
more pipeline bind points, the binding operation still affects all stages
corresponding to the given pipeline bind point(s) as if the equivalent
original version of this command had been called with the same parameters.
For example, specifying a pname:stageFlags value of
ename:VK_SHADER_STAGE_VERTEX_BIT | ename:VK_SHADER_STAGE_FRAGMENT_BIT |
ename:VK_SHADER_STAGE_COMPUTE_BIT is equivalent to calling the original
version of this command once with ename:VK_PIPELINE_BIND_POINT_GRAPHICS and
once with ename:VK_PIPELINE_BIND_POINT_COMPUTE.

.Valid Usage
****
include::{chapters}/commonvalidity/bind_descriptor_sets_common.adoc[]
include::{chapters}/commonvalidity/dynamic_pipeline_layout_common.adoc[]
****

include::{generated}/validity/structs/VkBindDescriptorSetsInfoKHR.adoc[]
--
endif::VK_KHR_maintenance6[]


ifdef::VK_KHR_push_descriptor[]
[[descriptorsets-push-descriptors]]
=== Push Descriptor Updates

[open,refpage='vkCmdPushDescriptorSetKHR',desc='Pushes descriptor updates into a command buffer',type='protos']
--
:refpage: vkCmdPushDescriptorSetKHR

In addition to allocating descriptor sets and binding them to a command
buffer, an application can: record descriptor updates into the command
buffer.

To push descriptor updates into a command buffer, call:

include::{generated}/api/protos/vkCmdPushDescriptorSetKHR.adoc[]

  * pname:commandBuffer is the command buffer that the descriptors will be
    recorded in.
  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the
    type of the pipeline that will use the descriptors.
    There is a separate set of push descriptor bindings for each pipeline
    type, so binding one does not disturb the others.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
  * pname:set is the set number of the descriptor set in the pipeline layout
    that will be updated.
  * pname:descriptorWriteCount is the number of elements in the
    pname:pDescriptorWrites array.
  * pname:pDescriptorWrites is a pointer to an array of
    slink:VkWriteDescriptorSet structures describing the descriptors to be
    updated.

_Push descriptors_ are a small bank of descriptors whose storage is
internally managed by the command buffer rather than being written into a
descriptor set and later bound to a command buffer.
Push descriptors allow for incremental updates of descriptors without
managing the lifetime of descriptor sets.

When a command buffer begins recording, all push descriptors are undefined:.
Push descriptors can: be updated incrementally and cause shaders to use the
updated descriptors for subsequent <<pipelines-bindpoint-commands, bound
pipeline commands>> with the pipeline type set by pname:pipelineBindPoint
until the descriptor is overwritten, or else until the set is disturbed as
described in <<descriptorsets-compatibility, Pipeline Layout
Compatibility>>.
When the set is disturbed or push descriptors with a different descriptor
set layout are set, all push descriptors are undefined:.

Push descriptors that are <<shaders-staticuse,statically used>> by a
pipeline must: not be undefined: at the time that a drawing or dispatching
command is recorded to execute using that pipeline.
This includes immutable sampler descriptors, which must: be pushed before
they are accessed by a pipeline (the immutable samplers are pushed, rather
than the samplers in pname:pDescriptorWrites).
Push descriptors that are not statically used can: remain undefined:.

Push descriptors do not use dynamic offsets.
Instead, the corresponding non-dynamic descriptor types can: be used and the
pname:offset member of slink:VkDescriptorBufferInfo can: be changed each
time the descriptor is written.

Each element of pname:pDescriptorWrites is interpreted as in
slink:VkWriteDescriptorSet, except the pname:dstSet member is ignored.

To push an immutable sampler, use a slink:VkWriteDescriptorSet with
pname:dstBinding and pname:dstArrayElement selecting the immutable sampler's
binding.
If the descriptor type is ename:VK_DESCRIPTOR_TYPE_SAMPLER, the
pname:pImageInfo parameter is ignored and the immutable sampler is taken
from the push descriptor set layout in the pipeline layout.
If the descriptor type is ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
the pname:sampler member of the pname:pImageInfo parameter is ignored and
the immutable sampler is taken from the push descriptor set layout in the
pipeline layout.

.Valid Usage
****
include::{chapters}/commonvalidity/push_descriptor_set_common.adoc[]
  * [[VUID-vkCmdPushDescriptorSetKHR-pipelineBindPoint-00363]]
    pname:pipelineBindPoint must: be supported by the pname:commandBuffer's
    parent sname:VkCommandPool's queue family
****

include::{generated}/validity/protos/vkCmdPushDescriptorSetKHR.adoc[]
--

ifdef::VK_KHR_maintenance6[]
[open,refpage='vkCmdPushDescriptorSet2KHR',desc='Pushes descriptor updates into a command buffer',type='protos']
--
Alternatively, to push descriptor updates into a command buffer, call:

include::{generated}/api/protos/vkCmdPushDescriptorSet2KHR.adoc[]

  * pname:commandBuffer is the command buffer that the descriptors will be
    recorded in.
  * pname:pPushDescriptorSetInfo is a pointer to a
    sname:VkPushDescriptorSetInfoKHR structure.

.Valid Usage
****
  * [[VUID-vkCmdPushDescriptorSet2KHR-pPushDescriptorSetInfo-09468]]
    Each bit in pname:pPushDescriptorSetInfo->stageFlags must: be a stage
    supported by the pname:commandBuffer's parent sname:VkCommandPool's
    queue family
****

include::{generated}/validity/protos/vkCmdPushDescriptorSet2KHR.adoc[]
--

[open,refpage='VkPushDescriptorSetInfoKHR',desc='Structure specifying a descriptor set push operation',type='structs']
--
:refpage: VkPushDescriptorSetInfoKHR

The sname:VkPushDescriptorSetInfoKHR structure is defined as:

include::{generated}/api/structs/VkPushDescriptorSetInfoKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:stageFlags is a bitmask of elink:VkShaderStageFlagBits specifying
    the shader stages that will use the descriptors.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
ifdef::VK_NV_per_stage_descriptor_set[]
    If the <<features-dynamicPipelineLayout, pname:dynamicPipelineLayout>>
    feature is enabled, pname:layout can: be dlink:VK_NULL_HANDLE and the
    layout must: be specified by chaining slink:VkPipelineLayoutCreateInfo
    structure off the pname:pNext
endif::VK_NV_per_stage_descriptor_set[]
  * pname:set is the set number of the descriptor set in the pipeline layout
    that will be updated.
  * pname:descriptorWriteCount is the number of elements in the
    pname:pDescriptorWrites array.
  * pname:pDescriptorWrites is a pointer to an array of
    slink:VkWriteDescriptorSet structures describing the descriptors to be
    updated.

If pname:stageFlags specifies a subset of all stages corresponding to one or
more pipeline bind points, the binding operation still affects all stages
corresponding to the given pipeline bind point(s) as if the equivalent
original version of this command had been called with the same parameters.
For example, specifying a pname:stageFlags value of
ename:VK_SHADER_STAGE_VERTEX_BIT | ename:VK_SHADER_STAGE_FRAGMENT_BIT |
ename:VK_SHADER_STAGE_COMPUTE_BIT is equivalent to calling the original
version of this command once with ename:VK_PIPELINE_BIND_POINT_GRAPHICS and
once with ename:VK_PIPELINE_BIND_POINT_COMPUTE.

.Valid Usage
****
include::{chapters}/commonvalidity/push_descriptor_set_common.adoc[]
include::{chapters}/commonvalidity/dynamic_pipeline_layout_common.adoc[]
****

include::{generated}/validity/structs/VkPushDescriptorSetInfoKHR.adoc[]
--
endif::VK_KHR_maintenance6[]


ifdef::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]
=== Push Descriptor Updates With Descriptor Update Templates

[open,refpage='vkCmdPushDescriptorSetWithTemplateKHR',desc='Pushes descriptor updates into a command buffer using a descriptor update template',type='protos']
--
:refpage: vkCmdPushDescriptorSetWithTemplateKHR

It is also possible to use a descriptor update template to specify the push
descriptors to update.
To do so, call:

include::{generated}/api/protos/vkCmdPushDescriptorSetWithTemplateKHR.adoc[]

  * pname:commandBuffer is the command buffer that the descriptors will be
    recorded in.
  * pname:descriptorUpdateTemplate is a descriptor update template defining
    how to interpret the descriptor information in pname:pData.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
    It must: be compatible with the layout used to create the
    pname:descriptorUpdateTemplate handle.
  * pname:set is the set number of the descriptor set in the pipeline layout
    that will be updated.
    This must: be the same number used to create the
    pname:descriptorUpdateTemplate handle.
  * pname:pData is a pointer to memory containing descriptors for the
    templated update.

.Valid Usage
****
include::{chapters}/commonvalidity/push_descriptor_set_with_template_common.adoc[]
****

include::{generated}/validity/protos/vkCmdPushDescriptorSetWithTemplateKHR.adoc[]

.API example
[source,c++]
----

struct AppDataStructure
{
    VkDescriptorImageInfo  imageInfo;          // a single image info
    // ... some more application related data
};

const VkDescriptorUpdateTemplateEntry descriptorUpdateTemplateEntries[] =
{
    // binding to a single image descriptor
    {
        .binding = 0,
        .dstArrayElement = 0,
        .descriptorCount = 1,
        .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
        .offset = offsetof(AppDataStructure, imageInfo),
        .stride = 0     // not required if descriptorCount is 1
    }
};

// create a descriptor update template for push descriptor set updates
const VkDescriptorUpdateTemplateCreateInfo createInfo =
{
    .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO,
    .pNext = NULL,
    .flags = 0,
    .descriptorUpdateEntryCount = 1,
    .pDescriptorUpdateEntries = descriptorUpdateTemplateEntries,
    .templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR,
    .descriptorSetLayout = 0,   // ignored by given templateType
    .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
    .pipelineLayout = myPipelineLayout,
    .set = 0,
};

VkDescriptorUpdateTemplate myDescriptorUpdateTemplate;
myResult = vkCreateDescriptorUpdateTemplate(
    myDevice,
    &createInfo,
    NULL,
    &myDescriptorUpdateTemplate);

AppDataStructure appData;
// fill appData here or cache it in your engine
vkCmdPushDescriptorSetWithTemplateKHR(myCmdBuffer, myDescriptorUpdateTemplate, myPipelineLayout, 0,&appData);
----
--

ifdef::VK_KHR_maintenance6[]
[open,refpage='vkCmdPushDescriptorSetWithTemplate2KHR',desc='Pushes descriptor updates into a command buffer using a descriptor update template',type='protos']
--
Alternatively, to use a descriptor update template to specify the push
descriptors to update, call:

include::{generated}/api/protos/vkCmdPushDescriptorSetWithTemplate2KHR.adoc[]

  * pname:commandBuffer is the command buffer that the descriptors will be
    recorded in.
  * pname:pPushDescriptorSetWithTemplateInfo is a pointer to a
    sname:VkPushDescriptorSetWithTemplateInfoKHR structure.

include::{generated}/validity/protos/vkCmdPushDescriptorSetWithTemplate2KHR.adoc[]
--

[open,refpage='VkPushDescriptorSetWithTemplateInfoKHR',desc='Structure specifying a descriptor set push operation using a descriptor update template',type='structs']
--
:refpage: VkPushDescriptorSetWithTemplateInfoKHR

The sname:VkPushDescriptorSetWithTemplateInfoKHR structure is defined as:

include::{generated}/api/structs/VkPushDescriptorSetWithTemplateInfoKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:descriptorUpdateTemplate is a descriptor update template defining
    how to interpret the descriptor information in pname:pData.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
    It must: be compatible with the layout used to create the
    pname:descriptorUpdateTemplate handle.
ifdef::VK_NV_per_stage_descriptor_set[]
    If the <<features-dynamicPipelineLayout, pname:dynamicPipelineLayout>>
    feature is enabled, pname:layout can: be dlink:VK_NULL_HANDLE and the
    layout must: be specified by chaining slink:VkPipelineLayoutCreateInfo
    structure off the pname:pNext
endif::VK_NV_per_stage_descriptor_set[]
  * pname:set is the set number of the descriptor set in the pipeline layout
    that will be updated.
    This must: be the same number used to create the
    pname:descriptorUpdateTemplate handle.
  * pname:pData is a pointer to memory containing descriptors for the
    templated update.

.Valid Usage
****
include::{chapters}/commonvalidity/push_descriptor_set_with_template_common.adoc[]
include::{chapters}/commonvalidity/dynamic_pipeline_layout_common.adoc[]
****

include::{generated}/validity/structs/VkPushDescriptorSetWithTemplateInfoKHR.adoc[]
--
endif::VK_KHR_maintenance6[]

endif::VK_VERSION_1_1,VK_KHR_descriptor_update_template[]
endif::VK_KHR_push_descriptor[]


[[descriptorsets-push-constants]]
=== Push Constant Updates

As described above in section <<descriptorsets-pipelinelayout, Pipeline
Layouts>>, the pipeline layout defines shader push constants which are
updated via Vulkan commands rather than via writes to memory or copy
commands.

[NOTE]
.Note
====
Push constants represent a high speed path to modify constant data in
pipelines that is expected to outperform memory-backed resource updates.
====

[open,refpage='vkCmdPushConstants',desc='Update the values of push constants',type='protos']
--
:refpage: vkCmdPushConstants

To update push constants, call:

include::{generated}/api/protos/vkCmdPushConstants.adoc[]

  * pname:commandBuffer is the command buffer in which the push constant
    update will be recorded.
  * pname:layout is the pipeline layout used to program the push constant
    updates.
  * pname:stageFlags is a bitmask of elink:VkShaderStageFlagBits specifying
    the shader stages that will use the push constants in the updated range.
  * pname:offset is the start offset of the push constant range to update,
    in units of bytes.
  * pname:size is the size of the push constant range to update, in units of
    bytes.
  * pname:pValues is a pointer to an array of pname:size bytes containing
    the new push constant values.

When a command buffer begins recording, all push constant values are
undefined:.
ifdef::VK_VERSION_1_3,VK_KHR_maintenance4[]
Reads of undefined: push constant values by the executing shader return
undefined: values.
endif::VK_VERSION_1_3,VK_KHR_maintenance4[]

Push constant values can: be updated incrementally, causing shader stages in
pname:stageFlags to read the new data from pname:pValues for push constants
modified by this command, while still reading the previous data for push
constants not modified by this command.
When a <<pipelines-bindpoint-commands, bound pipeline command>> is issued,
the bound pipeline's layout must: be compatible with the layouts used to set
the values of all push constants in the pipeline layout's push constant
ranges, as described in <<descriptorsets-compatibility,Pipeline Layout
Compatibility>>.
Binding a pipeline with a layout that is not compatible with the push
constant layout does not disturb the push constant values.

[NOTE]
.Note
====
As pname:stageFlags needs to include all flags the relevant push constant
ranges were created with, any flags that are not supported by the queue
family that the slink:VkCommandPool used to allocate pname:commandBuffer was
created on are ignored.
====

.Valid Usage
****
include::{chapters}/commonvalidity/push_constants_common.adoc[]
****

include::{generated}/validity/protos/vkCmdPushConstants.adoc[]
--

ifdef::VK_KHR_maintenance6[]
[open,refpage='vkCmdPushConstants2KHR',desc='Update the values of push constants',type='protos']
--
Alternatively, to update push constants, call:

include::{generated}/api/protos/vkCmdPushConstants2KHR.adoc[]

  * pname:commandBuffer is the command buffer in which the push constant
    update will be recorded.
  * pname:pPushConstantsInfo is a pointer to a sname:VkPushConstantsInfoKHR
    structure.

include::{generated}/validity/protos/vkCmdPushConstants2KHR.adoc[]
--

[open,refpage='VkPushConstantsInfoKHR',desc='Structure specifying a push constant update operation',type='structs']
--
:refpage: VkPushConstantsInfoKHR

The sname:VkPushConstantsInfoKHR structure is defined as:

include::{generated}/api/structs/VkPushConstantsInfoKHR.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:layout is the pipeline layout used to program the push constant
    updates.
ifdef::VK_NV_per_stage_descriptor_set[]
    If the <<features-dynamicPipelineLayout, pname:dynamicPipelineLayout>>
    feature is enabled, pname:layout can: be dlink:VK_NULL_HANDLE and the
    layout must: be specified by chaining slink:VkPipelineLayoutCreateInfo
    structure off the pname:pNext
endif::VK_NV_per_stage_descriptor_set[]
  * pname:stageFlags is a bitmask of elink:VkShaderStageFlagBits specifying
    the shader stages that will use the push constants in the updated range.
  * pname:offset is the start offset of the push constant range to update,
    in units of bytes.
  * pname:size is the size of the push constant range to update, in units of
    bytes.
  * pname:pValues is a pointer to an array of pname:size bytes containing
    the new push constant values.

.Valid Usage
****
include::{chapters}/commonvalidity/push_constants_common.adoc[]
include::{chapters}/commonvalidity/dynamic_pipeline_layout_common.adoc[]
****

include::{generated}/validity/structs/VkPushConstantsInfoKHR.adoc[]
--
endif::VK_KHR_maintenance6[]


ifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
[[descriptorsets-physical-storage-buffer]]
== Physical Storage Buffer Access

[open,refpage='vkGetBufferDeviceAddress',desc='Query an address of a buffer',type='protos',alias='vkGetBufferDeviceAddressKHR']
--
To query a 64-bit buffer device address value through which buffer memory
can: be accessed in a shader, call:

ifdef::VK_VERSION_1_2[]
include::{generated}/api/protos/vkGetBufferDeviceAddress.adoc[]
endif::VK_VERSION_1_2[]

ifdef::VK_VERSION_1_2+VK_KHR_buffer_device_address[or the equivalent command]

ifdef::VK_KHR_buffer_device_address[]
include::{generated}/api/protos/vkGetBufferDeviceAddressKHR.adoc[]
endif::VK_KHR_buffer_device_address[]

// Jon: 3-way conditional logic here is wrong

ifdef::VK_EXT_buffer_device_address[]
or the equivalent command

include::{generated}/api/protos/vkGetBufferDeviceAddressEXT.adoc[]
endif::VK_EXT_buffer_device_address[]

  * pname:device is the logical device that the buffer was created on.
  * pname:pInfo is a pointer to a slink:VkBufferDeviceAddressInfo structure
    specifying the buffer to retrieve an address for.

The 64-bit return value is an address of the start of pname:pInfo->buffer.
The address range starting at this value and whose size is the size of the
buffer can: be used in a shader to access the memory bound to that buffer,
using the
ifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
`SPV_KHR_physical_storage_buffer` extension
ifdef::VK_EXT_buffer_device_address[or the equivalent]
endif::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
ifdef::VK_EXT_buffer_device_address[]
`SPV_EXT_physical_storage_buffer` extension
endif::VK_EXT_buffer_device_address[]
and the code:PhysicalStorageBuffer storage class.
For example, this value can: be stored in a uniform buffer, and the shader
can: read the value from the uniform buffer and use it to do a dependent
read/write to this buffer.
A value of zero is reserved as a "`null`" pointer and must: not be returned
as a valid buffer device address.
All loads, stores, and atomics in a shader through
code:PhysicalStorageBuffer pointers must: access addresses in the address
range of some buffer.

If the buffer was created with a non-zero value of
ifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
ifdef::VK_EXT_buffer_device_address[slink:VkBufferOpaqueCaptureAddressCreateInfo::pname:opaqueCaptureAddress or]
ifndef::VK_EXT_buffer_device_address[slink:VkBufferOpaqueCaptureAddressCreateInfo::pname:opaqueCaptureAddress,]
endif::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
ifdef::VK_EXT_buffer_device_address[]
slink:VkBufferDeviceAddressCreateInfoEXT::pname:deviceAddress,
endif::VK_EXT_buffer_device_address[]
the return value will be the same address that was returned at capture time.

The returned address must: satisfy the alignment requirement specified by
slink:VkMemoryRequirements::pname:alignment for the buffer in
slink:VkBufferDeviceAddressInfo::pname:buffer.

If multiple slink:VkBuffer objects are bound to overlapping ranges of
slink:VkDeviceMemory, implementations may: return address ranges which
overlap.
In this case, it is ambiguous which slink:VkBuffer is associated with any
given device address.
For purposes of valid usage, if multiple slink:VkBuffer objects can: be
attributed to a device address, a slink:VkBuffer is selected such that valid
usage passes, if it exists.

.Valid Usage
****
  * [[VUID-vkGetBufferDeviceAddress-bufferDeviceAddress-03324]]
    The <<features-bufferDeviceAddress, pname:bufferDeviceAddress>>
ifdef::VK_EXT_buffer_device_address[]
    or <<features-bufferDeviceAddressEXT,
    sname:VkPhysicalDeviceBufferDeviceAddressFeaturesEXT::pname:bufferDeviceAddress>>
endif::VK_EXT_buffer_device_address[]
    feature must: be enabled
  * [[VUID-vkGetBufferDeviceAddress-device-03325]]
    If pname:device was created with multiple physical devices, then the
    <<features-bufferDeviceAddressMultiDevice,
    pname:bufferDeviceAddressMultiDevice>>
ifdef::VK_EXT_buffer_device_address[]
    or <<features-bufferDeviceAddressMultiDeviceEXT,
    sname:VkPhysicalDeviceBufferDeviceAddressFeaturesEXT::pname:bufferDeviceAddressMultiDevice>>
endif::VK_EXT_buffer_device_address[]
    feature must: be enabled
****

include::{generated}/validity/protos/vkGetBufferDeviceAddress.adoc[]
--

[open,refpage='VkBufferDeviceAddressInfo',desc='Structure specifying the buffer to query an address for',type='structs',alias='VkBufferDeviceAddressInfoKHR,VkBufferDeviceAddressInfoEXT']
--
The sname:VkBufferDeviceAddressInfo structure is defined as:

include::{generated}/api/structs/VkBufferDeviceAddressInfo.adoc[]

ifdef::VK_KHR_buffer_device_address[]
or the equivalent

include::{generated}/api/structs/VkBufferDeviceAddressInfoKHR.adoc[]
endif::VK_KHR_buffer_device_address[]

// Jon: three-way conditional logic is broken
ifdef::VK_EXT_buffer_device_address[]
or the equivalent

include::{generated}/api/structs/VkBufferDeviceAddressInfoEXT.adoc[]
endif::VK_EXT_buffer_device_address[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:buffer specifies the buffer whose address is being queried.

.Valid Usage
****
  * [[VUID-VkBufferDeviceAddressInfo-buffer-02600]]
    If pname:buffer is non-sparse and was not created with the
    ename:VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT flag, then it
    must: be bound completely and contiguously to a single
    sname:VkDeviceMemory object
  * [[VUID-VkBufferDeviceAddressInfo-buffer-02601]]
    pname:buffer must: have been created with
    ename:VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT
****

include::{generated}/validity/structs/VkBufferDeviceAddressInfo.adoc[]
--
endif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]

ifdef::VK_VERSION_1_2,VK_KHR_buffer_device_address[]
[open,refpage='vkGetBufferOpaqueCaptureAddress',desc='Query an opaque capture address of a buffer',type='protos',alias='vkGetBufferOpaqueCaptureAddressKHR']
--
To query a 64-bit buffer opaque capture address, call:

ifdef::VK_VERSION_1_2[]
include::{generated}/api/protos/vkGetBufferOpaqueCaptureAddress.adoc[]
endif::VK_VERSION_1_2[]

ifdef::VK_VERSION_1_2+VK_KHR_buffer_device_address[or the equivalent command]

ifdef::VK_KHR_buffer_device_address[]
include::{generated}/api/protos/vkGetBufferOpaqueCaptureAddressKHR.adoc[]
endif::VK_KHR_buffer_device_address[]

  * pname:device is the logical device that the buffer was created on.
  * pname:pInfo is a pointer to a slink:VkBufferDeviceAddressInfo structure
    specifying the buffer to retrieve an address for.

The 64-bit return value is an opaque capture address of the start of
pname:pInfo->buffer.

If the buffer was created with a non-zero value of
slink:VkBufferOpaqueCaptureAddressCreateInfo::pname:opaqueCaptureAddress the
return value must: be the same address.

.Valid Usage
****
  * [[VUID-vkGetBufferOpaqueCaptureAddress-None-03326]]
    The <<features-bufferDeviceAddress, pname:bufferDeviceAddress>> feature
    must: be enabled
  * [[VUID-vkGetBufferOpaqueCaptureAddress-device-03327]]
    If pname:device was created with multiple physical devices, then the
    <<features-bufferDeviceAddressMultiDevice,
    pname:bufferDeviceAddressMultiDevice>> feature must: be enabled
****

include::{generated}/validity/protos/vkGetBufferOpaqueCaptureAddress.adoc[]
--
endif::VK_VERSION_1_2,VK_KHR_buffer_device_address[]


ifdef::VK_EXT_descriptor_buffer[]
[[descriptorbuffers]]
== Descriptor Buffers

If the <<features-descriptorBuffer, pname:descriptorBuffer>> feature is
enabled, an alternative way to specify descriptor sets is via buffers,
rather than descriptor set objects.


[[descriptorbuffers-puttingdescriptorsinmemory]]
=== Putting Descriptors in Memory

Commands are provided to retrieve descriptor data, and also to locate where
in memory that data must: be written to match the given descriptor set
layout.

[open,refpage='vkGetDescriptorSetLayoutSizeEXT',desc='Get the size of a descriptor set layout in memory',type='protos']
--
To determine the amount of memory needed to store all descriptors with a
given layout, call:

include::{generated}/api/protos/vkGetDescriptorSetLayoutSizeEXT.adoc[]

  * pname:device is the logical device that gets the size.
  * pname:layout is the descriptor set layout being queried.
  * pname:pLayoutSizeInBytes is a pointer to basetype:VkDeviceSize where the
    size in bytes will be written.

The size of a descriptor set layout will be at least as large as the sum
total of the size of all descriptors in the layout, and may: be larger.
This size represents the amount of memory that will be required to store all
of the descriptors for this layout in memory, when placed according to the
layout's offsets as obtained by
flink:vkGetDescriptorSetLayoutBindingOffsetEXT.

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
If any pname:binding in pname:layout is
ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, the returned size
includes space for the maximum pname:descriptorCount descriptors as declared
for that pname:binding.
To compute the required size of a descriptor set with a
ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT:

  {empty}:: [eq]#size = offset + descriptorSize {times}
            variableDescriptorCount#

where [eq]#offset# is obtained by
flink:vkGetDescriptorSetLayoutBindingOffsetEXT and [eq]#descriptorSize# is
the size of the relevant descriptor as obtained from
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT, and
[eq]#variableDescriptorCount# is the equivalent of
slink:VkDescriptorSetVariableDescriptorCountAllocateInfo::pname:pDescriptorCounts.
ifdef::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]
For ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK,
[eq]#variableDescriptorCount# is the size in bytes for the inline uniform
block, and [eq]#descriptorSize# is 1.
endif::VK_VERSION_1_3,VK_EXT_inline_uniform_block[]

If
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:combinedImageSamplerDescriptorSingleArray
is ename:VK_FALSE and the variable descriptor type is
ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
[eq]#variableDescriptorCount# is always considered to be the upper bound.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

.Valid Usage
****
  * [[VUID-vkGetDescriptorSetLayoutSizeEXT-None-08011]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkGetDescriptorSetLayoutSizeEXT-layout-08012]]
    pname:layout must: have been created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT flag set
****

include::{generated}/validity/protos/vkGetDescriptorSetLayoutSizeEXT.adoc[]
--

[open,refpage='vkGetDescriptorSetLayoutBindingOffsetEXT',desc='Get the offset of a binding within a descriptor set layout',type='protos']
--
To get the offset of a binding within a descriptor set layout in memory,
call:

include::{generated}/api/protos/vkGetDescriptorSetLayoutBindingOffsetEXT.adoc[]

  * pname:device is the logical device that gets the offset.
  * pname:layout is the descriptor set layout being queried.
  * pname:binding is the binding number being queried.
  * pname:pOffset is a pointer to basetype:VkDeviceSize where the byte
    offset of the binding will be written.

Each binding in a descriptor set layout is assigned an offset in memory by
the implementation.
When a shader accesses a resource with that binding, it will access the
bound descriptor buffer from that offset to look for its descriptor.
This command provides an application with that offset, so that descriptors
can be placed in the correct locations.
The precise location accessed by a shader for a given descriptor is as
follows:

  {empty}:: [eq]#location = bufferAddress {plus} setOffset {plus}
            descriptorOffset {plus} (arrayElement {times} descriptorSize)#

where [eq]#bufferAddress# and [eq]#setOffset# are the base address and
offset for the identified descriptor set as specified by
flink:vkCmdBindDescriptorBuffersEXT and
flink:vkCmdSetDescriptorBufferOffsetsEXT, [eq]#descriptorOffset# is the
offset for the binding returned by this command, [eq]#arrayElement# is the
index into the array specified in the shader, and [eq]#descriptorSize# is
the size of the relevant descriptor as obtained from
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT.
Applications are responsible for placing valid descriptors at the expected
location in order for a shader to access it.
The overall offset added to [eq]#bufferAddress# to calculate [eq]#location#
must: be less than
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:maxSamplerDescriptorBufferRange
for samplers and
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:maxResourceDescriptorBufferRange
for resources.

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
If any pname:binding in pname:layout is
ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, that
pname:binding must: have the largest offset of any pname:binding.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

ifdef::VK_VALVE_mutable_descriptor_type[]
A descriptor pname:binding with type ename:VK_DESCRIPTOR_TYPE_MUTABLE_VALVE
can: be used.
Any potential types in
slink:VkMutableDescriptorTypeCreateInfoVALVE::pname:pDescriptorTypes for
pname:binding share the same offset.
If the size of the <<descriptorsets-mutable, mutable descriptor>> is larger
than the size of a concrete descriptor type being accessed, the padding area
is ignored by the implementation.
endif::VK_VALVE_mutable_descriptor_type[]

.Valid Usage
****
  * [[VUID-vkGetDescriptorSetLayoutBindingOffsetEXT-None-08013]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkGetDescriptorSetLayoutBindingOffsetEXT-layout-08014]]
    pname:layout must: have been created with the
    ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT flag set
****

include::{generated}/validity/protos/vkGetDescriptorSetLayoutBindingOffsetEXT.adoc[]
--

[open,refpage='vkGetDescriptorEXT',desc='To get a descriptor to place in a buffer',type='protos']
--
To get descriptor data to place in a buffer, call:

include::{generated}/api/protos/vkGetDescriptorEXT.adoc[]

  * pname:device is the logical device that gets the descriptor.
  * pname:pDescriptorInfo is a pointer to a slink:VkDescriptorGetInfoEXT
    structure specifying the parameters of the descriptor to get.
  * pname:dataSize is the amount of the descriptor data to get in bytes.
  * pname:pDescriptor is a pointer to a user-allocated buffer where the
    descriptor will be written.

The size of the data for each descriptor type is determined by the value in
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT.
This value also defines the stride in bytes for arrays of that descriptor
type.

If the
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:combinedImageSamplerDescriptorSingleArray
property is ename:VK_FALSE the implementation requires an array of
ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptors to be written
into a descriptor buffer as an array of image descriptors, immediately
followed by an array of sampler descriptors.
Applications must: write the first
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:sampledImageDescriptorSize
bytes of the data returned through pname:pDescriptor to the first array, and
the remaining
slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:samplerDescriptorSize
bytes of the data to the second array.
For variable-sized descriptor bindings of
ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptors, the two arrays
each have a size equal to the upper bound pname:descriptorCount of that
binding.

A descriptor obtained by this command references the underlying
slink:VkImageView or slink:VkSampler, and these objects must: not be
destroyed before the last time a descriptor is dynamically accessed.
For descriptor types which consume an address instead of an object, the
underlying slink:VkBuffer is referenced instead.

.Valid Usage
****
  * [[VUID-vkGetDescriptorEXT-None-08015]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkGetDescriptorEXT-dataSize-08125]]
ifdef::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]
    If pname:pDescriptorInfo->type is not
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER or
    pname:pDescriptorInfo->data.pCombinedImageSampler has an pname:imageView
    member that was not created with a sname:VkSamplerYcbcrConversionInfo
    structure in its pname:pNext chain,
endif::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]
    pname:dataSize must: equal the size of a descriptor of type
    slink:VkDescriptorGetInfoEXT::pname:type determined by the value in
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT
ifdef::VK_EXT_fragment_density_map[]
    , or determined by
    slink:VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT::pname:combinedImageSamplerDensityMapDescriptorSize
    if pname:pDescriptorInfo specifies a
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER whose slink:VkSampler
    was created with ename:VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT set
endif::VK_EXT_fragment_density_map[]
ifdef::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]
  * [[VUID-vkGetDescriptorEXT-descriptorType-09469]]
    If pname:pDescriptorInfo->type is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER and
    pname:pDescriptorInfo->data.pCombinedImageSampler has an pname:imageView
    member that was created with a sname:VkSamplerYcbcrConversionInfo
    structure in its pname:pNext chain, pname:dataSize must: equal the size
    of
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:combinedImageSamplerDescriptorSize
    times
    slink:VkSamplerYcbcrConversionImageFormatProperties::pname:combinedImageSamplerDescriptorCount
endif::VK_VULKAN_1_1,VK_KHR_sampler_ycbcr_conversion[]
  * [[VUID-vkGetDescriptorEXT-pDescriptorInfo-09507]]
    If pname:pDescriptorInfo->type is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER and it has a
    pname:imageView that is dlink:VK_NULL_HANDLE then pname:dataSize must:
    be equal to the size of
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:combinedImageSamplerDescriptorSize
****

include::{generated}/validity/protos/vkGetDescriptorEXT.adoc[]
--

[open,refpage='VkDescriptorGetInfoEXT',desc='Structure specifying parameters of descriptor to get',type='structs']
--
Information about the descriptor to get is passed in a
sname:VkDescriptorGetInfoEXT structure:

include::{generated}/api/structs/VkDescriptorGetInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:type is the type of descriptor to get.
  * pname:data is a structure containing the information needed to get the
    descriptor.

.Valid Usage
****
  * [[VUID-VkDescriptorGetInfoEXT-type-08018]]
    pname:type must: not be ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC,
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC or
    ename:VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK
  * [[VUID-VkDescriptorGetInfoEXT-type-08019]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the
    pname:pCombinedImageSampler->sampler member of pname:data must: be a
    slink:VkSampler created on pname:device
  * [[VUID-VkDescriptorGetInfoEXT-type-08020]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the
    pname:pCombinedImageSampler->imageView member of pname:data must: be a
    slink:VkImageView created on pname:device, or dlink:VK_NULL_HANDLE
  * [[VUID-VkDescriptorGetInfoEXT-type-08021]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT, the
    pname:pInputAttachmentImage->imageView member of pname:data must: be a
    slink:VkImageView created on pname:device
  * [[VUID-VkDescriptorGetInfoEXT-type-08022]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and if
    pname:pSampledImage is not `NULL`, the pname:pSampledImage->imageView
    member of pname:data must: be a slink:VkImageView created on
    pname:device, or dlink:VK_NULL_HANDLE
  * [[VUID-VkDescriptorGetInfoEXT-type-08023]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and if
    pname:pStorageImage is not `NULL`, the pname:pStorageImage->imageView
    member of pname:data must: be a slink:VkImageView created on
    pname:device, or dlink:VK_NULL_HANDLE
  * [[VUID-VkDescriptorGetInfoEXT-type-08024]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,
    pname:pUniformTexelBuffer is not `NULL` and
    pname:pUniformTexelBuffer->address is not zero,
    pname:pUniformTexelBuffer->address must: be an address within a
    slink:VkBuffer created on pname:device
  * [[VUID-VkDescriptorGetInfoEXT-type-08025]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
    pname:pStorageTexelBuffer is not `NULL` and
    pname:pStorageTexelBuffer->address is not zero,
    pname:pStorageTexelBuffer->address must: be an address within a
    slink:VkBuffer created on pname:device
  * [[VUID-VkDescriptorGetInfoEXT-type-08026]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
    pname:pUniformBuffer is not `NULL` and pname:pUniformBuffer->address is
    not zero, pname:pUniformBuffer->address must: be an address within a
    slink:VkBuffer created on pname:device
  * [[VUID-VkDescriptorGetInfoEXT-type-08027]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
    pname:pStorageBuffer is not `NULL` and pname:pStorageBuffer->address is
    not zero, pname:pStorageBuffer->address must: be an address within a
    slink:VkBuffer created on pname:device
  * [[VUID-VkDescriptorGetInfoEXT-type-09427]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,
    pname:pUniformBuffer is not `NULL` , the number of texel buffer elements
    given by [eq]#({lfloor}pname:pUniformBuffer->range / (texel block
    size){rfloor} {times} (texels per block))# where texel block size and
    texels per block are as defined in the <<formats-compatibility,
    Compatible Formats>> table for pname:pUniformBuffer->format, must: be
    less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxTexelBufferElements
  * [[VUID-VkDescriptorGetInfoEXT-type-09428]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,
    pname:pStorageBuffer is not `NULL` , the number of texel buffer elements
    given by [eq]#({lfloor}pname:pStorageBuffer->range / (texel block
    size){rfloor} {times} (texels per block))# where texel block size and
    texels per block are as defined in the <<formats-compatibility,
    Compatible Formats>> table for pname:pStorageBuffer->format, must: be
    less than or equal to
    sname:VkPhysicalDeviceLimits::pname:maxTexelBufferElements
ifdef::VK_KHR_acceleration_structure[]
  * [[VUID-VkDescriptorGetInfoEXT-type-08028]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR and
    pname:accelerationStructure is not `0`, pname:accelerationStructure
    must: contain the address of a slink:VkAccelerationStructureKHR created
    on pname:device
endif::VK_KHR_acceleration_structure[]
ifdef::VK_NV_ray_tracing[]
  * [[VUID-VkDescriptorGetInfoEXT-type-08029]]
    If pname:type is ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV and
    pname:accelerationStructure is not `0`, pname:accelerationStructure
    must: contain the handle of a slink:VkAccelerationStructureNV created on
    pname:device, returned by flink:vkGetAccelerationStructureHandleNV
endif::VK_NV_ray_tracing[]
****

include::{generated}/validity/structs/VkDescriptorGetInfoEXT.adoc[]
--

[open,refpage='VkDescriptorDataEXT',desc='Structure specifying descriptor data',type='structs']
--
Data describing the descriptor is passed in a sname:VkDescriptorDataEXT
structure:

include::{generated}/api/structs/VkDescriptorDataEXT.adoc[]

  * pname:pSampler is a pointer to a slink:VkSampler handle specifying the
    parameters of a ename:VK_DESCRIPTOR_TYPE_SAMPLER descriptor.
  * pname:pCombinedImageSampler is a pointer to a
    slink:VkDescriptorImageInfo structure specifying the parameters of a
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER descriptor.
  * pname:pInputAttachmentImage is a pointer to a
    slink:VkDescriptorImageInfo structure specifying the parameters of a
    ename:VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT descriptor.
  * pname:pSampledImage is a pointer to a slink:VkDescriptorImageInfo
    structure specifying the parameters of a
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE descriptor.
  * pname:pStorageImage is a pointer to a slink:VkDescriptorImageInfo
    structure specifying the parameters of a
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE descriptor.
  * pname:pUniformTexelBuffer is a pointer to a
    slink:VkDescriptorAddressInfoEXT structure specifying the parameters of
    a ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER descriptor.
  * pname:pStorageTexelBuffer is a pointer to a
    slink:VkDescriptorAddressInfoEXT structure specifying the parameters of
    a ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER descriptor.
  * pname:pUniformBuffer is a pointer to a slink:VkDescriptorAddressInfoEXT
    structure specifying the parameters of a
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER descriptor.
  * pname:pStorageBuffer is a pointer to a slink:VkDescriptorAddressInfoEXT
    structure specifying the parameters of a
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER descriptor.
ifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[]
  * pname:accelerationStructure is
ifdef::VK_KHR_acceleration_structure[]
     the address of a slink:VkAccelerationStructureKHR specifying the
     parameters of a ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR
     descriptor
endif::VK_KHR_acceleration_structure[]
ifdef::VK_KHR_acceleration_structure+VK_NV_ray_tracing[, or ]
ifdef::VK_NV_ray_tracing[]
    a slink:VkAccelerationStructureNV handle specifying the parameters of a
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV descriptor.
endif::VK_NV_ray_tracing[]
endif::VK_KHR_acceleration_structure+VK_NV_ray_tracing[]
ifndef::VK_NV_ray_tracing,VK_NV_ray_tracing[]
  * pname:accelerationStructure is reserved for future use and is ignored.
endif::VK_NV_ray_tracing,VK_NV_ray_tracing[]

ifdef::VK_EXT_robustness2[]
If the <<features-nullDescriptor, pname:nullDescriptor>> feature is enabled,
pname:pSampledImage, pname:pStorageImage, pname:pUniformTexelBuffer,
pname:pStorageTexelBuffer, pname:pUniformBuffer, and pname:pStorageBuffer
can: each be `NULL`.
Loads from a null descriptor return zero values and stores and atomics to a
null descriptor are discarded.

ifdef::VK_KHR_acceleration_structure,VK_NV_ray_tracing[]
If the <<features-nullDescriptor, pname:nullDescriptor>> feature is enabled,
pname:accelerationStructure can: be `0`.
A null acceleration structure descriptor results in the miss shader being
invoked.
endif::VK_KHR_acceleration_structure,VK_NV_ray_tracing[]

.Valid Usage
****
  * [[VUID-VkDescriptorDataEXT-type-08030]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, and
    pname:pUniformBuffer->address is the address of a non-sparse buffer,
    then that buffer must: be bound completely and contiguously to a single
    sname:VkDeviceMemory object
  * [[VUID-VkDescriptorDataEXT-type-08031]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, and
    pname:pStorageBuffer->address is the address of a non-sparse buffer,
    then that buffer must: be bound completely and contiguously to a single
    sname:VkDeviceMemory object
  * [[VUID-VkDescriptorDataEXT-type-08032]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, and
    pname:pUniformTexelBuffer->address is the address of a non-sparse
    buffer, then that buffer must: be bound completely and contiguously to a
    single sname:VkDeviceMemory object
  * [[VUID-VkDescriptorDataEXT-type-08033]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, and
    pname:pStorageTexelBuffer->address is the address of a non-sparse
    buffer, then that buffer must: be bound completely and contiguously to a
    single sname:VkDeviceMemory object
ifdef::VK_EXT_robustness2[]
  * [[VUID-VkDescriptorDataEXT-type-08034]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:pCombinedImageSampler->imageView must: not be
    dlink:VK_NULL_HANDLE
  * [[VUID-VkDescriptorDataEXT-type-08035]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:pSampledImage must: not be `NULL` and
    pname:pSampledImage->imageView must: not be dlink:VK_NULL_HANDLE
  * [[VUID-VkDescriptorDataEXT-type-08036]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:pStorageImage must: not be `NULL` and
    pname:pStorageImage->imageView must: not be dlink:VK_NULL_HANDLE
  * [[VUID-VkDescriptorDataEXT-type-08037]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:pUniformTexelBuffer must: not be `NULL`
  * [[VUID-VkDescriptorDataEXT-type-08038]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:pStorageTexelBuffer must: not be `NULL`
  * [[VUID-VkDescriptorDataEXT-type-08039]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:pUniformBuffer must: not be `NULL`
  * [[VUID-VkDescriptorDataEXT-type-08040]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:pStorageBuffer must: not be `NULL`
ifdef::VK_KHR_acceleration_structure[]
  * [[VUID-VkDescriptorDataEXT-type-08041]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:accelerationStructure must: not be `0`
endif::VK_KHR_acceleration_structure[]
ifdef::VK_NV_ray_tracing[]
  * [[VUID-VkDescriptorDataEXT-type-08042]]
    If slink:VkDescriptorGetInfoEXT:pname:type is
    ename:VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV, and the
    <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled, pname:accelerationStructure must: not be `0`
endif::VK_NV_ray_tracing[]
endif::VK_EXT_robustness2[]
****

include::{generated}/validity/structs/VkDescriptorDataEXT.adoc[]

endif::VK_EXT_robustness2[]
--

[open,refpage='VkDescriptorAddressInfoEXT',desc='Structure specifying descriptor buffer address info',type='structs']
--
Data describing a ename:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
ename:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, or
ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER descriptor is passed in a
sname:VkDescriptorAddressInfoEXT structure:

include::{generated}/api/structs/VkDescriptorAddressInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:address is either `0` or a device address at an offset in a
    buffer, where the base address can be queried from
    flink:vkGetBufferDeviceAddress.
  * pname:range is the size in bytes of the buffer or buffer view used by
    the descriptor.
  * pname:format is the format of the data elements in the buffer view and
    is ignored for buffers.

.Valid Usage
****
  * [[VUID-VkDescriptorAddressInfoEXT-None-09508]]
    If
ifdef::VK_EXT_robustness2[]
    pname:address is not zero, and
endif::VK_EXT_robustness2[]
    the descriptor is of type ename:VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER
    or ename:VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, then pname:format
    must: not be ename:VK_FORMAT_UNDEFINED
  * [[VUID-VkDescriptorAddressInfoEXT-address-08043]]
ifdef::VK_EXT_robustness2[]
    If the <<features-nullDescriptor, pname:nullDescriptor>> feature is not
    enabled,
endif::VK_EXT_robustness2[]
    pname:address must: not be zero
ifdef::VK_EXT_robustness2[]
  * [[VUID-VkDescriptorAddressInfoEXT-nullDescriptor-08938]]
    If pname:address is zero, pname:range must: be ename:VK_WHOLE_SIZE
endif::VK_EXT_robustness2[]
  * [[VUID-VkDescriptorAddressInfoEXT-nullDescriptor-08939]]
ifdef::VK_EXT_robustness2[]
    If pname:address is not zero,
endif::VK_EXT_robustness2[]
    pname:range must: not be ename:VK_WHOLE_SIZE
  * [[VUID-VkDescriptorAddressInfoEXT-None-08044]]
    If pname:address is not zero, pname:address must: be a valid device
    address at an offset within a slink:VkBuffer
  * [[VUID-VkDescriptorAddressInfoEXT-range-08045]]
    pname:range must: be less than or equal to the size of the buffer
    containing pname:address minus the offset of pname:address from the base
    address of the buffer
  * [[VUID-VkDescriptorAddressInfoEXT-range-08940]]
    pname:range must: not be zero
****

include::{generated}/validity/structs/VkDescriptorAddressInfoEXT.adoc[]

ifdef::VK_EXT_robustness2[]
If the <<features-nullDescriptor, pname:nullDescriptor>> feature is enabled,
pname:address can: be zero.
Loads from a null descriptor return zero values and stores and atomics to a
null descriptor are discarded.
endif::VK_EXT_robustness2[]
--

Immutable samplers specified in a descriptor set layout through
pname:pImmutableSamplers must: be provided by applications when obtaining
descriptor data.
Immutable samplers written in a descriptor buffer must: have identical
parameters to the immutable samplers in the descriptor set layout that
consumes the sampler.

[NOTE]
.Note
====
If the descriptor set layout was created with
ename:VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT,
there is no buffer backing for the immutable sampler, so this requirement
does not exist.
The implementation handles allocation of these descriptors internally.
====

[NOTE]
.Note
====
As descriptors are now in regular memory, drivers cannot hide copies of
immutable samplers that end up in descriptor sets from the application.
As such, applications are required to provide these samplers as if they were
not provided immutably.
====


[[descriptorbuffers-binding]]
=== Binding Descriptor Buffers

Descriptor buffers have their own separate binding point on the command
buffer, with buffers bound using flink:vkCmdBindDescriptorBuffersEXT.
flink:vkCmdSetDescriptorBufferOffsetsEXT assigns pairs of buffer binding
indices and buffer offsets to the same binding point on the command buffer
as flink:vkCmdBindDescriptorSets, allowing subsequent
<<pipelines-bindpoint-commands, bound pipeline commands>> to use the
specified descriptor buffers.
Bindings applied via flink:vkCmdBindDescriptorSets cannot: exist
simultaneously with those applied via calls to
flink:vkCmdSetDescriptorBufferOffsetsEXT or
flink:vkCmdBindDescriptorBufferEmbeddedSamplersEXT, as calls to
flink:vkCmdSetDescriptorBufferOffsetsEXT or
flink:vkCmdBindDescriptorBufferEmbeddedSamplersEXT invalidate any bindings
by previous calls to flink:vkCmdBindDescriptorSets and vice-versa.

[open,refpage='vkCmdBindDescriptorBuffersEXT',desc='Binding descriptor buffers to a command buffer',type='protos']
--
To bind descriptor buffers to a command buffer, call:

include::{generated}/api/protos/vkCmdBindDescriptorBuffersEXT.adoc[]

  * pname:commandBuffer is the command buffer that the descriptor buffers
    will be bound to.
  * pname:bufferCount is the number of elements in the pname:pBindingInfos
    array.
  * pname:pBindingInfos is a pointer to an array of
    slink:VkDescriptorBufferBindingInfoEXT structures.

`vkCmdBindDescriptorBuffersEXT` causes any offsets previously set by
flink:vkCmdSetDescriptorBufferOffsetsEXT that use the bindings numbered
[`0`..
pname:bufferCount-1] to be no longer valid for subsequent bound pipeline
commands.
Any previously bound buffers at binding points greater than or equal to
pname:bufferCount are unbound.

.Valid Usage
****
  * [[VUID-vkCmdBindDescriptorBuffersEXT-None-08047]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkCmdBindDescriptorBuffersEXT-maxSamplerDescriptorBufferBindings-08048]]
    There must: be no more than
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:maxSamplerDescriptorBufferBindings
    descriptor buffers containing sampler descriptor data bound
  * [[VUID-vkCmdBindDescriptorBuffersEXT-maxResourceDescriptorBufferBindings-08049]]
    There must: be no more than
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:maxResourceDescriptorBufferBindings
    descriptor buffers containing resource descriptor data bound
  * [[VUID-vkCmdBindDescriptorBuffersEXT-None-08050]]
    There must: be no more than `1` descriptor buffer bound that was created
    with the
    ename:VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT bit set
  * [[VUID-vkCmdBindDescriptorBuffersEXT-bufferCount-08051]]
    pname:bufferCount must: be less than or equal to
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:maxDescriptorBufferBindings
  * [[VUID-vkCmdBindDescriptorBuffersEXT-pBindingInfos-08052]]
    For any element of pname:pBindingInfos, if the buffer from which
    pname:address was queried is non-sparse then it must: be bound
    completely and contiguously to a single slink:VkDeviceMemory object
  * [[VUID-vkCmdBindDescriptorBuffersEXT-pBindingInfos-08053]]
    For any element of pname:pBindingInfos, the buffer from which
    pname:address was queried must: have been created with the
    ename:VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT bit set if it
    contains sampler descriptor data
  * [[VUID-vkCmdBindDescriptorBuffersEXT-pBindingInfos-08054]]
    For any element of pname:pBindingInfos, the buffer from which
    pname:address was queried must: have been created with the
    ename:VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT bit set if it
    contains resource descriptor data
  * [[VUID-vkCmdBindDescriptorBuffersEXT-pBindingInfos-08055]]
    For any element of pname:pBindingInfos, pname:usage must: match the
    buffer from which pname:address was queried
****

include::{generated}/validity/protos/vkCmdBindDescriptorBuffersEXT.adoc[]
--

[open,refpage='VkDescriptorBufferBindingInfoEXT',desc='Structure specifying descriptor buffer binding information',type='structs']
--
:refpage: VkDescriptorBufferBindingInfoEXT

Data describing a descriptor buffer binding is passed in a
sname:VkDescriptorBufferBindingInfoEXT structure:

include::{generated}/api/structs/VkDescriptorBufferBindingInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:address is a basetype:VkDeviceAddress specifying the device
    address defining the descriptor buffer to be bound.
  * pname:usage is a bitmask of elink:VkBufferUsageFlagBits specifying the
    slink:VkBufferCreateInfo::pname:usage for the buffer from which
    pname:address was queried.

ifdef::VK_KHR_maintenance5[]
If a slink:VkBufferUsageFlags2CreateInfoKHR structure is present in the
pname:pNext chain, slink:VkBufferUsageFlags2CreateInfoKHR::pname:usage from
that structure is used instead of pname:usage from this structure.
endif::VK_KHR_maintenance5[]

.Valid Usage
****
include::{chapters}/commonvalidity/buffer_usage_flags_common.adoc[]
  * [[VUID-VkDescriptorBufferBindingInfoEXT-bufferlessPushDescriptors-08056]]
    If <<limits-bufferlessPushDescriptors,
    sname:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:bufferlessPushDescriptors>>
    is ename:VK_FALSE, and pname:usage contains
    ename:VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT, then
    the pname:pNext chain must: include a
    slink:VkDescriptorBufferBindingPushDescriptorBufferHandleEXT structure
  * [[VUID-VkDescriptorBufferBindingInfoEXT-address-08057]]
    pname:address must: be aligned to
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:descriptorBufferOffsetAlignment
  * [[VUID-VkDescriptorBufferBindingInfoEXT-usage-08122]]
    If pname:usage includes
    ename:VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT, pname:address
    must: be an address within a valid buffer that was created with
    ename:VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT
  * [[VUID-VkDescriptorBufferBindingInfoEXT-usage-08123]]
    If pname:usage includes
    ename:VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT, pname:address
    must: be an address within a valid buffer that was created with
    ename:VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT
ifdef::VK_KHR_push_descriptor[]
  * [[VUID-VkDescriptorBufferBindingInfoEXT-usage-08124]]
    If pname:usage includes
    ename:VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT,
    pname:address must: be an address within a valid buffer that was created
    with ename:VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT
endif::VK_KHR_push_descriptor[]
****

include::{generated}/validity/structs/VkDescriptorBufferBindingInfoEXT.adoc[]
--

[open,refpage='VkDescriptorBufferBindingPushDescriptorBufferHandleEXT',desc='Structure specifying push descriptor buffer binding information',type='structs']
--
When the <<limits-bufferlessPushDescriptors,
sname:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:bufferlessPushDescriptors>>
property is ename:VK_FALSE, the sname:VkBuffer handle of the buffer for push
descriptors is passed in a
sname:VkDescriptorBufferBindingPushDescriptorBufferHandleEXT structure:

include::{generated}/api/structs/VkDescriptorBufferBindingPushDescriptorBufferHandleEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:buffer is the sname:VkBuffer handle of the buffer for push
    descriptors.

.Valid Usage
****
  * [[VUID-VkDescriptorBufferBindingPushDescriptorBufferHandleEXT-bufferlessPushDescriptors-08059]]
    <<limits-bufferlessPushDescriptors,
    sname:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:bufferlessPushDescriptors>>
    must: be ename:VK_FALSE
****

include::{generated}/validity/structs/VkDescriptorBufferBindingPushDescriptorBufferHandleEXT.adoc[]
--

[open,refpage='vkCmdSetDescriptorBufferOffsetsEXT',desc='Setting descriptor buffer offsets in a command buffer',type='protos']
--
:refpage: vkCmdSetDescriptorBufferOffsetsEXT

To set descriptor buffer offsets in a command buffer, call:

include::{generated}/api/protos/vkCmdSetDescriptorBufferOffsetsEXT.adoc[]

  * pname:commandBuffer is the command buffer in which the descriptor buffer
    offsets will be set.
  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the
    type of the pipeline that will use the descriptors.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
  * pname:firstSet is the number of the first set to be bound.
  * pname:setCount is the number of elements in the pname:pBufferIndices and
    pname:pOffsets arrays.
  * pname:pBufferIndices is a pointer to an array of indices into the
    descriptor buffer binding points set by
    flink:vkCmdBindDescriptorBuffersEXT.
  * pname:pOffsets is a pointer to an array of basetype:VkDeviceSize offsets
    to apply to the bound descriptor buffers.

fname:vkCmdSetDescriptorBufferOffsetsEXT binds pname:setCount pairs of
descriptor buffers, specified by indices into the binding points bound using
flink:vkCmdBindDescriptorBuffersEXT, and buffer offsets to set numbers
[pname:firstSet..pname:firstSet+pname:descriptorSetCount-1] for subsequent
<<pipelines-bindpoint-commands, bound pipeline commands>> set by
pname:pipelineBindPoint.
Set [pname:firstSet + i] is bound to the descriptor buffer at binding
pname:pBufferIndices[i] at an offset of pname:pOffsets[i].
Any bindings that were previously applied via these sets, or calls to
flink:vkCmdBindDescriptorSets, are no longer valid.
Other sets will also be invalidated upon calling this command if
pname:layout differs from the pipeline layout used to bind those other sets,
as described in <<descriptorsets-compatibility,Pipeline Layout
Compatibility>>.

After binding descriptors, applications can: modify descriptor memory either
by performing writes on the host or with device commands.
When descriptor memory is updated with device commands, visibility for the
shader stage accessing a descriptor is ensured with the
ename:VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT access flag.
Implementations must: not access resources referenced by these descriptors
unless they are dynamically accessed by shaders.
Descriptors bound with this call can: be undefined: if they are not
dynamically accessed by shaders.

Implementations may: read descriptor data for any statically accessed
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
descriptor if the pname:binding in pname:layout is not declared with the
ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT flag.
If the pname:binding in pname:layout is declared with
ename:VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT, implementations
must: not read descriptor data that is not dynamically accessed.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifndef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
descriptor.
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

Applications must: ensure that any descriptor which the implementation may:
read must: be in-bounds of the underlying descriptor buffer binding.

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
[NOTE]
.Note
====
Applications can freely decide how large a variable descriptor buffer
binding is, so it may not be safe to read such descriptor payloads
statically.
The intention of these rules is to allow implementations to speculatively
prefetch descriptor payloads where feasible.
====
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

Dynamically accessing a resource through descriptor data from an unbound
region of a <<sparsememory-partially-resident-buffers, sparse
partially-resident buffer>> will result in invalid descriptor data being
read, and therefore undefined: behavior.

[NOTE]
.Note
====
For descriptors written by the host, visibility is implied through the
automatic visibility operation on queue submit, and there is no need to
consider etext:VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT.
Explicit synchronization for descriptors is only required when descriptors
are updated on the device.
====

ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
[NOTE]
.Note
====
The requirements above imply that all descriptor bindings have been defined
with the equivalent of ename:VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT,
ename:VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT and
ename:VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT, but enabling those features
is not required to get this behavior.
====
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]

.Valid Usage
****
include::{chapters}/commonvalidity/set_descriptor_buffer_offsets_common.adoc[]
  * [[VUID-vkCmdSetDescriptorBufferOffsetsEXT-None-08060]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkCmdSetDescriptorBufferOffsetsEXT-pipelineBindPoint-08067]]
    pname:pipelineBindPoint must: be supported by the pname:commandBuffer's
    parent sname:VkCommandPool's queue family
****

include::{generated}/validity/protos/vkCmdSetDescriptorBufferOffsetsEXT.adoc[]
--

ifdef::VK_KHR_maintenance6[]
[open,refpage='vkCmdSetDescriptorBufferOffsets2EXT',desc='Setting descriptor buffer offsets in a command buffer',type='protos']
--
Alternatively, to set descriptor buffer offsets in a command buffer, call:

include::{generated}/api/protos/vkCmdSetDescriptorBufferOffsets2EXT.adoc[]

  * pname:commandBuffer is the command buffer in which the descriptor buffer
    offsets will be set.
  * pname:pSetDescriptorBufferOffsetsInfo is a pointer to a
    sname:VkSetDescriptorBufferOffsetsInfoEXT structure.

.Valid Usage
****
  * [[VUID-vkCmdSetDescriptorBufferOffsets2EXT-descriptorBuffer-09470]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkCmdSetDescriptorBufferOffsets2EXT-pSetDescriptorBufferOffsetsInfo-09471]]
    Each bit in pname:pSetDescriptorBufferOffsetsInfo->stageFlags must: be a
    stage supported by the pname:commandBuffer's parent
    sname:VkCommandPool's queue family
****

include::{generated}/validity/protos/vkCmdSetDescriptorBufferOffsets2EXT.adoc[]
--

[open,refpage='VkSetDescriptorBufferOffsetsInfoEXT',desc='Structure specifying descriptor buffer offsets to set in a command buffer',type='structs']
--
:refpage: VkSetDescriptorBufferOffsetsInfoEXT

The sname:VkSetDescriptorBufferOffsetsInfoEXT structure is defined as:

include::{generated}/api/structs/VkSetDescriptorBufferOffsetsInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:stageFlags is a bitmask of elink:VkShaderStageFlagBits specifying
    the shader stages the descriptor sets will be bound to
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
ifdef::VK_NV_per_stage_descriptor_set[]
    If the <<features-dynamicPipelineLayout, pname:dynamicPipelineLayout>>
    feature is enabled, pname:layout can: be dlink:VK_NULL_HANDLE and the
    layout must: be specified by chaining slink:VkPipelineLayoutCreateInfo
    structure off the pname:pNext
endif::VK_NV_per_stage_descriptor_set[]
  * pname:firstSet is the number of the first set to be bound.
  * pname:setCount is the number of elements in the pname:pBufferIndices and
    pname:pOffsets arrays.
  * pname:pBufferIndices is a pointer to an array of indices into the
    descriptor buffer binding points set by
    flink:vkCmdBindDescriptorBuffersEXT.
  * pname:pOffsets is a pointer to an array of basetype:VkDeviceSize offsets
    to apply to the bound descriptor buffers.

If pname:stageFlags specifies a subset of all stages corresponding to one or
more pipeline bind points, the binding operation still affects all stages
corresponding to the given pipeline bind point(s) as if the equivalent
original version of this command had been called with the same parameters.
For example, specifying a pname:stageFlags value of
ename:VK_SHADER_STAGE_VERTEX_BIT | ename:VK_SHADER_STAGE_FRAGMENT_BIT |
ename:VK_SHADER_STAGE_COMPUTE_BIT is equivalent to calling the original
version of this command once with ename:VK_PIPELINE_BIND_POINT_GRAPHICS and
once with ename:VK_PIPELINE_BIND_POINT_COMPUTE.

.Valid Usage
****
include::{chapters}/commonvalidity/set_descriptor_buffer_offsets_common.adoc[]
include::{chapters}/commonvalidity/dynamic_pipeline_layout_common.adoc[]
****

include::{generated}/validity/structs/VkSetDescriptorBufferOffsetsInfoEXT.adoc[]
--
endif::VK_KHR_maintenance6[]

[open,refpage='vkCmdBindDescriptorBufferEmbeddedSamplersEXT',desc='Setting embedded immutable samplers offsets in a command buffer',type='protos']
--
:refpage: vkCmdBindDescriptorBufferEmbeddedSamplersEXT

To bind an embedded immutable sampler set to a command buffer, call:

include::{generated}/api/protos/vkCmdBindDescriptorBufferEmbeddedSamplersEXT.adoc[]

  * pname:commandBuffer is the command buffer that the embedded immutable
    samplers will be bound to.
  * pname:pipelineBindPoint is a elink:VkPipelineBindPoint indicating the
    type of the pipeline that will use the embedded immutable samplers.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
  * pname:set is the number of the set to be bound.

`vkCmdBindDescriptorBufferEmbeddedSamplersEXT` binds the embedded immutable
samplers in pname:set of pname:layout to pname:set for the command buffer
for subsequent <<pipelines-bindpoint-commands, bound pipeline commands>> set
by pname:pipelineBindPoint.
Any previous binding to this set by flink:vkCmdSetDescriptorBufferOffsetsEXT
or this command is overwritten.
Any sets that were last bound by a call to flink:vkCmdBindDescriptorSets are
invalidated upon calling this command.
Other sets will also be invalidated upon calling this command if
pname:layout differs from the pipeline layout used to bind those other sets,
as described in <<descriptorsets-compatibility,Pipeline Layout
Compatibility>>.

.Valid Usage
****
include::{chapters}/commonvalidity/bind_descriptor_buffer_embedded_samplers_common.adoc[]
  * [[VUID-vkCmdBindDescriptorBufferEmbeddedSamplersEXT-None-08068]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkCmdBindDescriptorBufferEmbeddedSamplersEXT-pipelineBindPoint-08069]]
    pname:pipelineBindPoint must: be supported by the pname:commandBuffer's
    parent sname:VkCommandPool's queue family
****

include::{generated}/validity/protos/vkCmdBindDescriptorBufferEmbeddedSamplersEXT.adoc[]
--

ifdef::VK_KHR_maintenance6[]
[open,refpage='vkCmdBindDescriptorBufferEmbeddedSamplers2EXT',desc='Setting embedded immutable samplers offsets in a command buffer',type='protos']
--
Alternatively, to bind an embedded immutable sampler set to a command
buffer, call:

include::{generated}/api/protos/vkCmdBindDescriptorBufferEmbeddedSamplers2EXT.adoc[]

  * pname:commandBuffer is the command buffer that the embedded immutable
    samplers will be bound to.
  * pname:pBindDescriptorBufferEmbeddedSamplersInfo is a pointer to a
    sname:VkBindDescriptorBufferEmbeddedSamplersInfoEXT structure.

.Valid Usage
****
  * [[VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-descriptorBuffer-09472]]
    The <<features-descriptorBuffer, pname:descriptorBuffer>> feature must:
    be enabled
  * [[VUID-vkCmdBindDescriptorBufferEmbeddedSamplers2EXT-pBindDescriptorBufferEmbeddedSamplersInfo-09473]]
    Each bit in pname:pBindDescriptorBufferEmbeddedSamplersInfo->stageFlags
    must: be a stage supported by the pname:commandBuffer's parent
    sname:VkCommandPool's queue family
****

include::{generated}/validity/protos/vkCmdBindDescriptorBufferEmbeddedSamplers2EXT.adoc[]
--

[open,refpage='VkBindDescriptorBufferEmbeddedSamplersInfoEXT',desc='Structure specifying embedded immutable sampler offsets to set in a command buffer',type='structs']
--
:refpage: VkBindDescriptorBufferEmbeddedSamplersInfoEXT

The sname:VkBindDescriptorBufferEmbeddedSamplersInfoEXT structure is defined
as:

include::{generated}/api/structs/VkBindDescriptorBufferEmbeddedSamplersInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:stageFlags is a bitmask of elink:VkShaderStageFlagBits specifying
    the shader stages that will use the embedded immutable samplers.
  * pname:layout is a slink:VkPipelineLayout object used to program the
    bindings.
ifdef::VK_NV_per_stage_descriptor_set[]
    If the <<features-dynamicPipelineLayout, pname:dynamicPipelineLayout>>
    feature is enabled, pname:layout can: be dlink:VK_NULL_HANDLE and the
    layout must: be specified by chaining slink:VkPipelineLayoutCreateInfo
    structure off the pname:pNext
endif::VK_NV_per_stage_descriptor_set[]
  * pname:set is the number of the set to be bound.

If pname:stageFlags specifies a subset of all stages corresponding to one or
more pipeline bind points, the binding operation still affects all stages
corresponding to the given pipeline bind point(s) as if the equivalent
original version of this command had been called with the same parameters.
For example, specifying a pname:stageFlags value of
ename:VK_SHADER_STAGE_VERTEX_BIT | ename:VK_SHADER_STAGE_FRAGMENT_BIT |
ename:VK_SHADER_STAGE_COMPUTE_BIT is equivalent to calling the original
version of this command once with ename:VK_PIPELINE_BIND_POINT_GRAPHICS and
once with ename:VK_PIPELINE_BIND_POINT_COMPUTE.

.Valid Usage
****
include::{chapters}/commonvalidity/bind_descriptor_buffer_embedded_samplers_common.adoc[]
include::{chapters}/commonvalidity/dynamic_pipeline_layout_common.adoc[]
****

include::{generated}/validity/structs/VkBindDescriptorBufferEmbeddedSamplersInfoEXT.adoc[]
--
endif::VK_KHR_maintenance6[]


[[descriptorbuffers-updates]]
=== Updating Descriptor Buffers

Updates to descriptor data in buffers can: be performed by any operation on
either the host or device that can: access memory.

Descriptor buffer reads can: be synchronized using
ename:VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT in the relevant shader
stage.


[[descriptorbuffers-push-descriptors]]
=== Push Descriptors With Descriptor Buffers

If the <<features-descriptorBufferPushDescriptors,
pname:descriptorBufferPushDescriptors>> feature is enabled, push descriptors
can: be used with descriptor buffers in the same way as with descriptor
sets.

The <<limits-bufferlessPushDescriptors,
sname:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:bufferlessPushDescriptors>>
property indicates whether the implementation requires a buffer to back push
descriptors.
If the property is ename:VK_FALSE then before recording any push descriptors
the application must: bind exactly `1` descriptor buffer that was created
with the ename:VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT
bit set.
When this buffer is bound any previously recorded push descriptors that are
required for a subsequent command must: be recorded again.


[[descriptorbuffers-capturereplay]]
=== Capture and Replay

In a similar way to <<features-bufferDeviceAddressCaptureReplay,
pname:bufferDeviceAddressCaptureReplay>>, the
<<features-descriptorBufferCaptureReplay,
pname:descriptorBufferCaptureReplay>> feature allows the creation of opaque
handles for objects at capture time that can: be passed into object creation
calls in a future replay, causing descriptors to be created with the same
data.
The opaque memory address for any memory used by these resources must: have
been captured using flink:vkGetDeviceMemoryOpaqueCaptureAddress and be
replayed using slink:VkMemoryOpaqueCaptureAddressAllocateInfo.

[open,refpage='vkGetBufferOpaqueCaptureDescriptorDataEXT',desc='Get buffer opaque capture descriptor data',type='protos']
--
To get the opaque descriptor data for a buffer, call:

include::{generated}/api/protos/vkGetBufferOpaqueCaptureDescriptorDataEXT.adoc[]

  * pname:device is the logical device that gets the data.
  * pname:pInfo is a pointer to a slink:VkBufferCaptureDescriptorDataInfoEXT
    structure specifying the buffer.
  * pname:pData is a pointer to a user-allocated buffer where the data will
    be written.

.Valid Usage
****
  * [[VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-None-08072]]
    The <<features-descriptorBuffer, pname:descriptorBufferCaptureReplay>>
    feature must: be enabled
  * [[VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-pData-08073]]
    pname:pData must: point to a buffer that is at least
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:bufferCaptureReplayDescriptorDataSize
    bytes in size
  * [[VUID-vkGetBufferOpaqueCaptureDescriptorDataEXT-device-08074]]
    If pname:device was created with multiple physical devices, then the
    <<features-bufferDeviceAddressMultiDevice,
    pname:bufferDeviceAddressMultiDevice>> feature must: be enabled
****

include::{generated}/validity/protos/vkGetBufferOpaqueCaptureDescriptorDataEXT.adoc[]
--

[open,refpage='VkBufferCaptureDescriptorDataInfoEXT',desc='Structure specifying a buffer for descriptor capture',type='structs']
--
Information about the buffer to get descriptor buffer capture data for is
passed in a sname:VkBufferCaptureDescriptorDataInfoEXT structure:

include::{generated}/api/structs/VkBufferCaptureDescriptorDataInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:buffer is the sname:VkBuffer handle of the buffer to get opaque
    capture data for.

.Valid Usage
****
  * [[VUID-VkBufferCaptureDescriptorDataInfoEXT-buffer-08075]]
    pname:buffer must: have been created with
    ename:VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT set in
    slink:VkBufferCreateInfo::pname:flags
****

include::{generated}/validity/structs/VkBufferCaptureDescriptorDataInfoEXT.adoc[]
--


[open,refpage='vkGetImageOpaqueCaptureDescriptorDataEXT',desc='Get image opaque capture descriptor data',type='protos']
--
To get the opaque capture descriptor data for an image, call:

include::{generated}/api/protos/vkGetImageOpaqueCaptureDescriptorDataEXT.adoc[]

  * pname:device is the logical device that gets the data.
  * pname:pInfo is a pointer to a slink:VkImageCaptureDescriptorDataInfoEXT
    structure specifying the image.
  * pname:pData is a pointer to a user-allocated buffer where the data will
    be written.

.Valid Usage
****
  * [[VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-None-08076]]
    The <<features-descriptorBuffer, pname:descriptorBufferCaptureReplay>>
    feature must: be enabled
  * [[VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-pData-08077]]
    pname:pData must: point to a buffer that is at least
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:imageCaptureReplayDescriptorDataSize
    bytes in size
  * [[VUID-vkGetImageOpaqueCaptureDescriptorDataEXT-device-08078]]
    If pname:device was created with multiple physical devices, then the
    <<features-bufferDeviceAddressMultiDevice,
    pname:bufferDeviceAddressMultiDevice>> feature must: be enabled
****

include::{generated}/validity/protos/vkGetImageOpaqueCaptureDescriptorDataEXT.adoc[]
--

[open,refpage='VkImageCaptureDescriptorDataInfoEXT',desc='Structure specifying an image for descriptor capture',type='structs']
--
Information about the image to get descriptor buffer capture data for is
passed in a sname:VkImageCaptureDescriptorDataInfoEXT structure:

include::{generated}/api/structs/VkImageCaptureDescriptorDataInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:image is the sname:VkImage handle of the image to get opaque
    capture data for.

.Valid Usage
****
  * [[VUID-VkImageCaptureDescriptorDataInfoEXT-image-08079]]
    pname:image must: have been created with
    ename:VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT set in
    slink:VkImageCreateInfo::pname:flags
****

include::{generated}/validity/structs/VkImageCaptureDescriptorDataInfoEXT.adoc[]
--

[open,refpage='vkGetImageViewOpaqueCaptureDescriptorDataEXT',desc='Get image view opaque capture descriptor data',type='protos']
--
To get the opaque capture descriptor data for an image view, call:

include::{generated}/api/protos/vkGetImageViewOpaqueCaptureDescriptorDataEXT.adoc[]

  * pname:device is the logical device that gets the data.
  * pname:pInfo is a pointer to a
    slink:VkImageViewCaptureDescriptorDataInfoEXT structure specifying the
    image view.
  * pname:pData is a pointer to a user-allocated buffer where the data will
    be written.

.Valid Usage
****
  * [[VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-None-08080]]
    The <<features-descriptorBuffer, pname:descriptorBufferCaptureReplay>>
    feature must: be enabled
  * [[VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-pData-08081]]
    pname:pData must: point to a buffer that is at least
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:imageViewCaptureReplayDescriptorDataSize
    bytes in size
  * [[VUID-vkGetImageViewOpaqueCaptureDescriptorDataEXT-device-08082]]
    If pname:device was created with multiple physical devices, then the
    <<features-bufferDeviceAddressMultiDevice,
    pname:bufferDeviceAddressMultiDevice>> feature must: be enabled
****

include::{generated}/validity/protos/vkGetImageViewOpaqueCaptureDescriptorDataEXT.adoc[]
--

[open,refpage='VkImageViewCaptureDescriptorDataInfoEXT',desc='Structure specifying an image view for descriptor capture',type='structs']
--
Information about the image view to get descriptor buffer capture data for
is passed in a sname:VkImageViewCaptureDescriptorDataInfoEXT structure:

include::{generated}/api/structs/VkImageViewCaptureDescriptorDataInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:imageView is the sname:VkImageView handle of the image view to get
    opaque capture data for.

.Valid Usage
****
  * [[VUID-VkImageViewCaptureDescriptorDataInfoEXT-imageView-08083]]
    pname:imageView must: have been created with
    ename:VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT set
    in slink:VkImageViewCreateInfo::pname:flags
****

include::{generated}/validity/structs/VkImageViewCaptureDescriptorDataInfoEXT.adoc[]
--

[open,refpage='vkGetSamplerOpaqueCaptureDescriptorDataEXT',desc='Get sampler opaque capture descriptor data',type='protos']
--
To get the opaque capture descriptor data for a sampler, call:

include::{generated}/api/protos/vkGetSamplerOpaqueCaptureDescriptorDataEXT.adoc[]

  * pname:device is the logical device that gets the data.
  * pname:pInfo is a pointer to a
    slink:VkSamplerCaptureDescriptorDataInfoEXT structure specifying the
    sampler.
  * pname:pData is a pointer to a user-allocated buffer where the data will
    be written.

.Valid Usage
****
  * [[VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-None-08084]]
    The <<features-descriptorBuffer, pname:descriptorBufferCaptureReplay>>
    feature must: be enabled
  * [[VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-pData-08085]]
    pname:pData must: point to a buffer that is at least
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:samplerCaptureReplayDescriptorDataSize
    bytes in size
  * [[VUID-vkGetSamplerOpaqueCaptureDescriptorDataEXT-device-08086]]
    If pname:device was created with multiple physical devices, then the
    <<features-bufferDeviceAddressMultiDevice,
    pname:bufferDeviceAddressMultiDevice>> feature must: be enabled
****

include::{generated}/validity/protos/vkGetSamplerOpaqueCaptureDescriptorDataEXT.adoc[]
--

[open,refpage='VkSamplerCaptureDescriptorDataInfoEXT',desc='Structure specifying a sampler for descriptor capture',type='structs']
--
Information about the sampler to get descriptor buffer capture data for is
passed in a sname:VkSamplerCaptureDescriptorDataInfoEXT structure:

include::{generated}/api/structs/VkSamplerCaptureDescriptorDataInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:sampler is the sname:VkSampler handle of the sampler to get opaque
    capture data for.

.Valid Usage
****
  * [[VUID-VkSamplerCaptureDescriptorDataInfoEXT-sampler-08087]]
    pname:sampler must: have been created with
    ename:VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT set in
    slink:VkSamplerCreateInfo::pname:flags
****

include::{generated}/validity/structs/VkSamplerCaptureDescriptorDataInfoEXT.adoc[]
--

ifdef::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]
[open,refpage='vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT',desc='Get acceleration structure opaque capture descriptor data',type='protos']
--
To get the opaque capture descriptor data for an acceleration structure,
call:

include::{generated}/api/protos/vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT.adoc[]

  * pname:device is the logical device that gets the data.
  * pname:pInfo is a pointer to a
    slink:VkAccelerationStructureCaptureDescriptorDataInfoEXT structure
    specifying the acceleration structure.
  * pname:pData is a pointer to a user-allocated buffer where the data will
    be written.

.Valid Usage
****
  * [[VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-None-08088]]
    The <<features-descriptorBuffer, pname:descriptorBufferCaptureReplay>>
    feature must: be enabled
  * [[VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-pData-08089]]
    pname:pData must: point to a buffer that is at least
    slink:VkPhysicalDeviceDescriptorBufferPropertiesEXT::pname:accelerationStructureCaptureReplayDescriptorDataSize
    bytes in size
  * [[VUID-vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT-device-08090]]
    If pname:device was created with multiple physical devices, then the
    <<features-bufferDeviceAddressMultiDevice,
    pname:bufferDeviceAddressMultiDevice>> feature must: be enabled
****

include::{generated}/validity/protos/vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT.adoc[]
--

[open,refpage='VkAccelerationStructureCaptureDescriptorDataInfoEXT',desc='Structure specifying an acceleration structure for descriptor capture',type='structs']
--
Information about the acceleration structure to get descriptor buffer
capture data for is passed in a
sname:VkAccelerationStructureCaptureDescriptorDataInfoEXT structure:

include::{generated}/api/structs/VkAccelerationStructureCaptureDescriptorDataInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:accelerationStructure is the sname:VkAccelerationStructureKHR
    handle of the acceleration structure to get opaque capture data for.
  * pname:accelerationStructureNV is the sname:VkAccelerationStructureNV
    handle of the acceleration structure to get opaque capture data for.

.Valid Usage
****
  * [[VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-accelerationStructure-08091]]
    If pname:accelerationStructure is not dlink:VK_NULL_HANDLE then
    pname:accelerationStructure must: have been created with
    ename:VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT
    set in slink:VkAccelerationStructureCreateInfoKHR::pname:createFlags
  * [[VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-accelerationStructureNV-08092]]
    If pname:accelerationStructureNV is not dlink:VK_NULL_HANDLE then
    pname:accelerationStructureNV must: have been created with
    ename:VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT
    set in slink:VkAccelerationStructureCreateInfoNV::pname:info.flags
  * [[VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-accelerationStructure-08093]]
    If pname:accelerationStructure is not dlink:VK_NULL_HANDLE then
    pname:accelerationStructureNV must: be dlink:VK_NULL_HANDLE
  * [[VUID-VkAccelerationStructureCaptureDescriptorDataInfoEXT-accelerationStructureNV-08094]]
    If pname:accelerationStructureNV is not dlink:VK_NULL_HANDLE then
    pname:accelerationStructure must: be dlink:VK_NULL_HANDLE
****

include::{generated}/validity/structs/VkAccelerationStructureCaptureDescriptorDataInfoEXT.adoc[]
--
endif::VK_NV_ray_tracing,VK_KHR_acceleration_structure[]

[open,refpage='VkOpaqueCaptureDescriptorDataCreateInfoEXT',desc='Structure specifying opaque capture descriptor data',type='structs']
--
The sname:VkOpaqueCaptureDescriptorDataCreateInfoEXT structure is defined
as:

include::{generated}/api/structs/VkOpaqueCaptureDescriptorDataCreateInfoEXT.adoc[]

  * pname:sType is a elink:VkStructureType value identifying this structure.
  * pname:pNext is `NULL` or a pointer to a structure extending this
    structure.
  * pname:opaqueCaptureDescriptorData is a pointer to a user-allocated
    buffer containing opaque capture data retrieved using
    flink:vkGetBufferOpaqueCaptureDescriptorDataEXT,
    flink:vkGetImageOpaqueCaptureDescriptorDataEXT,
    flink:vkGetImageViewOpaqueCaptureDescriptorDataEXT,
    flink:vkGetSamplerOpaqueCaptureDescriptorDataEXT, or
    flink:vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT.

During replay, opaque descriptor capture data can: be specified by adding a
sname:VkOpaqueCaptureDescriptorDataCreateInfoEXT structure to the relevant
pname:pNext chain of a slink:VkBufferCreateInfo, slink:VkImageCreateInfo,
slink:VkImageViewCreateInfo, slink:VkSamplerCreateInfo,
slink:VkAccelerationStructureCreateInfoNV or
slink:VkAccelerationStructureCreateInfoKHR structure.


include::{generated}/validity/structs/VkOpaqueCaptureDescriptorDataCreateInfoEXT.adoc[]
--

endif::VK_EXT_descriptor_buffer[]