summaryrefslogtreecommitdiff
path: root/appendices/spirvenv.adoc
blob: 21d46da3d58e3c9f084d6ad1a733cf14fef0d843 (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
// Copyright 2015-2023 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

[appendix]
[[spirvenv]]
= Vulkan Environment for SPIR-V

Shaders for Vulkan are defined by the <<spirv-spec,Khronos SPIR-V
Specification>> as well as the <<spirv-extended,Khronos SPIR-V Extended
Instructions for GLSL>> Specification.
This appendix defines additional SPIR-V requirements applying to Vulkan
shaders.

== Versions and Formats

// The fallthrough logic here defines {spirv-versions} according to the
// highest Vulkan version supported, and simplifies the markup.

ifdef::VK_VERSION_1_0[]
:spirv-versions: 1.0 version
:api-version: 1.0
endif::VK_VERSION_1_0[]
ifdef::VK_VERSION_1_1[]
:spirv-versions: 1.0, 1.1, 1.2, and 1.3 versions
:api-version: 1.1
endif::VK_VERSION_1_1[]
ifdef::VK_VERSION_1_2[]
:spirv-versions: 1.0, 1.1, 1.2, 1.3, 1.4, and 1.5 versions
:api-version: 1.2
endif::VK_VERSION_1_2[]
ifdef::VK_VERSION_1_3[]
:spirv-versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, and 1.6 versions
:api-version: 1.3
endif::VK_VERSION_1_3[]

A Vulkan {api-version} implementation must: support the {spirv-versions} of
SPIR-V and the 1.0 version of the SPIR-V Extended Instructions for GLSL.
ifndef::VK_VERSION_1_2[]
ifdef::VK_KHR_spirv_1_4[]
If the `apiext:VK_KHR_spirv_1_4` extension is enabled, the implementation
must: additionally support the 1.4 version of SPIR-V.
endif::VK_KHR_spirv_1_4[]
endif::VK_VERSION_1_2[]

A SPIR-V module
ifndef::VKSC_VERSION_1_0[]
passed into flink:vkCreateShaderModule
endif::VKSC_VERSION_1_0[]
is interpreted as a series of 32-bit words in host endianness, with literal
strings packed as described in section 2.2 of the SPIR-V Specification.
The first few words of the SPIR-V module must: be a magic number and a
SPIR-V version number, as described in section 2.3 of the SPIR-V
Specification.


[[spirvenv-capabilities]]
== Capabilities

The <<spirvenv-capabilities-table, table below>> lists the set of SPIR-V
capabilities that may: be supported in Vulkan implementations.
ifndef::VKSC_VERSION_1_0[]
The application must: not use any of these capabilities in SPIR-V passed to
flink:vkCreateShaderModule unless one of the following conditions is met for
the slink:VkDevice specified in the pname:device parameter of
flink:vkCreateShaderModule:
endif::VKSC_VERSION_1_0[]
ifdef::VKSC_VERSION_1_0[]
The application must: not select a pipeline cache entry, which was created
by passing a SPIR-V module using any of these capabilities to the
<<pipelines-offline-compilation, offline pipeline cache compiler>>, in a
ptext:vkCreate*Pipelines command unless one of the following conditions is
met for the slink:VkDevice specified in the pname:device parameter of the
ptext:vkCreate*Pipelines command:
endif::VKSC_VERSION_1_0[]

  * The corresponding field in the table is blank.
  * Any corresponding Vulkan feature is enabled.
  * Any corresponding Vulkan extension is enabled.
  * Any corresponding Vulkan property is supported.
  * The corresponding core version is supported (as returned by
    slink:VkPhysicalDeviceProperties::pname:apiVersion).

:captableindent: {nbsp} {nbsp} {nbsp} {nbsp} {nbsp} {nbsp} {nbsp} {nbsp}
[[spirvenv-capabilities-table]]
.List of SPIR-V Capabilities and corresponding Vulkan features, extensions, or core version
[options="header"]
|====
| SPIR-V code:OpCapability +
  {captableindent} Vulkan feature, extension, or core version
include::{generated}/spirvcap/captable.adoc[]
|====

ifndef::VKSC_VERSION_1_0[]
The application must: not pass a SPIR-V module containing any of the
following to flink:vkCreateShaderModule:
endif::VKSC_VERSION_1_0[]
ifdef::VKSC_VERSION_1_0[]
The application must: not select a pipeline cache entry, which was created
by passing a SPIR-V module containing any of the following to the
<<pipelines-offline-compilation, offline pipeline cache compiler>>,
containing any of the following in a ptext:vkCreate*Pipelines command:
endif::VKSC_VERSION_1_0[]

  * any code:OpCapability not listed above,
  * an unsupported capability, or
  * a capability which corresponds to a Vulkan feature or extension which
    has not been enabled.


[[spirvenv-extensions]]
=== SPIR-V Extensions

The <<spirvenv-extensions-table,following table>> lists SPIR-V extensions
that implementations may: support.
ifndef::VKSC_VERSION_1_0[]
The application must: not pass a SPIR-V module to flink:vkCreateShaderModule
that uses the following SPIR-V extensions unless one of the following
conditions is met for the slink:VkDevice specified in the pname:device
parameter of flink:vkCreateShaderModule:
endif::VKSC_VERSION_1_0[]
ifdef::VKSC_VERSION_1_0[]
The application must: not select a pipeline cache entry, which was created
by passing a SPIR-V module using any of the following SPIR-V extensions to
the <<pipelines-offline-compilation, offline pipeline cache compiler>>, in a
ptext:vkCreate*Pipelines command unless one of the following conditions is
met for the slink:VkDevice specified in the pname:device parameter of the
ptext:vkCreate*Pipelines command:
endif::VKSC_VERSION_1_0[]

  * Any corresponding Vulkan extension is enabled.
  * The corresponding core version is supported (as returned by
    slink:VkPhysicalDeviceProperties::pname:apiVersion).

[[spirvenv-extensions-table]]
.List of SPIR-V Extensions and corresponding Vulkan extensions or core version
[options="header"]
|====
| SPIR-V code:OpExtension +
  {captableindent} Vulkan extension or core version
include::{generated}/spirvcap/exttable.adoc[]
|====


[[spirvenv-module-validation]]
== Validation Rules Within a Module

ifndef::VKSC_VERSION_1_0[]
A SPIR-V module passed to flink:vkCreateShaderModule must: conform to the
following rules:
endif::VKSC_VERSION_1_0[]
ifdef::VKSC_VERSION_1_0[]
Pipeline cache entries must: have been compiled with the
<<pipelines-offline-compilation, offline pipeline cache compiler>> using
SPIR-V modules that conform to the following rules:
endif::VKSC_VERSION_1_0[]


[[spirvenv-module-validation-standalone]]
=== Standalone SPIR-V Validation

[open,refpage='StandaloneSpirv',desc='Standalone SPIR-V Validation',type='spirv']
--
:refpage: StandaloneSpirv

The following rules can: be validated with only the SPIR-V module itself.
They do not depend on knowledge of the implementation and its capabilities
or knowledge of runtime information, such as enabled features.

.Valid Usage
****
// NOTE: Do not conditionalize the "standalone" VUs.
// Write as though all extensions were enabled.
// Add any needed conditional logic to the runtime section if needed.
  * [[VUID-{refpage}-None-04633]]
    Every entry point must: have no return value and accept no arguments
  * [[VUID-{refpage}-None-04634]]
    The static function-call graph for an entry point must: not contain
    cycles; that is, static recursion is not allowed
  * [[VUID-{refpage}-None-04635]]
    The code:Logical or code:PhysicalStorageBuffer64 addressing model must:
    be selected
  * [[VUID-{refpage}-None-04636]]
    code:Scope for execution must: be limited to code:Workgroup or
    code:Subgroup
  * [[VUID-{refpage}-None-04637]]
    If the code:Scope for execution is code:Workgroup, then it must: only be
    used in the task, mesh, tessellation control, or compute
    {ExecutionModel}
  * [[VUID-{refpage}-None-04638]]
    code:Scope for memory must: be limited to code:Device, code:QueueFamily,
    code:Workgroup, code:ShaderCallKHR, code:Subgroup, or code:Invocation
  * [[VUID-{refpage}-ExecutionModel-07320]]
    If the {ExecutionModel} is code:TessellationControl, and the
    code:MemoryModel is code:GLSL450, the code:Scope for memory must: not be
    code:Workgroup
  * [[VUID-{refpage}-None-07321]]
    If the code:Scope for memory is code:Workgroup, then it must: only be
    used in the task, mesh, tessellation control, or compute
    {ExecutionModel}
  * [[VUID-{refpage}-None-04640]]
    If the code:Scope for memory is code:ShaderCallKHR, then it must: only
    be used in ray generation, intersection, closest hit, any-hit, miss, and
    callable {ExecutionModel}
  * [[VUID-{refpage}-None-04641]]
    If the code:Scope for memory is code:Invocation, then memory semantics
    must: be code:None
  * [[VUID-{refpage}-None-04642]]
    code:Scope for <<shaders-group-operations,group operations>> must: be
    limited to code:Subgroup
  * [[VUID-{refpage}-SubgroupVoteKHR-07951]]
    If none of the code:SubgroupVoteKHR, code:GroupNonUniform, or
    code:SubgroupBallotKHR capabilities are declared, code:Scope for memory
    must: not be code:Subgroup
  * [[VUID-{refpage}-None-04643]]
    {StorageClass} must: be limited to code:UniformConstant, code:Input,
    code:Uniform, code:Output, code:Workgroup, code:Private, code:Function,
    code:PushConstant, code:Image, code:StorageBuffer, code:RayPayloadKHR,
    code:IncomingRayPayloadKHR, code:HitAttributeKHR, code:CallableDataKHR,
    code:IncomingCallableDataKHR, code:ShaderRecordBufferKHR,
    code:PhysicalStorageBuffer, or code:TileImageEXT
  * [[VUID-{refpage}-None-04644]]
    If the {StorageClass} is code:Output, then it must: not be used in the
    code:GlCompute, code:RayGenerationKHR, code:IntersectionKHR,
    code:AnyHitKHR, code:ClosestHitKHR, code:MissKHR, or code:CallableKHR
    {ExecutionModel}
  * [[VUID-{refpage}-None-04645]]
    If the {StorageClass} is code:Workgroup, then it must: only be used in
    the task, mesh, or compute {ExecutionModel}
  * [[VUID-{refpage}-None-08720]]
    If the {StorageClass} is code:TileImageEXT, then it must: only be used
    in the fragment execution model
  * [[VUID-{refpage}-OpAtomicStore-04730]]
    code:OpAtomicStore must: not use code:Acquire, code:AcquireRelease, or
    code:SequentiallyConsistent memory semantics
  * [[VUID-{refpage}-OpAtomicLoad-04731]]
    code:OpAtomicLoad must: not use code:Release, code:AcquireRelease, or
    code:SequentiallyConsistent memory semantics
  * [[VUID-{refpage}-OpMemoryBarrier-04732]]
    code:OpMemoryBarrier must: use one of code:Acquire, code:Release,
    code:AcquireRelease, or code:SequentiallyConsistent memory semantics
  * [[VUID-{refpage}-OpMemoryBarrier-04733]]
    code:OpMemoryBarrier must: include at least one {StorageClass}
  * [[VUID-{refpage}-OpControlBarrier-04650]]
    If the semantics for code:OpControlBarrier includes one of code:Acquire,
    code:Release, code:AcquireRelease, or code:SequentiallyConsistent memory
    semantics, then it must: include at least one {StorageClass}
  * [[VUID-{refpage}-OpVariable-04651]]
    Any code:OpVariable with an code:Initializer operand must: have
    code:Output, code:Private, code:Function, or code:Workgroup as its
    {StorageClass} operand
  * [[VUID-{refpage}-OpVariable-04734]]
    Any code:OpVariable with an code:Initializer operand and code:Workgroup
    as its {StorageClass} operand must: use code:OpConstantNull as the
    initializer
  * [[VUID-{refpage}-OpReadClockKHR-04652]]
    code:Scope for code:OpReadClockKHR must: be limited to code:Subgroup or
    code:Device
  * [[VUID-{refpage}-OriginLowerLeft-04653]]
    The code:OriginLowerLeft {ExecutionMode} must: not be used; fragment
    entry points must: declare code:OriginUpperLeft
  * [[VUID-{refpage}-PixelCenterInteger-04654]]
    The code:PixelCenterInteger {ExecutionMode} must: not be used (pixels
    are always centered at half-integer coordinates)
  * [[VUID-{refpage}-UniformConstant-04655]]
    Any variable in the code:UniformConstant {StorageClass} must: be typed
    as either code:OpTypeImage, code:OpTypeSampler, code:OpTypeSampledImage,
    code:OpTypeAccelerationStructureKHR, or an array of one of these types
  * [[VUID-{refpage}-Uniform-06807]]
    Any variable in the code:Uniform or code:StorageBuffer {StorageClass}
    must: be typed as code:OpTypeStruct or an array of this type
  * [[VUID-{refpage}-PushConstant-06808]]
    Any variable in the code:PushConstant {StorageClass} must: be typed as
    code:OpTypeStruct
  * [[VUID-{refpage}-OpTypeImage-04656]]
    code:OpTypeImage must: declare a scalar 32-bit float, 64-bit integer, or
    32-bit integer type for the "`Sampled Type`" (code:RelaxedPrecision can:
    be applied to a sampling instruction and to the variable holding the
    result of a sampling instruction)
  * [[VUID-{refpage}-OpTypeImage-04657]]
    code:OpTypeImage must: have a "`Sampled`" operand of 1 (sampled image)
    or 2 (storage image)
  * [[VUID-{refpage}-OpTypeSampledImage-06671]]
    code:OpTypeSampledImage must: have a code:OpTypeImage with a "`Sampled`"
    operand of 1 (sampled image)
  * [[VUID-{refpage}-Image-04965]]
    The <<spirv-type,SPIR-V Type>> of the code:Image code:Format operand of
    an code:OpTypeImage must: match the code:Sampled code:Type, as defined
    in <<spirvenv-format-type-matching>>
  * [[VUID-{refpage}-OpImageTexelPointer-04658]]
    If an code:OpImageTexelPointer is used in an atomic operation, the image
    type of the code:image parameter to code:OpImageTexelPointer must: have
    an image format of code:R64i, code:R64ui, code:R32f, code:R32i, or
    code:R32ui
  * [[VUID-{refpage}-OpImageQuerySizeLod-04659]]
    code:OpImageQuerySizeLod, code:OpImageQueryLod, and
    code:OpImageQueryLevels must: only consume an "`Image`" operand whose
    type has its "`Sampled`" operand set to 1
  * [[VUID-{refpage}-OpTypeImage-06214]]
    An code:OpTypeImage with a "`Dim`" operand of code:SubpassData must:
    have an "`Arrayed`" operand of 0 (non-arrayed) and a "`Sampled`" operand
    of 2 (storage image)
  * [[VUID-{refpage}-SubpassData-04660]]
    The [eq]#(u,v)# coordinates used for a code:SubpassData must: be the
    <id> of a constant vector [eq]#(0,0)#, or if a layer coordinate is used,
    must: be a vector that was formed with constant 0 for the [eq]#u# and
    [eq]#v# components
  * [[VUID-{refpage}-OpTypeImage-06924]]
    Objects of types code:OpTypeImage, code:OpTypeSampler,
    code:OpTypeSampledImage, code:OpTypeAccelerationStructureKHR, and arrays
    of these types must: not be stored to or modified
  * [[VUID-{refpage}-Uniform-06925]]
    Any variable in the code:Uniform {StorageClass} decorated as code:Block
    must: not be stored to or modified
  * [[VUID-{refpage}-Offset-04663]]
    Image operand code:Offset must: only be used with code:OpImage*Gather
    instructions
  * [[VUID-{refpage}-Offset-04865]]
    Any image instruction which uses an code:Offset, code:ConstOffset, or
    code:ConstOffsets image operand, must only consume a "`Sampled Image`"
    operand whose type has its "`Sampled`" operand set to 1
  * [[VUID-{refpage}-OpImageGather-04664]]
    The "`Component`" operand of code:OpImageGather, and
    code:OpImageSparseGather must: be the <id> of a constant instruction
  * [[VUID-{refpage}-OpImage-04777]]
    code:OpImage*Dref* instructions must: not consume an image whose `Dim`
    is 3D
  * [[VUID-{refpage}-None-04667]]
    Structure types must: not contain opaque types
  * [[VUID-{refpage}-BuiltIn-04668]]
    Any code:BuiltIn decoration not listed in
    <<interfaces-builtin-variables>> must: not be used
  * [[VUID-{refpage}-Location-06672]]
    The code:Location or code:Component decorations must: only be used with
    the code:Input, code:Output, code:RayPayloadKHR,
    code:IncomingRayPayloadKHR, code:HitAttributeKHR,
    code:HitObjectAttributeNV, code:CallableDataKHR,
    code:IncomingCallableDataKHR, or code:ShaderRecordBufferKHR storage
    classes
  * [[VUID-{refpage}-Location-04915]]
    The code:Location or code:Component decorations must: not be used with
    code:BuiltIn
  * [[VUID-{refpage}-Location-04916]]
    The code:Location decorations must: be used on
    <<interfaces-iointerfaces-user,user-defined variables>>
  * [[VUID-{refpage}-Location-04917]]
    If a <<interfaces-iointerfaces-user,user-defined variable>> is not a
    pointer to a code:Block decorated code:OpTypeStruct, then the
    code:OpVariable must: have a code:Location decoration
  * [[VUID-{refpage}-Location-04918]]
    If a <<interfaces-iointerfaces-user,user-defined variable>> has a
    code:Location decoration, and the variable is a pointer to a
    code:OpTypeStruct, then the members of that structure must: not have
    code:Location decorations
  * [[VUID-{refpage}-Location-04919]]
    If a <<interfaces-iointerfaces-user,user-defined variable>> does not
    have a code:Location decoration, and the variable is a pointer to a
    code:Block decorated code:OpTypeStruct, then each member of the struct
    must: have a code:Location decoration
  * [[VUID-{refpage}-Component-04920]]
    The code:Component decoration value must: not be greater than 3
  * [[VUID-{refpage}-Component-04921]]
    If the code:Component decoration is used on an code:OpVariable that has
    a code:OpTypeVector type with a code:Component code:Type with a
    code:Width that is less than or equal to 32, the sum of its
    code:Component code:Count and the code:Component decoration value must:
    be less than or equal to 4
  * [[VUID-{refpage}-Component-04922]]
    If the code:Component decoration is used on an code:OpVariable that has
    a code:OpTypeVector type with a code:Component code:Type with a
    code:Width that is equal to 64, the sum of two times its code:Component
    code:Count and the code:Component decoration value must: be less than or
    equal to 4
  * [[VUID-{refpage}-Component-04923]]
    The code:Component decorations value must: not be 1 or 3 for scalar or
    two-component 64-bit data types
  * [[VUID-{refpage}-Component-04924]]
    The code:Component decorations must: not be used with any type that is
    not a scalar or vector, or an array of such a type
  * [[VUID-{refpage}-Component-07703]]
    The code:Component decorations must: not be used for a 64-bit vector
    type with more than two components
  * [[VUID-{refpage}-GLSLShared-04669]]
    The code:GLSLShared and code:GLSLPacked decorations must: not be used
  * [[VUID-{refpage}-Flat-04670]]
    The code:Flat, code:NoPerspective, code:Sample, and code:Centroid
    decorations must: only be used on variables with the code:Output or
    code:Input {StorageClass}
  * [[VUID-{refpage}-Flat-06201]]
    The code:Flat, code:NoPerspective, code:Sample, and code:Centroid
    decorations must: not be used on variables with the code:Output storage
    class in a fragment shader
  * [[VUID-{refpage}-Flat-06202]]
    The code:Flat, code:NoPerspective, code:Sample, and code:Centroid
    decorations must: not be used on variables with the code:Input storage
    class in a vertex shader
  * [[VUID-{refpage}-PerVertexKHR-06777]]
    The code:PerVertexKHR decoration must: only be used on variables with
    the code:Input {StorageClass} in a fragment shader
  * [[VUID-{refpage}-Flat-04744]]
    Any variable with integer or double-precision floating-point type and
    with code:Input {StorageClass} in a fragment shader, must: be decorated
    code:Flat
  * [[VUID-{refpage}-ViewportRelativeNV-04672]]
    The code:ViewportRelativeNV decoration must: only be used on a variable
    decorated with code:Layer in the vertex, tessellation evaluation, or
    geometry shader stages
  * [[VUID-{refpage}-ViewportRelativeNV-04673]]
    The code:ViewportRelativeNV decoration must: not be used unless a
    variable decorated with one of code:ViewportIndex or code:ViewportMaskNV
    is also statically used by the same code:OpEntryPoint
  * [[VUID-{refpage}-ViewportMaskNV-04674]]
    The code:ViewportMaskNV and code:ViewportIndex decorations must: not
    both be statically used by one or more code:OpEntryPoint's that form the
    <<pipelines-graphics-subsets-pre-rasterization,pre-rasterization shader
    stages>> of a graphics pipeline
  * [[VUID-{refpage}-FPRoundingMode-04675]]
    Rounding modes other than round-to-nearest-even and round-towards-zero
    must: not be used for the code:FPRoundingMode decoration
  * [[VUID-{refpage}-Invariant-04677]]
    Variables decorated with code:Invariant and variables with structure
    types that have any members decorated with code:Invariant must: be in
    the code:Output or code:Input {StorageClass}, code:Invariant used on an
    code:Input {StorageClass} variable or structure member has no effect
  * [[VUID-{refpage}-VulkanMemoryModel-04678]]
    [[builtin-volatile-semantics]] If the code:VulkanMemoryModel capability
    is not declared, the code:Volatile decoration must: be used on any
    variable declaration that includes one of the code:SMIDNV,
    code:WarpIDNV, code:SubgroupSize, code:SubgroupLocalInvocationId,
    code:SubgroupEqMask, code:SubgroupGeMask, code:SubgroupGtMask,
    code:SubgroupLeMask, or code:SubgroupLtMask code:BuiltIn decorations
    when used in the ray generation, closest hit, miss, intersection, or
    callable shaders, or with the code:RayTmaxKHR code:Builtin decoration
    when used in an intersection shader
  * [[VUID-{refpage}-VulkanMemoryModel-04679]]
    If the code:VulkanMemoryModel capability is declared, the code:OpLoad
    instruction must: use the code:Volatile memory semantics when it
    accesses into any variable that includes one of the code:SMIDNV,
    code:WarpIDNV, code:SubgroupSize, code:SubgroupLocalInvocationId,
    code:SubgroupEqMask, code:SubgroupGeMask, code:SubgroupGtMask,
    code:SubgroupLeMask, or code:SubgroupLtMask code:BuiltIn decorations
    when used in the ray generation, closest hit, miss, intersection, or
    callable shaders, or with the code:RayTmaxKHR code:Builtin decoration
    when used in an intersection shader
  * [[VUID-{refpage}-OpTypeRuntimeArray-04680]]
    code:OpTypeRuntimeArray must: only be used for:
  ** the last member of a code:Block-decorated code:OpTypeStruct in
     code:StorageBuffer or code:PhysicalStorageBuffer storage {StorageClass}
  ** code:BufferBlock-decorated code:OpTypeStruct in the code:Uniform
     storage {StorageClass}
  ** the outermost dimension of an arrayed variable in the
     code:StorageBuffer, code:Uniform, or code:UniformConstant storage
     {StorageClass}
  ** variables in the code:NodePayloadAMDX storage {StorageClass} when the
     code:CoalescingAMDX {ExecutionMode} is specified
  * [[VUID-{refpage}-Function-04681]]
    A type _T_ that is an array sized with a specialization constant must:
    neither be, nor be contained in, the type _T2_ of a variable _V_, unless
    either: a) _T_ is equal to _T2_, b) _V_ is declared in the
    code:Function, or code:Private {StorageClass}, c) _V_ is a non-Block
    variable in the code:Workgroup {StorageClass}, or d) _V_ is an interface
    variable with an additional level of arrayness,
    <<interfaces-iointerfaces-matching, as described in interface
    matching>>, and _T_ is the member type of the array type _T2_
  * [[VUID-{refpage}-OpControlBarrier-04682]]
    If code:OpControlBarrier is used in ray generation, intersection,
    any-hit, closest hit, miss, fragment, vertex, tessellation evaluation,
    or geometry shaders, the execution Scope must: be code:Subgroup
  * [[VUID-{refpage}-LocalSize-06426]]
    For each compute shader entry point, either a code:LocalSize or
    code:LocalSizeId {ExecutionMode}, or an object decorated with the
    code:WorkgroupSize decoration must: be specified
  * [[VUID-{refpage}-DerivativeGroupQuadsNV-04684]]
    For compute shaders using the code:DerivativeGroupQuadsNV execution
    mode, the first two dimensions of the local workgroup size must: be a
    multiple of two
  * [[VUID-{refpage}-DerivativeGroupLinearNV-04778]]
    For compute shaders using the code:DerivativeGroupLinearNV execution
    mode, the product of the dimensions of the local workgroup size must: be
    a multiple of four
  * [[VUID-{refpage}-OpGroupNonUniformBallotBitCount-04685]]
    If code:OpGroupNonUniformBallotBitCount is used, the group operation
    must: be limited to code:Reduce, code:InclusiveScan, or
    code:ExclusiveScan
  * [[VUID-{refpage}-None-04686]]
    The _Pointer_ operand of all atomic instructions must: have a
    {StorageClass} limited to code:Uniform, code:Workgroup, code:Image,
    code:StorageBuffer, code:PhysicalStorageBuffer, or
    code:TaskPayloadWorkgroupEXT
  * [[VUID-{refpage}-Offset-04687]]
    Output variables or block members decorated with code:Offset that have a
    64-bit type, or a composite type containing a 64-bit type, must: specify
    an code:Offset value aligned to a 8 byte boundary
  * [[VUID-{refpage}-Offset-04689]]
    The size of any output block containing any member decorated with
    code:Offset that is a 64-bit type must: be a multiple of 8
  * [[VUID-{refpage}-Offset-04690]]
    The first member of an output block specifying a code:Offset decoration
    must: specify a code:Offset value that is aligned to an 8 byte boundary
    if that block contains any member decorated with code:Offset and is a
    64-bit type
  * [[VUID-{refpage}-Offset-04691]]
    Output variables or block members decorated with code:Offset that have a
    32-bit type, or a composite type contains a 32-bit type, must: specify
    an code:Offset value aligned to a 4 byte boundary
  * [[VUID-{refpage}-Offset-04692]]
    Output variables, blocks or block members decorated with code:Offset
    must: only contain base types that have components that are either
    32-bit or 64-bit in size
  * [[VUID-{refpage}-Offset-04716]]
    Only variables or block members in the output interface decorated with
    code:Offset can: be captured for transform feedback, and those variables
    or block members must: also be decorated with code:XfbBuffer and
    code:XfbStride, or inherit code:XfbBuffer and code:XfbStride decorations
    from a block containing them
  * [[VUID-{refpage}-XfbBuffer-04693]]
    All variables or block members in the output interface of the entry
    point being compiled decorated with a specific code:XfbBuffer value
    must: all be decorated with identical code:XfbStride values
  * [[VUID-{refpage}-Stream-04694]]
    If any variables or block members in the output interface of the entry
    point being compiled are decorated with code:Stream, then all variables
    belonging to the same code:XfbBuffer must: specify the same code:Stream
    value
  * [[VUID-{refpage}-XfbBuffer-04696]]
    For any two variables or block members in the output interface of the
    entry point being compiled with the same code:XfbBuffer value, the
    ranges determined by the code:Offset decoration and the size of the type
    must: not overlap
  * [[VUID-{refpage}-XfbBuffer-04697]]
    All block members in the output interface of the entry point being
    compiled that are in the same block and have a declared or inherited
    code:XfbBuffer decoration must: specify the same code:XfbBuffer value
  * [[VUID-{refpage}-RayPayloadKHR-04698]]
    code:RayPayloadKHR {StorageClass} must: only be used in ray generation,
    closest hit or miss shaders
  * [[VUID-{refpage}-IncomingRayPayloadKHR-04699]]
    code:IncomingRayPayloadKHR {StorageClass} must: only be used in closest
    hit, any-hit, or miss shaders
  * [[VUID-{refpage}-IncomingRayPayloadKHR-04700]]
    There must: be at most one variable with the code:IncomingRayPayloadKHR
    {StorageClass} in the input interface of an entry point
  * [[VUID-{refpage}-HitAttributeKHR-04701]]
    code:HitAttributeKHR {StorageClass} must: only be used in intersection,
    any-hit, or closest hit shaders
  * [[VUID-{refpage}-HitAttributeKHR-04702]]
    There must: be at most one variable with the code:HitAttributeKHR
    {StorageClass} in the input interface of an entry point
  * [[VUID-{refpage}-HitAttributeKHR-04703]]
    A variable with code:HitAttributeKHR {StorageClass} must: only be
    written to in an intersection shader
  * [[VUID-{refpage}-CallableDataKHR-04704]]
    code:CallableDataKHR {StorageClass} must: only be used in ray
    generation, closest hit, miss, and callable shaders
  * [[VUID-{refpage}-IncomingCallableDataKHR-04705]]
    code:IncomingCallableDataKHR {StorageClass} must: only be used in
    callable shaders
  * [[VUID-{refpage}-IncomingCallableDataKHR-04706]]
    There must: be at most one variable with the
    code:IncomingCallableDataKHR {StorageClass} in the input interface of an
    entry point
  * [[VUID-{refpage}-ShaderRecordBufferKHR-07119]]
    code:ShaderRecordBufferKHR {StorageClass} must: only be used in ray
    generation, intersection, any-hit, closest hit, callable, or miss
    shaders
  * [[VUID-{refpage}-Base-07650]]
    The code:Base operand of code:OpPtrAccessChain must: have a storage
    class of code:Workgroup, code:StorageBuffer, or
    code:PhysicalStorageBuffer
  * [[VUID-{refpage}-Base-07651]]
    If the code:Base operand of code:OpPtrAccessChain has a code:Workgroup
    {StorageClass}, then the code:VariablePointers capability must: be
    declared
  * [[VUID-{refpage}-Base-07652]]
    If the code:Base operand of code:OpPtrAccessChain has a
    code:StorageBuffer {StorageClass}, then the code:VariablePointers or
    code:VariablePointersStorageBuffer capability must: be declared
  * [[VUID-{refpage}-PhysicalStorageBuffer64-04708]]
    If the code:PhysicalStorageBuffer64 addressing model is enabled, all
    instructions that support memory access operands and that use a physical
    pointer must: include the code:Aligned operand
  * [[VUID-{refpage}-PhysicalStorageBuffer64-04709]]
    If the code:PhysicalStorageBuffer64 addressing model is enabled, any
    access chain instruction that accesses into a code:RowMajor matrix must:
    only be used as the code:Pointer operand to code:OpLoad or code:OpStore
  * [[VUID-{refpage}-PhysicalStorageBuffer64-04710]]
    If the code:PhysicalStorageBuffer64 addressing model is enabled,
    code:OpConvertUToPtr and code:OpConvertPtrToU must: use an integer type
    whose code:Width is 64
  * [[VUID-{refpage}-OpTypeForwardPointer-04711]]
    code:OpTypeForwardPointer must: have a {StorageClass} of
    code:PhysicalStorageBuffer
  * [[VUID-{refpage}-None-04745]]
    All block members in a variable with a {StorageClass} of
    code:PushConstant declared as an array must: only be accessed by
    dynamically uniform indices
  * [[VUID-{refpage}-OpVariable-06673]]
    There must: not be more than one code:OpVariable in the
    code:PushConstant {StorageClass} listed in the code:Interface for each
    code:OpEntryPoint
  * [[VUID-{refpage}-OpEntryPoint-06674]]
    Each code:OpEntryPoint must: not statically use more than one
    code:OpVariable in the code:PushConstant {StorageClass}
  * [[VUID-{refpage}-OpEntryPoint-08721]]
    Each code:OpEntryPoint must: not have more than one code:Input variable
    assigned the same code:Component word inside a code:Location slot,
    either explicitly or implicitly
  * [[VUID-{refpage}-OpEntryPoint-08722]]
    Each code:OpEntryPoint must: not have more than one code:Output variable
    assigned the same code:Component word inside a code:Location slot,
    either explicitly or implicitly
  * [[VUID-{refpage}-Result-04780]]
    The code:Result code:Type operand of any code:OpImageRead or
    code:OpImageSparseRead instruction must: be a vector of four components
  * [[VUID-{refpage}-Base-04781]]
    The code:Base operand of any code:OpBitCount, code:OpBitReverse,
    code:OpBitFieldInsert, code:OpBitFieldSExtract, or
    code:OpBitFieldUExtract instruction must: be a 32-bit integer scalar or
    a vector of 32-bit integers
  * [[VUID-{refpage}-PushConstant-06675]]
    Any variable in the code:PushConstant or code:StorageBuffer storage
    class must: be decorated as code:Block
  * [[VUID-{refpage}-Uniform-06676]]
    Any variable in the code:Uniform {StorageClass} must: be decorated as
    code:Block or code:BufferBlock
  * [[VUID-{refpage}-UniformConstant-06677]]
    Any variable in the code:UniformConstant, code:StorageBuffer, or
    code:Uniform {StorageClass} must: be decorated with code:DescriptorSet
    and code:Binding
  * [[VUID-{refpage}-InputAttachmentIndex-06678]]
    Variables decorated with code:InputAttachmentIndex must: be in the
    code:UniformConstant {StorageClass}
  * [[VUID-{refpage}-DescriptorSet-06491]]
    If a variable is decorated by code:DescriptorSet or code:Binding, the
    {StorageClass} must: correspond to an entry in
    <<interfaces-resources-storage-class-correspondence, Shader Resource and
    Storage Class Correspondence>>
  * [[VUID-{refpage}-Input-06778]]
    Variables with a {StorageClass} of code:Input in a fragment shader stage
    that are decorated with code:PerVertexKHR must: be declared as arrays
  * [[VUID-{refpage}-MeshEXT-07102]]
    The module must: not contain both an entry point that uses the
    code:TaskEXT or code:MeshEXT {ExecutionModel} and an entry point that
    uses the code:TaskNV or code:MeshNV {ExecutionModel}
  * [[VUID-{refpage}-MeshEXT-07106]]
    In mesh shaders using the code:MeshEXT {ExecutionModel}
    code:OpSetMeshOutputsEXT must: be called before any outputs are written
  * [[VUID-{refpage}-MeshEXT-07107]]
    In mesh shaders using the code:MeshEXT {ExecutionModel} all variables
    declared as output must: not be read from
  * [[VUID-{refpage}-MeshEXT-07108]]
    In mesh shaders using the code:MeshEXT {ExecutionModel} for
    code:OpSetMeshOutputsEXT instructions, the "`Vertex Count`" and
    "`Primitive Count`" operands must: not depend on code:ViewIndex
  * [[VUID-{refpage}-MeshEXT-07109]]
    In mesh shaders using the code:MeshEXT {ExecutionModel} variables
    decorated with code:PrimitivePointIndicesEXT,
    code:PrimitiveLineIndicesEXT, or code:PrimitiveTriangleIndicesEXT
    declared as an array must: not be accessed by indices that depend on
    code:ViewIndex
  * [[VUID-{refpage}-MeshEXT-07110]]
    In mesh shaders using the code:MeshEXT {ExecutionModel} any values
    stored in variables decorated with code:PrimitivePointIndicesEXT,
    code:PrimitiveLineIndicesEXT, or code:PrimitiveTriangleIndicesEXT must:
    not depend on code:ViewIndex
  * [[VUID-{refpage}-MeshEXT-07111]]
    In mesh shaders using the code:MeshEXT {ExecutionModel} variables in
    workgroup or private {StorageClass} declared as or containing a
    composite type must: not be accessed by indices that depend on
    code:ViewIndex
  * [[VUID-{refpage}-MeshEXT-07330]]
    In mesh shaders using the code:MeshEXT {ExecutionModel} the
    code:OutputVertices {ExecutionMode} must: be greater than 0
  * [[VUID-{refpage}-MeshEXT-07331]]
    In mesh shaders using the code:MeshEXT {ExecutionModel} the
    code:OutputPrimitivesEXT {ExecutionMode} must: be greater than 0
  * [[VUID-{refpage}-Input-07290]]
    Variables with a {StorageClass} of code:Input or code:Output and a type
    of code:OpTypeBool must: be decorated with the code:BuiltIn decoration
  * [[VUID-{refpage}-TileImageEXT-08723]]
    The tile image variable declarations must: obey the constraints on the
    code:TileImageEXT {StorageClass} and the code:Location decoration
    described in <<interfaces-fragmenttileimage, Fragment Tile Image
    Interface>>
  * [[VUID-{refpage}-None-08724]]
    The code:TileImageEXT {StorageClass} must: only be used for declaring
    tile image variables.
  * [[VUID-{refpage}-Pointer-08973]]
    The {StorageClass} of the code:Pointer operand to
    code:OpCooperativeMatrixLoadKHR or code:OpCooperativeMatrixStoreKHR
    must: be limited to code:Workgroup, code:StorageBuffer, or
    code:PhysicalStorageBuffer.
****
--


[[spirvenv-module-validation-runtime]]
=== Runtime SPIR-V Validation

[open,refpage='RuntimeSpirv',desc='Runtime SPIR-V Validation',type='spirv']
--
:refpage: RuntimeSpirv

The following rules must: be validated at runtime.
These rules depend on knowledge of the implementation and its capabilities
and knowledge of runtime information, such as enabled features.

.Valid Usage
****
ifdef::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
  * [[VUID-{refpage}-vulkanMemoryModel-06265]]
    If <<features-vulkanMemoryModel, pname:vulkanMemoryModel>> is enabled
    and <<features-vulkanMemoryModelDeviceScope,
    pname:vulkanMemoryModelDeviceScope>> is not enabled, code:Device memory
    scope must: not be used
endif::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
ifdef::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
  * [[VUID-{refpage}-vulkanMemoryModel-06266]]
    If <<features-vulkanMemoryModel, pname:vulkanMemoryModel>> is not
    enabled, code:QueueFamily memory scope must: not be used
endif::VK_VERSION_1_2,VK_KHR_vulkan_memory_model[]
ifdef::VK_KHR_shader_clock[]
  * [[VUID-{refpage}-shaderSubgroupClock-06267]]
    If <<features-shaderSubgroupClock, pname:shaderSubgroupClock>> is not
    enabled, the code:Subgroup scope must: not be used for
    code:OpReadClockKHR
  * [[VUID-{refpage}-shaderDeviceClock-06268]]
    If <<features-shaderDeviceClock, pname:shaderDeviceClock>> is not
    enabled, the code:Device scope must: not be used for code:OpReadClockKHR
endif::VK_KHR_shader_clock[]
ifndef::VK_VERSION_1_3,VK_KHR_format_feature_flags2[]
  * [[VUID-{refpage}-OpTypeImage-06269]]
    If <<features-shaderStorageImageWriteWithoutFormat,
    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
    variable created with a "`Type`" of code:OpTypeImage that has a
    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
    must: be decorated with code:NonWritable
  * [[VUID-{refpage}-OpTypeImage-06270]]
    If <<features-shaderStorageImageReadWithoutFormat,
    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
    decorated with code:NonReadable
endif::VK_VERSION_1_3,VK_KHR_format_feature_flags2[]
ifdef::VK_VERSION_1_3[]
ifndef::VK_KHR_format_feature_flags2[]
  * [[VUID-{refpage}-apiVersion-07952]]
    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
    Vulkan 1.3, and <<features-shaderStorageImageWriteWithoutFormat,
    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
    variable created with a "`Type`" of code:OpTypeImage that has a
    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
    must: be decorated with code:NonWritable
  * [[VUID-{refpage}-apiVersion-07953]]
    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
    Vulkan 1.3, and <<features-shaderStorageImageReadWithoutFormat,
    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
    decorated with code:NonReadable
endif::VK_KHR_format_feature_flags2[]
ifdef::VK_KHR_format_feature_flags2[]
  * [[VUID-{refpage}-apiVersion-07954]]
    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
    Vulkan 1.3, the apiext:VK_KHR_format_feature_flags2 extension is not
    supported, and <<features-shaderStorageImageWriteWithoutFormat,
    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
    variable created with a "`Type`" of code:OpTypeImage that has a
    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
    must: be decorated with code:NonWritable
  * [[VUID-{refpage}-apiVersion-07955]]
    If slink:VkPhysicalDeviceProperties::pname:apiVersion is less than
    Vulkan 1.3, the apiext:VK_KHR_format_feature_flags2 extension is not
    supported, and <<features-shaderStorageImageReadWithoutFormat,
    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
    decorated with code:NonReadable
endif::VK_KHR_format_feature_flags2[]
endif::VK_VERSION_1_3[]
ifdef::VK_KHR_format_feature_flags2[]
ifndef::VK_VERSION_1_3[]
  * [[VUID-{refpage}-shaderStorageImageWriteWithoutFormat-07956]]
    If the apiext:VK_KHR_format_feature_flags2 extension is not enabled, and
    <<features-shaderStorageImageWriteWithoutFormat,
    pname:shaderStorageImageWriteWithoutFormat>> is not enabled, any
    variable created with a "`Type`" of code:OpTypeImage that has a
    "`Sampled`" operand of 2 and an "`Image Format`" operand of code:Unknown
    must: be decorated with code:NonWritable
  * [[VUID-{refpage}-shaderStorageImageReadWithoutFormat-07957]]
    If the apiext:VK_KHR_format_feature_flags2 extension is not enabled, and
    <<features-shaderStorageImageReadWithoutFormat,
    pname:shaderStorageImageReadWithoutFormat>> is not enabled, any variable
    created with a "`Type`" of code:OpTypeImage that has a "`Sampled`"
    operand of 2 and an "`Image Format`" operand of code:Unknown must: be
    decorated with code:NonReadable
endif::VK_VERSION_1_3[]
endif::VK_KHR_format_feature_flags2[]
  * [[VUID-{refpage}-OpImageWrite-07112]]
    code:OpImageWrite to any code:Image whose code:Image code:Format is not
    code:Unknown must: have the code:Texel operand contain at least as many
    components as the corresponding elink:VkFormat as given in the
    <<spirvenv-image-formats,SPIR-V Image Format compatibility table>>
  * [[VUID-{refpage}-Location-06272]]
    The sum of code:Location and the number of locations the variable it
    decorates consumes must: be less than or equal to the value for the
    matching {ExecutionModel} defined in <<interfaces-iointerfaces-limits>>
  * [[VUID-{refpage}-Location-06428]]
    The maximum number of storage buffers, storage images, and output
    code:Location decorated color attachments written to in the
    code:Fragment {ExecutionModel} must: be less than or equal to
    <<limits-maxFragmentCombinedOutputResources,
    pname:maxFragmentCombinedOutputResources>>
ifdef::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
  * [[VUID-{refpage}-NonUniform-06274]]
    If an instruction loads from or stores to a resource (including atomics
    and image instructions) and the resource descriptor being accessed is
    not dynamically uniform, then the operand corresponding to that resource
    (e.g. the pointer or sampled image operand) must: be decorated with
    code:NonUniform
endif::VK_VERSION_1_2,VK_EXT_descriptor_indexing[]
ifdef::VK_VERSION_1_1[]
ifdef::VK_VERSION_1_2,VK_KHR_shader_subgroup_extended_types[]
  * [[VUID-{refpage}-None-06275]]
    <<features-subgroup-extended-types, pname:shaderSubgroupExtendedTypes>>
    must: be enabled for <<shaders-group-operations,group operations>> to
    use 8-bit integer, 16-bit integer, 64-bit integer, 16-bit
    floating-point, and vectors of these types
endif::VK_VERSION_1_2,VK_KHR_shader_subgroup_extended_types[]
endif::VK_VERSION_1_1[]
ifdef::VK_VERSION_1_2[]
  * [[VUID-{refpage}-subgroupBroadcastDynamicId-06276]]
    If <<features-subgroupBroadcastDynamicId,
    pname:subgroupBroadcastDynamicId>> is ename:VK_TRUE, and the shader
    module version is 1.5 or higher, the "`Index`" for
    code:OpGroupNonUniformQuadBroadcast must: be dynamically uniform within
    the derivative group.
    Otherwise, "`Index`" must: be a constant
  * [[VUID-{refpage}-subgroupBroadcastDynamicId-06277]]
    If <<features-subgroupBroadcastDynamicId,
    pname:subgroupBroadcastDynamicId>> is ename:VK_TRUE, and the shader
    module version is 1.5 or higher, the "`Id`" for
    code:OpGroupNonUniformBroadcast must: be dynamically uniform within the
    subgroup.
    Otherwise, "`Id`" must: be a constant
endif::VK_VERSION_1_2[]
ifdef::VK_KHR_shader_atomic_int64[]
  * [[VUID-{refpage}-None-06278]]
    <<features-shaderBufferInt64Atomics, pname:shaderBufferInt64Atomics>>
    must: be enabled for 64-bit integer atomic operations to be supported on
    a _Pointer_ with a {StorageClass} of code:StorageBuffer or code:Uniform
  * [[VUID-{refpage}-None-06279]]
    <<features-shaderSharedInt64Atomics, pname:shaderSharedInt64Atomics>>
    must: be enabled for 64-bit integer atomic operations to be supported on
    a _Pointer_ with a {StorageClass} of code:Workgroup
endif::VK_KHR_shader_atomic_int64[]
ifdef::VK_EXT_shader_atomic_float[]
ifndef::VK_EXT_shader_atomic_float2[]
  * [[VUID-{refpage}-None-06280]]
    <<features-shaderBufferFloat32Atomics,
    pname:shaderBufferFloat32Atomics>>, or
    <<features-shaderBufferFloat32AtomicAdd,
    pname:shaderBufferFloat32AtomicAdd>>, or
    <<features-shaderBufferFloat64Atomics,
    pname:shaderBufferFloat64Atomics>>, or
    <<features-shaderBufferFloat64AtomicAdd,
    pname:shaderBufferFloat64AtomicAdd>> must: be enabled for floating-point
    atomic operations to be supported on a _Pointer_ with a {StorageClass}
    of code:StorageBuffer
  * [[VUID-{refpage}-None-06281]]
    <<features-shaderSharedFloat32Atomics,
    pname:shaderSharedFloat32Atomics>>, or
    <<features-shaderSharedFloat32AtomicAdd,
    pname:shaderSharedFloat32AtomicAdd>>, or
    <<features-shaderSharedFloat64Atomics,
    pname:shaderSharedFloat64Atomics>>, or
    <<features-shaderSharedFloat64AtomicAdd,
    pname:shaderSharedFloat64AtomicAdd>> must: be enabled for floating-point
    atomic operations to be supported on a _Pointer_ with a {StorageClass}
    of code:Workgroup
  * [[VUID-{refpage}-None-06282]]
    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>
    or <<features-shaderImageFloat32AtomicAdd,
    pname:shaderImageFloat32AtomicAdd>> must: be enabled for 32-bit
    floating-point atomic operations to be supported on a _Pointer_ with a
    {StorageClass} of code:Image
  * [[VUID-{refpage}-None-06283]]
    <<features-sparseImageFloat32Atomics, pname:sparseImageFloat32Atomics>>
    or <<features-sparseImageFloat32AtomicAdd,
    pname:sparseImageFloat32AtomicAdd>> must: be enabled for 32-bit
    floating-point atomics to be supported on sparse images
endif::VK_EXT_shader_atomic_float2[]
endif::VK_EXT_shader_atomic_float[]
ifdef::VK_EXT_shader_atomic_float2[]
  * [[VUID-{refpage}-None-06284]]
    <<features-shaderBufferFloat32Atomics,
    pname:shaderBufferFloat32Atomics>>, or
    <<features-shaderBufferFloat32AtomicAdd,
    pname:shaderBufferFloat32AtomicAdd>>, or
    <<features-shaderBufferFloat64Atomics,
    pname:shaderBufferFloat64Atomics>>, or
    <<features-shaderBufferFloat64AtomicAdd,
    pname:shaderBufferFloat64AtomicAdd>>, or
    <<features-shaderBufferFloat16AtomicMinMax,
    pname:shaderBufferFloat16Atomics>>, or
    <<features-shaderBufferFloat16AtomicMinMax,
    pname:shaderBufferFloat16AtomicAdd>>, or
    <<features-shaderBufferFloat16AtomicMinMax,
    pname:shaderBufferFloat16AtomicMinMax>>, or
    <<features-shaderBufferFloat32AtomicMinMax,
    pname:shaderBufferFloat32AtomicMinMax>>, or
    <<features-shaderBufferFloat64AtomicMinMax,
    pname:shaderBufferFloat64AtomicMinMax>> must: be enabled for
    floating-point atomic operations to be supported on a _Pointer_ with a
    {StorageClass} of code:StorageBuffer
  * [[VUID-{refpage}-None-06285]]
    <<features-shaderSharedFloat32Atomics,
    pname:shaderSharedFloat32Atomics>>, or
    <<features-shaderSharedFloat32AtomicAdd,
    pname:shaderSharedFloat32AtomicAdd>>, or
    <<features-shaderSharedFloat64Atomics,
    pname:shaderSharedFloat64Atomics>>, or
    <<features-shaderSharedFloat64AtomicAdd,
    pname:shaderSharedFloat64AtomicAdd>>, or
    <<features-shaderBufferFloat16AtomicMinMax,
    pname:shaderSharedFloat16Atomics>>, or
    <<features-shaderBufferFloat16AtomicMinMax,
    pname:shaderSharedFloat16AtomicAdd>>, or
    <<features-shaderBufferFloat16AtomicMinMax,
    pname:shaderSharedFloat16AtomicMinMax>>, or
    <<features-shaderSharedFloat32AtomicMinMax,
    pname:shaderSharedFloat32AtomicMinMax>>, or
    <<features-shaderSharedFloat64AtomicMinMax,
    pname:shaderSharedFloat64AtomicMinMax>> must: be enabled for
    floating-point atomic operations to be supported on a _Pointer_ with a
    {StorageClass} of code:Workgroup
  * [[VUID-{refpage}-None-06286]]
    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>,
    or <<features-shaderImageFloat32AtomicAdd,
    pname:shaderImageFloat32AtomicAdd>>, or
    <<features-shaderImageFloat32AtomicMinMax,
    pname:shaderImageFloat32AtomicMinMax>> must: be enabled for 32-bit
    floating-point atomic operations to be supported on a _Pointer_ with a
    {StorageClass} of code:Image
  * [[VUID-{refpage}-None-06287]]
    <<features-sparseImageFloat32Atomics, pname:sparseImageFloat32Atomics>>,
    or <<features-sparseImageFloat32AtomicAdd,
    pname:sparseImageFloat32AtomicAdd>>, or
    <<features-sparseImageFloat32AtomicMinMax,
    pname:sparseImageFloat32AtomicMinMax>> must: be enabled for 32-bit
    floating-point atomics to be supported on sparse images
endif::VK_EXT_shader_atomic_float2[]
ifdef::VK_EXT_shader_image_atomic_int64[]
  * [[VUID-{refpage}-None-06288]]
    <<features-shaderImageInt64Atomics, pname:shaderImageInt64Atomics>>
    must: be enabled for 64-bit integer atomic operations to be supported on
    a _Pointer_ with a {StorageClass} of code:Image
endif::VK_EXT_shader_image_atomic_int64[]
ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
  * [[VUID-{refpage}-denormBehaviorIndependence-06289]]
    If <<features-denormBehaviorIndependence,
    pname:denormBehaviorIndependence>> is
    ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, then the entry
    point must: use the same denormals {ExecutionMode} for both 16-bit and
    64-bit floating-point types
  * [[VUID-{refpage}-denormBehaviorIndependence-06290]]
    If <<features-denormBehaviorIndependence,
    pname:denormBehaviorIndependence>> is
    ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, then the entry point
    must: use the same denormals {ExecutionMode} for all floating-point
    types
  * [[VUID-{refpage}-roundingModeIndependence-06291]]
    If <<features-roundingModeIndependence, pname:roundingModeIndependence>>
    is ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY, then the
    entry point must: use the same rounding {ExecutionMode} for both 16-bit
    and 64-bit floating-point types
  * [[VUID-{refpage}-roundingModeIndependence-06292]]
    If <<features-roundingModeIndependence, pname:roundingModeIndependence>>
    is ename:VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE, then the entry
    point must: use the same rounding {ExecutionMode} for all floating-point
    types
  * [[VUID-{refpage}-shaderSignedZeroInfNanPreserveFloat16-06293]]
    If <<limits-shaderSignedZeroInfNanPreserveFloat16,
    pname:shaderSignedZeroInfNanPreserveFloat16>> is ename:VK_FALSE, then
    code:SignedZeroInfNanPreserve for 16-bit floating-point type must: not
    be used
  * [[VUID-{refpage}-shaderSignedZeroInfNanPreserveFloat32-06294]]
    If <<limits-shaderSignedZeroInfNanPreserveFloat32,
    pname:shaderSignedZeroInfNanPreserveFloat32>> is ename:VK_FALSE, then
    code:SignedZeroInfNanPreserve for 32-bit floating-point type must: not
    be used
  * [[VUID-{refpage}-shaderSignedZeroInfNanPreserveFloat64-06295]]
    If <<limits-shaderSignedZeroInfNanPreserveFloat64,
    pname:shaderSignedZeroInfNanPreserveFloat64>> is ename:VK_FALSE, then
    code:SignedZeroInfNanPreserve for 64-bit floating-point type must: not
    be used
  * [[VUID-{refpage}-shaderDenormPreserveFloat16-06296]]
    If <<limits-shaderDenormPreserveFloat16,
    pname:shaderDenormPreserveFloat16>> is ename:VK_FALSE, then
    code:DenormPreserve for 16-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderDenormPreserveFloat32-06297]]
    If <<limits-shaderDenormPreserveFloat32,
    pname:shaderDenormPreserveFloat32>> is ename:VK_FALSE, then
    code:DenormPreserve for 32-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderDenormPreserveFloat64-06298]]
    If <<limits-shaderDenormPreserveFloat64,
    pname:shaderDenormPreserveFloat64>> is ename:VK_FALSE, then
    code:DenormPreserve for 64-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderDenormFlushToZeroFloat16-06299]]
    If <<limits-shaderDenormFlushToZeroFloat16,
    pname:shaderDenormFlushToZeroFloat16>> is ename:VK_FALSE, then
    code:DenormFlushToZero for 16-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderDenormFlushToZeroFloat32-06300]]
    If <<limits-shaderDenormFlushToZeroFloat32,
    pname:shaderDenormFlushToZeroFloat32>> is ename:VK_FALSE, then
    code:DenormFlushToZero for 32-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderDenormFlushToZeroFloat64-06301]]
    If <<limits-shaderDenormFlushToZeroFloat64,
    pname:shaderDenormFlushToZeroFloat64>> is ename:VK_FALSE, then
    code:DenormFlushToZero for 64-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderRoundingModeRTEFloat16-06302]]
    If <<limits-shaderRoundingModeRTEFloat16,
    pname:shaderRoundingModeRTEFloat16>> is ename:VK_FALSE, then
    code:RoundingModeRTE for 16-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderRoundingModeRTEFloat32-06303]]
    If <<limits-shaderRoundingModeRTEFloat32,
    pname:shaderRoundingModeRTEFloat32>> is ename:VK_FALSE, then
    code:RoundingModeRTE for 32-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderRoundingModeRTEFloat64-06304]]
    If <<limits-shaderRoundingModeRTEFloat64,
    pname:shaderRoundingModeRTEFloat64>> is ename:VK_FALSE, then
    code:RoundingModeRTE for 64-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderRoundingModeRTZFloat16-06305]]
    If <<limits-shaderRoundingModeRTZFloat16,
    pname:shaderRoundingModeRTZFloat16>> is ename:VK_FALSE, then
    code:RoundingModeRTZ for 16-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderRoundingModeRTZFloat32-06306]]
    If <<limits-shaderRoundingModeRTZFloat32,
    pname:shaderRoundingModeRTZFloat32>> is ename:VK_FALSE, then
    code:RoundingModeRTZ for 32-bit floating-point type must: not be used
  * [[VUID-{refpage}-shaderRoundingModeRTZFloat64-06307]]
    If <<limits-shaderRoundingModeRTZFloat64,
    pname:shaderRoundingModeRTZFloat64>> is ename:VK_FALSE, then
    code:RoundingModeRTZ for 64-bit floating-point type must: not be used
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
ifdef::VK_EXT_transform_feedback[]
  * [[VUID-{refpage}-Offset-06308]]
    The code:Offset plus size of the type of each variable, in the output
    interface of the entry point being compiled, decorated with
    code:XfbBuffer must: not be greater than
    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackBufferDataSize
  * [[VUID-{refpage}-XfbBuffer-06309]]
    For any given code:XfbBuffer value, define the buffer data size to be
    smallest number of bytes such that, for all outputs decorated with the
    same code:XfbBuffer value, the size of the output interface variable
    plus the code:Offset is less than or equal to the buffer data size.
    For a given code:Stream, the sum of all the buffer data sizes for all
    buffers writing to that stream the must: not exceed
    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackStreamDataSize
  * [[VUID-{refpage}-OpEmitStreamVertex-06310]]
    The Stream value to code:OpEmitStreamVertex and
    code:OpEndStreamPrimitive must: be less than
    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackStreams
  * [[VUID-{refpage}-transformFeedbackStreamsLinesTriangles-06311]]
    If the geometry shader emits to more than one vertex stream and
    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:transformFeedbackStreamsLinesTriangles
    is ename:VK_FALSE, then {ExecutionMode} must: be code:OutputPoints
  * [[VUID-{refpage}-Stream-06312]]
    The stream number value to code:Stream must: be less than
    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackStreams
  * [[VUID-{refpage}-XfbStride-06313]]
    The XFB Stride value to code:XfbStride must: be less than or equal to
    slink:VkPhysicalDeviceTransformFeedbackPropertiesEXT::pname:maxTransformFeedbackBufferDataStride
endif::VK_EXT_transform_feedback[]
ifdef::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
  * [[VUID-{refpage}-PhysicalStorageBuffer64-06314]]
    If the code:PhysicalStorageBuffer64 addressing model is enabled any load
    or store through a physical pointer type must: be aligned to a multiple
    of the size of the largest scalar type in the pointed-to type
  * [[VUID-{refpage}-PhysicalStorageBuffer64-06315]]
    If the code:PhysicalStorageBuffer64 addressing model is enabled the
    pointer value of a memory access instruction must: be at least as
    aligned as specified by the code:Aligned memory access operand
endif::VK_VERSION_1_2,VK_EXT_buffer_device_address,VK_KHR_buffer_device_address[]
ifdef::VK_NV_cooperative_matrix[]
  * [[VUID-{refpage}-OpTypeCooperativeMatrixNV-06316]]
    For code:OpTypeCooperativeMatrixNV, the component type, scope, number of
    rows, and number of columns must: match one of the matrices in any of
    the supported slink:VkCooperativeMatrixPropertiesNV
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06317]]
    For code:OpCooperativeMatrixMulAddNV, the type of code:A must: have
    slink:VkCooperativeMatrixPropertiesNV::pname:MSize rows and
    slink:VkCooperativeMatrixPropertiesNV::pname:KSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesNV::pname:AType
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06318]]
    For code:OpCooperativeMatrixMulAddNV, the type of code:B must: have
    slink:VkCooperativeMatrixPropertiesNV::pname:KSize rows and
    slink:VkCooperativeMatrixPropertiesNV::pname:NSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesNV::pname:BType
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06319]]
    For code:OpCooperativeMatrixMulAddNV, the type of code:C must: have
    slink:VkCooperativeMatrixPropertiesNV::pname:MSize rows and
    slink:VkCooperativeMatrixPropertiesNV::pname:NSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesNV::pname:CType
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06320]]
    For code:OpCooperativeMatrixMulAddNV, the type of code:Result must: have
    slink:VkCooperativeMatrixPropertiesNV::pname:MSize rows and
    slink:VkCooperativeMatrixPropertiesNV::pname:NSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesNV::pname:DType
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddNV-06321]]
    For code:OpCooperativeMatrixMulAddNV, the type of code:A, code:B,
    code:C, and code:Result must: all have a scope of pname:scope
  * [[VUID-{refpage}-OpTypeCooperativeMatrixNV-06322]]
    code:OpTypeCooperativeMatrixNV and code:OpCooperativeMatrix*
    instructions must: not be used in shader stages not included in
    slink:VkPhysicalDeviceCooperativeMatrixPropertiesNV::pname:cooperativeMatrixSupportedStages
endif::VK_NV_cooperative_matrix[]
ifdef::VK_KHR_cooperative_matrix[]
  * [[VUID-{refpage}-OpTypeCooperativeMatrixKHR-08974]]
    For code:OpTypeCooperativeMatrixKHR, the component type, scope, number
    of rows, and number of columns must: match one of the matrices in any of
    the supported slink:VkCooperativeMatrixPropertiesKHR.
  * [[VUID-{refpage}-MSize-08975]]
    For code:OpCooperativeMatrixMulAddKHR, the type of code:A must: have
    slink:VkCooperativeMatrixPropertiesKHR::pname:MSize rows and
    slink:VkCooperativeMatrixPropertiesKHR::pname:KSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesKHR::pname:AType.
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08976]]
    For code:OpCooperativeMatrixMulAddKHR, when the component type of code:A
    is a signed integer type, the code:MatrixASignedComponents cooperative
    matrix operand must: be present.
  * [[VUID-{refpage}-KSize-08977]]
    For code:OpCooperativeMatrixMulAddKHR, the type of code:B must: have
    slink:VkCooperativeMatrixPropertiesKHR::pname:KSize rows and
    slink:VkCooperativeMatrixPropertiesKHR::pname:NSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesKHR::pname:BType.
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08978]]
    For code:OpCooperativeMatrixMulAddKHR, when the component type of code:B
    is a signed integer type, the code:MatrixBSignedComponents cooperative
    matrix operand must: be present.
  * [[VUID-{refpage}-MSize-08979]]
    For code:OpCooperativeMatrixMulAddKHR, the type of code:C must: have
    slink:VkCooperativeMatrixPropertiesKHR::pname:MSize rows and
    slink:VkCooperativeMatrixPropertiesKHR::pname:NSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesKHR::pname:CType.
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08980]]
    For code:OpCooperativeMatrixMulAddKHR, when the component type of code:C
    is a signed integer type, the code:MatrixCSignedComponents cooperative
    matrix operand must: be present.
  * [[VUID-{refpage}-MSize-08981]]
    For code:OpCooperativeMatrixMulAddKHR, the type of code:Result must:
    have slink:VkCooperativeMatrixPropertiesKHR::pname:MSize rows and
    slink:VkCooperativeMatrixPropertiesKHR::pname:NSize columns and have a
    component type that matches
    slink:VkCooperativeMatrixPropertiesKHR::pname:ResultType.
  * [[VUID-{refpage}-OpCooperativeMatrixMulAddKHR-08982]]
    For code:OpCooperativeMatrixMulAddKHR, when the component type of
    code:Result is a signed integer type, the
    code:MatrixResultSignedComponents cooperative matrix operand must: be
    present.
  * [[VUID-{refpage}-saturatingAccumulation-08983]]
    For code:OpCooperativeMatrixMulAddKHR, the code:SaturatingAccumulation
    cooperative matrix operand must: be present if and only if
    slink:VkCooperativeMatrixPropertiesKHR::pname:saturatingAccumulation is
    ename:VK_TRUE.
  * [[VUID-{refpage}-scope-08984]]
    For code:OpCooperativeMatrixMulAddKHR, the type of code:A, code:B,
    code:C, and code:Result must: all have a scope of pname:scope.
  * [[VUID-{refpage}-cooperativeMatrixSupportedStages-08985]]
    code:OpTypeCooperativeMatrixKHR and code:OpCooperativeMatrix*
    instructions must: not be used in shader stages not included in
    slink:VkPhysicalDeviceCooperativeMatrixPropertiesKHR::pname:cooperativeMatrixSupportedStages.
endif::VK_KHR_cooperative_matrix[]
  * [[VUID-{refpage}-DescriptorSet-06323]]
    code:DescriptorSet and code:Binding decorations must: obey the
    constraints on {StorageClass}, type, and descriptor type described in
    <<interfaces-resources-setandbinding,DescriptorSet and Binding
    Assignment>>
ifdef::VK_NV_cooperative_matrix[]
  * [[VUID-{refpage}-OpCooperativeMatrixLoadNV-06324]]
    For code:OpCooperativeMatrixLoadNV and code:OpCooperativeMatrixStoreNV
    instructions, the code:Pointer and code:Stride operands must: be aligned
    to at least the lesser of 16 bytes or the natural alignment of a row or
    column (depending on code:ColumnMajor) of the matrix (where the natural
    alignment is the number of columns/rows multiplied by the component
    size)
endif::VK_NV_cooperative_matrix[]
ifdef::VK_NV_mesh_shader[]
  * [[VUID-{refpage}-MeshNV-07113]]
    For mesh shaders using the code:MeshNV {ExecutionModel} the
    code:OutputVertices code:OpExecutionMode must: be less than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxMeshOutputVertices
  * [[VUID-{refpage}-MeshNV-07114]]
    For mesh shaders using the code:MeshNV {ExecutionModel} the
    code:OutputPrimitivesNV code:OpExecutionMode must: be less than or equal
    to
    slink:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxMeshOutputPrimitives
endif::VK_NV_mesh_shader[]
ifdef::VK_EXT_mesh_shader[]
  * [[VUID-{refpage}-MeshEXT-07115]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the
    code:OutputVertices code:OpExecutionMode must: be less than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshOutputVertices
  * [[VUID-{refpage}-MeshEXT-07332]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the "`Vertex
    Count`" operand of code:OpSetMeshOutputsEXT must: be less than or equal
    to code:OutputVertices code:OpExecutionMode
  * [[VUID-{refpage}-MeshEXT-07116]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the
    code:OutputPrimitivesEXT code:OpExecutionMode must: be less than or
    equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshOutputPrimitives
  * [[VUID-{refpage}-MeshEXT-07333]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the "`Primitive
    Count`" operand of code:OpSetMeshOutputsEXT must: be less than or equal
    to code:OutputPrimitivesEXT code:OpExecutionMode
  * [[VUID-{refpage}-TaskEXT-07117]]
    In task shaders using the code:TaskEXT {ExecutionModel}
    code:OpEmitMeshTasksEXT must: be called exactly once under dynamically
    uniform conditions
  * [[VUID-{refpage}-MeshEXT-07118]]
    In mesh shaders using the code:MeshEXT {ExecutionModel}
    code:OpSetMeshOutputsEXT must: be called at most once under dynamically
    uniform conditions
  * [[VUID-{refpage}-TaskEXT-07291]]
    In task shaders using the code:TaskEXT {ExecutionModel} the pname:x size
    in code:LocalSize or code:LocalSizeId must: be less than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupSize[0]
  * [[VUID-{refpage}-TaskEXT-07292]]
    In task shaders using the code:TaskEXT {ExecutionModel} the pname:y size
    in code:LocalSize or code:LocalSizeId must: be less than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupSize[1]
  * [[VUID-{refpage}-TaskEXT-07293]]
    In task shaders using the code:TaskEXT {ExecutionModel} the pname:z size
    in code:LocalSize or code:LocalSizeId must: be less than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupSize[2]
  * [[VUID-{refpage}-TaskEXT-07294]]
    In task shaders using the code:TaskEXT {ExecutionModel} the product of
    pname:x size, pname:y size, and pname:z size in code:LocalSize or
    code:LocalSizeId must: be less than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxTaskWorkGroupInvocations
  * [[VUID-{refpage}-MeshEXT-07295]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the pname:x
    size in code:LocalSize or code:LocalSizeId must: be less than or equal
    to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupSize[0]
  * [[VUID-{refpage}-MeshEXT-07296]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the pname:y
    size in code:LocalSize or code:LocalSizeId must: be less than or equal
    to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupSize[1]
  * [[VUID-{refpage}-MeshEXT-07297]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the pname:z
    size in code:LocalSize or code:LocalSizeId must: be less than or equal
    to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupSize[2]
  * [[VUID-{refpage}-MeshEXT-07298]]
    For mesh shaders using the code:MeshEXT {ExecutionModel} the product of
    pname:x size, pname:y size, and pname:z size in code:LocalSize or
    code:LocalSizeId must: be less than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupInvocations
  * [[VUID-{refpage}-TaskEXT-07299]]
    In task shaders using the code:TaskEXT {ExecutionModel} the value of the
    "`Group Count X`" operand of code:OpEmitMeshTasksEXT must: be less than
    or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupCount[0]
  * [[VUID-{refpage}-TaskEXT-07300]]
    In task shaders using the code:TaskEXT {ExecutionModel} the value of the
    "`Group Count Y`" operand of code:OpEmitMeshTasksEXT must: be less than
    or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupCount[1]
  * [[VUID-{refpage}-TaskEXT-07301]]
    In task shaders using the code:TaskEXT {ExecutionModel} the value of the
    "`Group Count Z`" operand of code:OpEmitMeshTasksEXT must: be less than
    or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupCount[2]
  * [[VUID-{refpage}-TaskEXT-07302]]
    In task shaders using the code:TaskEXT {ExecutionModel} the product of
    the "`Group Count`" operands of code:OpEmitMeshTasksEXT must: be less
    than or equal to
    slink:VkPhysicalDeviceMeshShaderPropertiesEXT::pname:maxMeshWorkGroupTotalCount
  * [[VUID-{refpage}-maxMeshSharedMemorySize-08754]]
    The sum of size in bytes for variables and <<workgroup-padding,
    padding>> in the code:Workgroup {StorageClass} in the code:MeshEXT
    {ExecutionModel} must: be less than or equal to
    <<limits-maxMeshSharedMemorySize, pname:maxMeshSharedMemorySize>>
  * [[VUID-{refpage}-maxMeshPayloadAndSharedMemorySize-08755]]
    The sum of size in bytes for variables and <<workgroup-padding,
    padding>> in the code:TaskPayloadWorkgroupEXT or code:Workgroup
    {StorageClass} in the code:MeshEXT {ExecutionModel} must: be less than
    or equal to <<limits-maxMeshPayloadAndSharedMemorySize,
    pname:maxMeshPayloadAndSharedMemorySize>>
  * [[VUID-{refpage}-maxMeshOutputMemorySize-08756]]
    The sum of size in bytes for variables in the code:Output {StorageClass}
    in the code:MeshEXT {ExecutionModel} must: be less than or equal to
    <<limits-maxMeshOutputMemorySize, pname:maxMeshOutputMemorySize>>
    according to the formula in <<mesh-output, Mesh Shader Output>>
  * [[VUID-{refpage}-maxMeshPayloadAndOutputMemorySize-08757]]
    The sum of size in bytes for variables and in the
    code:TaskPayloadWorkgroupEXT or code:Output {StorageClass} in the
    code:MeshEXT {ExecutionModel} must: be less than or equal to
    <<limits-maxMeshPayloadAndOutputMemorySize,
    pname:maxMeshPayloadAndOutputMemorySize>> according to the formula in
    <<mesh-output, Mesh Shader Output>>
  * [[VUID-{refpage}-maxTaskPayloadSize-08758]]
    The sum of size in bytes for variables and in the
    code:TaskPayloadWorkgroupEXT {StorageClass} in the code:TaskEXT
    {ExecutionModel} must: be less than or equal to
    <<limits-maxTaskPayloadSize, pname:maxTaskPayloadSize>>
  * [[VUID-{refpage}-maxTaskSharedMemorySize-08759]]
    The sum of size in bytes for variables and <<workgroup-padding,
    padding>> in the code:Workgroup {StorageClass} in the code:TaskEXT
    {ExecutionModel} must: be less than or equal to
    <<limits-maxTaskSharedMemorySize, pname:maxTaskSharedMemorySize>>
  * [[VUID-{refpage}-maxTaskPayloadAndSharedMemorySize-08760]]
    The sum of size in bytes for variables and <<workgroup-padding,
    padding>> in the code:TaskPayloadWorkgroupEXT or code:Workgroup
    {StorageClass} in the code:TaskEXT {ExecutionModel} must: be less than
    or equal to <<limits-maxTaskPayloadAndSharedMemorySize,
    pname:maxTaskPayloadAndSharedMemorySize>>
endif::VK_EXT_mesh_shader[]
ifdef::VK_KHR_cooperative_matrix[]
  * [[VUID-{refpage}-OpCooperativeMatrixLoadKHR-08986]]
    For code:OpCooperativeMatrixLoadKHR and code:OpCooperativeMatrixStoreKHR
    instructions, the code:Pointer and code:Stride operands must: be aligned
    to at least the lesser of 16 bytes or the natural alignment of a row or
    column (depending on code:ColumnMajor) of the matrix (where the natural
    alignment is the number of columns/rows multiplied by the component
    size).
endif::VK_KHR_cooperative_matrix[]
ifdef::VK_KHR_portability_subset[]
  * [[VUID-{refpage}-shaderSampleRateInterpolationFunctions-06325]]
    If the `apiext:VK_KHR_portability_subset` extension is enabled, and
    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:shaderSampleRateInterpolationFunctions
    is ename:VK_FALSE, then `GLSL.std.450` fragment interpolation functions
    are not supported by the implementation and code:OpCapability must: not
    be set to code:InterpolationFunction
  * [[VUID-{refpage}-tessellationShader-06326]]
    If <<features-tessellationShader, pname:tessellationShader>> is enabled,
    and the `apiext:VK_KHR_portability_subset` extension is enabled, and
    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationIsolines
    is ename:VK_FALSE, then code:OpExecutionMode must: not be set to
    code:IsoLines
  * [[VUID-{refpage}-tessellationShader-06327]]
    If <<features-tessellationShader, pname:tessellationShader>> is enabled,
    and the `apiext:VK_KHR_portability_subset` extension is enabled, and
    slink:VkPhysicalDevicePortabilitySubsetFeaturesKHR::pname:tessellationPointMode
    is ename:VK_FALSE, then code:OpExecutionMode must: not be set to
    code:PointMode
endif::VK_KHR_portability_subset[]
ifdef::VK_KHR_8bit_storage[]
  * [[VUID-{refpage}-storageBuffer8BitAccess-06328]]
    If <<features-storageBuffer8BitAccess, pname:storageBuffer8BitAccess>>
    is ename:VK_FALSE, then objects containing an 8-bit integer element
    must: not have {StorageClass} of code:StorageBuffer,
    code:ShaderRecordBufferKHR, or code:PhysicalStorageBuffer
  * [[VUID-{refpage}-uniformAndStorageBuffer8BitAccess-06329]]
    If <<features-uniformAndStorageBuffer8BitAccess,
    pname:uniformAndStorageBuffer8BitAccess>> is ename:VK_FALSE, then
    objects in the code:Uniform {StorageClass} with the code:Block
    decoration must: not have an 8-bit integer member
  * [[VUID-{refpage}-storagePushConstant8-06330]]
    If <<features-storagePushConstant8, pname:storagePushConstant8>> is
    ename:VK_FALSE, then objects containing an 8-bit integer element must:
    not have {StorageClass} of code:PushConstant
endif::VK_KHR_8bit_storage[]
ifdef::VK_KHR_16bit_storage[]
  * [[VUID-{refpage}-storageBuffer16BitAccess-06331]]
    If <<features-storageBuffer16BitAccess, pname:storageBuffer16BitAccess>>
    is ename:VK_FALSE, then objects containing 16-bit integer or 16-bit
    floating-point elements must: not have {StorageClass} of
    code:StorageBuffer, code:ShaderRecordBufferKHR, or
    code:PhysicalStorageBuffer
  * [[VUID-{refpage}-uniformAndStorageBuffer16BitAccess-06332]]
    If <<features-uniformAndStorageBuffer16BitAccess,
    pname:uniformAndStorageBuffer16BitAccess>> is ename:VK_FALSE, then
    objects in the code:Uniform {StorageClass} with the code:Block
    decoration must: not have 16-bit integer or 16-bit floating-point
    members
  * [[VUID-{refpage}-storagePushConstant16-06333]]
    If <<features-storagePushConstant16, pname:storagePushConstant16>> is
    ename:VK_FALSE, then objects containing 16-bit integer or 16-bit
    floating-point elements must: not have {StorageClass} of
    code:PushConstant
  * [[VUID-{refpage}-storageInputOutput16-06334]]
    If <<features-storageInputOutput16, pname:storageInputOutput16>> is
    ename:VK_FALSE, then objects containing 16-bit integer or 16-bit
    floating-point elements must: not have {StorageClass} of code:Input or
    code:Output
endif::VK_KHR_16bit_storage[]
ifdef::VK_EXT_shader_atomic_float[]
ifndef::VK_EXT_shader_atomic_float2[]
  * [[VUID-{refpage}-None-06335]]
    <<features-shaderBufferFloat32Atomics,
    pname:shaderBufferFloat32Atomics>>, or
    <<features-shaderBufferFloat32AtomicAdd,
    pname:shaderBufferFloat32AtomicAdd>>, or
    <<features-shaderSharedFloat32Atomics,
    pname:shaderSharedFloat32Atomics>>, or
    <<features-shaderSharedFloat32AtomicAdd,
    pname:shaderSharedFloat32AtomicAdd>>, or
    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>,
    or <<features-shaderImageFloat32AtomicAdd,
    pname:shaderImageFloat32AtomicAdd>> must: be enabled for 32-bit floating
    point atomic operations
  * [[VUID-{refpage}-None-06336]]
    <<features-shaderBufferFloat64Atomics,
    pname:shaderBufferFloat64Atomics>>, or
    <<features-shaderBufferFloat64AtomicAdd,
    pname:shaderBufferFloat64AtomicAdd>>, or
    <<features-shaderSharedFloat64Atomics,
    pname:shaderSharedFloat64Atomics>>, or
    <<features-shaderSharedFloat64AtomicAdd,
    pname:shaderSharedFloat64AtomicAdd>> must: be enabled for 64-bit
    floating point atomic operations
endif::VK_EXT_shader_atomic_float2[]
endif::VK_EXT_shader_atomic_float[]
ifdef::VK_EXT_shader_atomic_float2[]
  * [[VUID-{refpage}-None-06337]]
    <<features-shaderBufferFloat16Atomics,
    pname:shaderBufferFloat16Atomics>>, or
    <<features-shaderBufferFloat16AtomicAdd,
    pname:shaderBufferFloat16AtomicAdd>>, or
    <<features-shaderBufferFloat16AtomicMinMax,
    pname:shaderBufferFloat16AtomicMinMax>>, or
    <<features-shaderSharedFloat16Atomics,
    pname:shaderSharedFloat16Atomics>>, or
    <<features-shaderSharedFloat16AtomicAdd,
    pname:shaderSharedFloat16AtomicAdd>>, or
    <<features-shaderSharedFloat16AtomicMinMax,
    pname:shaderSharedFloat16AtomicMinMax>> must: be enabled for 16-bit
    floating point atomic operations
  * [[VUID-{refpage}-None-06338]]
    <<features-shaderBufferFloat32Atomics,
    pname:shaderBufferFloat32Atomics>>, or
    <<features-shaderBufferFloat32AtomicAdd,
    pname:shaderBufferFloat32AtomicAdd>>, or
    <<features-shaderSharedFloat32Atomics,
    pname:shaderSharedFloat32Atomics>>, or
    <<features-shaderSharedFloat32AtomicAdd,
    pname:shaderSharedFloat32AtomicAdd>>, or
    <<features-shaderImageFloat32Atomics, pname:shaderImageFloat32Atomics>>,
    or <<features-shaderImageFloat32AtomicAdd,
    pname:shaderImageFloat32AtomicAdd>> or
    <<features-shaderBufferFloat32AtomicMinMax,
    pname:shaderBufferFloat32AtomicMinMax>>, or
    <<features-shaderSharedFloat32AtomicMinMax,
    pname:shaderSharedFloat32AtomicMinMax>>, or
    <<features-shaderImageFloat32AtomicMinMax,
    pname:shaderImageFloat32AtomicMinMax>> must: be enabled for 32-bit
    floating point atomic operations
  * [[VUID-{refpage}-None-06339]]
    <<features-shaderBufferFloat64Atomics,
    pname:shaderBufferFloat64Atomics>>, or
    <<features-shaderBufferFloat64AtomicAdd,
    pname:shaderBufferFloat64AtomicAdd>>, or
    <<features-shaderSharedFloat64Atomics,
    pname:shaderSharedFloat64Atomics>>, or
    <<features-shaderSharedFloat64AtomicAdd,
    pname:shaderSharedFloat64AtomicAdd>>, or
    <<features-shaderBufferFloat64AtomicMinMax,
    pname:shaderBufferFloat64AtomicMinMax>>, or
    <<features-shaderSharedFloat64AtomicMinMax,
    pname:shaderSharedFloat64AtomicMinMax>>, must: be enabled for 64-bit
    floating point atomic operations
endif::VK_EXT_shader_atomic_float2[]
  * [[VUID-{refpage}-NonWritable-06340]]
    If <<features-fragmentStoresAndAtomics, pname:fragmentStoresAndAtomics>>
    is not enabled, then all storage image, storage texel buffer, and
    storage buffer variables in the fragment stage must: be decorated with
    the code:NonWritable decoration
  * [[VUID-{refpage}-NonWritable-06341]]
    If <<features-vertexPipelineStoresAndAtomics,
    pname:vertexPipelineStoresAndAtomics>> is not enabled, then all storage
    image, storage texel buffer, and storage buffer variables in the vertex,
    tessellation, and geometry stages must: be decorated with the
    code:NonWritable decoration
ifdef::VKSC_VERSION_1_0[]
  * [[VUID-{refpage}-OpAtomic-05091]]
    If <<features-shaderAtomicInstructions, shaderAtomicInstructions>> is
    not enabled, the SPIR-V Atomic Instructions listed in 3.37.18
    (code:OpAtomic*) must: not be used <<SCID-1>>
endif::VKSC_VERSION_1_0[]
  * [[VUID-{refpage}-None-06342]]
    If <<limits-subgroupQuadOperationsInAllStages,
    pname:subgroupQuadOperationsInAllStages>> is ename:VK_FALSE, then
    <<features-subgroup-quad, quad subgroup operations>> must: not be used
    except for in fragment and compute stages
ifdef::VK_VERSION_1_1[]
  * [[VUID-{refpage}-None-06343]]
    <<shaders-group-operations, Group operations>> with
    <<shaders-scope-subgroup, subgroup scope>> must: not be used if the
    shader stage is not in <<limits-subgroupSupportedStages,
    pname:subgroupSupportedStages>>
endif::VK_VERSION_1_1[]
  * [[VUID-{refpage}-Offset-06344]]
    The first element of the code:Offset operand of code:InterpolateAtOffset
    must: be greater than or equal to: +
    [eq]#frag~width~ {times} <<limits-minInterpolationOffset,
    pname:minInterpolationOffset>># +
    where [eq]#frag~width~# is the width of the current fragment in pixels
  * [[VUID-{refpage}-Offset-06345]]
    The first element of the code:Offset operand of code:InterpolateAtOffset
    must: be less than or equal to +
    [eq]#frag~width~ {times} (<<limits-maxInterpolationOffset,
    pname:maxInterpolationOffset>> {plus} ULP ) - ULP# +
    where [eq]#frag~width~# is the width of the current fragment in pixels
    and [eq]#ULP = 1 / 2^<<limits-subPixelInterpolationOffsetBits,
    pname:subPixelInterpolationOffsetBits>>^#
  * [[VUID-{refpage}-Offset-06346]]
    The second element of the code:Offset operand of
    code:InterpolateAtOffset must: be greater than or equal to +
    [eq]#frag~height~ {times} <<limits-minInterpolationOffset,
    pname:minInterpolationOffset>># +
    where [eq]#frag~height~# is the height of the current fragment in pixels
  * [[VUID-{refpage}-Offset-06347]]
    The second element of the code:Offset operand of
    code:InterpolateAtOffset must: be less than or equal to +
    [eq]#frag~height~ {times} (<<limits-maxInterpolationOffset,
    pname:maxInterpolationOffset>> {plus} ULP ) - ULP# +
    where [eq]#frag~height~# is the height of the current fragment in pixels
    and [eq]#ULP = 1 / 2^<<limits-subPixelInterpolationOffsetBits,
    pname:subPixelInterpolationOffsetBits>>^#.

ifdef::VK_KHR_ray_query[]
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06348]]
    For code:OpRayQueryInitializeKHR instructions, all components of the
    code:RayOrigin and code:RayDirection operands must: be finite
    floating-point values
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06349]]
    For code:OpRayQueryInitializeKHR instructions, the code:RayTmin and
    code:RayTmax operands must: be non-negative floating-point values
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06350]]
    For code:OpRayQueryInitializeKHR instructions, the code:RayTmin operand
    must: be less than or equal to the code:RayTmax operand
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06351]]
    For code:OpRayQueryInitializeKHR instructions, code:RayOrigin,
    code:RayDirection, code:RayTmin, and code:RayTmax operands must: not
    contain NaNs
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06352]]
    For code:OpRayQueryInitializeKHR instructions, code:Acceleration
    code:Structure must: be an acceleration structure built as a
    <<acceleration-structure-top-level, top-level acceleration structure>>
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06889]]
    For code:OpRayQueryInitializeKHR instructions, the code:Rayflags operand
    must: not contain both code:SkipTrianglesKHR and code:SkipAABBsKHR
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06890]]
    For code:OpRayQueryInitializeKHR instructions, the code:Rayflags operand
    must: not contain more than one of code:SkipTrianglesKHR,
    code:CullBackFacingTrianglesKHR, and code:CullFrontFacingTrianglesKHR
  * [[VUID-{refpage}-OpRayQueryInitializeKHR-06891]]
    For code:OpRayQueryInitializeKHR instructions, the code:Rayflags operand
    must: not contain more than one of code:OpaqueKHR, code:NoOpaqueKHR,
    code:CullOpaqueKHR, and code:CullNoOpaqueKHR
  * [[VUID-{refpage}-OpRayQueryGenerateIntersectionKHR-06353]]
    For code:OpRayQueryGenerateIntersectionKHR instructions, code:Hit code:T
    must: satisfy the condition [eq]##code:RayTmin {leq} code:Hit code:T
    {leq} code:RayTmax##, where code:RayTmin is equal to the value returned
    by code:OpRayQueryGetRayTMinKHR with the same ray query object, and
    code:RayTmax is equal to the value of code:OpRayQueryGetIntersectionTKHR
    for the current committed intersection with the same ray query object
ifdef::VK_NV_ray_tracing_motion_blur[]
  * [[VUID-{refpage}-OpRayQueryGenerateIntersectionKHR-06354]]
    For code:OpRayQueryGenerateIntersectionKHR instructions,
    code:Acceleration code:Structure must: not be built with
    ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags
endif::VK_NV_ray_tracing_motion_blur[]
ifdef::VK_KHR_ray_tracing_position_fetch[]
  * [[VUID-{refpage}-flags-08761]]
    For code:OpRayQueryGetIntersectionTriangleVertexPositionsKHR
    instructions, code:Acceleration code:Structure must: have been built
    with ename:VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_DATA_ACCESS_KHR in
    pname:flags
endif::VK_KHR_ray_tracing_position_fetch[]
endif::VK_KHR_ray_query[]
ifdef::VK_KHR_ray_tracing_pipeline[]
  * [[VUID-{refpage}-OpTraceRayKHR-06355]]
    For code:OpTraceRayKHR instructions, all components of the
    code:RayOrigin and code:RayDirection operands must: be finite
    floating-point values
  * [[VUID-{refpage}-OpTraceRayKHR-06356]]
    For code:OpTraceRayKHR instructions, the code:RayTmin and code:RayTmax
    operands must: be non-negative floating-point values
  * [[VUID-{refpage}-OpTraceRayKHR-06552]]
    For code:OpTraceRayKHR instructions, the code:Rayflags operand must: not
    contain both code:SkipTrianglesKHR and code:SkipAABBsKHR
  * [[VUID-{refpage}-OpTraceRayKHR-06892]]
    For code:OpTraceRayKHR instructions, the code:Rayflags operand must: not
    contain more than one of code:SkipTrianglesKHR,
    code:CullBackFacingTrianglesKHR, and code:CullFrontFacingTrianglesKHR
  * [[VUID-{refpage}-OpTraceRayKHR-06893]]
    For code:OpTraceRayKHR instructions, the code:Rayflags operand must: not
    contain more than one of code:OpaqueKHR, code:NoOpaqueKHR,
    code:CullOpaqueKHR, and code:CullNoOpaqueKHR
  * [[VUID-{refpage}-OpTraceRayKHR-06553]]
    For code:OpTraceRayKHR instructions, if the code:Rayflags operand
    contains code:SkipTrianglesKHR, the pipeline must: not have been created
    with ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR set
  * [[VUID-{refpage}-OpTraceRayKHR-06554]]
    For code:OpTraceRayKHR instructions, if the code:Rayflags operand
    contains code:SkipAABBsKHR, the pipeline must: not have been created
    with ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR set
  * [[VUID-{refpage}-OpTraceRayKHR-06357]]
    For code:OpTraceRayKHR instructions, the code:RayTmin operand must: be
    less than or equal to the code:RayTmax operand
  * [[VUID-{refpage}-OpTraceRayKHR-06358]]
    For code:OpTraceRayKHR instructions, code:RayOrigin, code:RayDirection,
    code:RayTmin, and code:RayTmax operands must: not contain NaNs
  * [[VUID-{refpage}-OpTraceRayKHR-06359]]
    For code:OpTraceRayKHR instructions, code:Acceleration code:Structure
    must: be an acceleration structure built as a
    <<acceleration-structure-top-level, top-level acceleration structure>>
  * [[VUID-{refpage}-OpReportIntersectionKHR-06998]]
    The value of the "`Hit Kind`" operand of code:OpReportIntersectionKHR
    must: be in the range [eq]#[0,127]#
endif::VK_KHR_ray_tracing_pipeline[]
ifdef::VK_NV_ray_tracing_motion_blur[]
  * [[VUID-{refpage}-OpTraceRayKHR-06360]]
    For code:OpTraceRayKHR instructions, if code:Acceleration code:Structure
    was built with ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in
    pname:flags, the pipeline must: have been created with
    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV set
  * [[VUID-{refpage}-OpTraceRayMotionNV-06361]]
    For code:OpTraceRayMotionNV instructions, all components of the
    code:RayOrigin and code:RayDirection operands must: be finite
    floating-point values
  * [[VUID-{refpage}-OpTraceRayMotionNV-06362]]
    For code:OpTraceRayMotionNV instructions, the code:RayTmin and
    code:RayTmax operands must: be non-negative floating-point values
  * [[VUID-{refpage}-OpTraceRayMotionNV-06363]]
    For code:OpTraceRayMotionNV instructions, the code:RayTmin operand must:
    be less than or equal to the code:RayTmax operand
  * [[VUID-{refpage}-OpTraceRayMotionNV-06364]]
    For code:OpTraceRayMotionNV instructions, code:RayOrigin,
    code:RayDirection, code:RayTmin, and code:RayTmax operands must: not
    contain NaNs
  * [[VUID-{refpage}-OpTraceRayMotionNV-06365]]
    For code:OpTraceRayMotionNV instructions, code:Acceleration
    code:Structure must: be an acceleration structure built as a
    <<acceleration-structure-top-level, top-level acceleration structure>>
    with ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags
  * [[VUID-{refpage}-OpTraceRayMotionNV-06366]]
    For code:OpTraceRayMotionNV instructions the code:time operand must: be
    between 0.0 and 1.0
  * [[VUID-{refpage}-OpTraceRayMotionNV-06367]]
    For code:OpTraceRayMotionNV instructions the pipeline must: have been
    created with ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV
    set
endif::VK_NV_ray_tracing_motion_blur[]
ifdef::VK_NV_ray_tracing_invocation_reorder[]
  * [[VUID-{refpage}-OpHitObjectTraceRayMotionNV-07704]]
    For code:OpHitObjectTraceRayMotionNV instructions, if code:Acceleration
    code:Structure was built with
    ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags, the
    pipeline must: have been created with
    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV set
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07705]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, all components of the code:RayOrigin and code:RayDirection
    operands must: be finite floating-point values
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07706]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, the code:RayTmin and code:RayTmax operands must: be
    non-negative floating-point values
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07707]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, the code:RayTmin operand must: be less than or equal to
    the code:RayTmax operand
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07708]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, code:RayOrigin, code:RayDirection, code:RayTmin, and
    code:RayTmax operands must: not contain NaNs
  * [[VUID-{refpage}-OpHitObjectTraceRayMotionNV-07709]]
    For code:OpHitObjectTraceRayMotionNV instructions, code:Acceleration
    code:Structure must: be an acceleration structure built as a
    <<acceleration-structure-top-level, top-level acceleration structure>>
    with ename:VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV in pname:flags
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07710]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions the code:time operand must: be between 0.0 and 1.0
  * [[VUID-{refpage}-OpHitObjectTraceRayMotionNV-07711]]
    For code:OpHitObjectTraceRayMotionNV instructions the pipeline must:
    have been created with
    ename:VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV set
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07712]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, the code:Rayflags operand must: not contain both
    code:SkipTrianglesKHR and code:SkipAABBsKHR
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07713]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, the code:Rayflags operand must: not contain more than one
    of code:SkipTrianglesKHR, code:CullBackFacingTrianglesKHR, and
    code:CullFrontFacingTrianglesKHR
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07714]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, the code:Rayflags operand must: not contain more than one
    of code:OpaqueKHR, code:NoOpaqueKHR, code:CullOpaqueKHR, and
    code:CullNoOpaqueKHR
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07715]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, if the code:Rayflags operand contains
    code:SkipTrianglesKHR, the pipeline must: not have been created with
    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_AABBS_BIT_KHR set
  * [[VUID-{refpage}-OpHitObjectTraceRayNV-07716]]
    For code:OpHitObjectTraceRayNV and code:OpHitObjectTraceRayMotionNV
    instructions, if the code:Rayflags operand contains code:SkipAABBsKHR,
    the pipeline must: not have been created with
    ename:VK_PIPELINE_CREATE_RAY_TRACING_SKIP_TRIANGLES_BIT_KHR set
endif::VK_NV_ray_tracing_invocation_reorder[]
  * [[VUID-{refpage}-x-06429]]
    In compute shaders using the code:GLCompute {ExecutionModel} the pname:x
    size in code:LocalSize or code:LocalSizeId must: be less than or equal
    to slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupSize[0]
  * [[VUID-{refpage}-y-06430]]
    In compute shaders using the code:GLCompute {ExecutionModel} the pname:y
    size in code:LocalSize or code:LocalSizeId must: be less than or equal
    to slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupSize[1]
  * [[VUID-{refpage}-z-06431]]
    In compute shaders using the code:GLCompute {ExecutionModel} the pname:z
    size in code:LocalSize or code:LocalSizeId must: be less than or equal
    to slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupSize[2]
  * [[VUID-{refpage}-x-06432]]
    In compute shaders using the code:GLCompute {ExecutionModel} the product
    of pname:x size, pname:y size, and pname:z size in code:LocalSize or
    code:LocalSizeId must: be less than or equal to
    slink:VkPhysicalDeviceLimits::pname:maxComputeWorkGroupInvocations
ifndef::VK_VERSION_1_3,VK_KHR_maintenance4[]
  * [[VUID-{refpage}-LocalSizeId-06433]]
    The {ExecutionMode} code:LocalSizeId must: not be used
  * [[VUID-{refpage}-OpTypeVector-06816]]
    Any code:OpTypeVector output interface variables must: not have a higher
    code:Component code:Count than a matching code:OpTypeVector input
    interface variable
endif::VK_VERSION_1_3,VK_KHR_maintenance4[]
ifdef::VK_VERSION_1_3,VK_KHR_maintenance4[]
  * [[VUID-{refpage}-LocalSizeId-06434]]
    If {ExecutionMode} code:LocalSizeId is used, <<features-maintenance4,
    pname:maintenance4>> must: be enabled
  * [[VUID-{refpage}-maintenance4-06817]]
    If <<features-maintenance4, pname:maintenance4>> is not enabled, any
    code:OpTypeVector output interface variables must: not have a higher
    code:Component code:Count than a matching code:OpTypeVector input
    interface variable
endif::VK_VERSION_1_3,VK_KHR_maintenance4[]
  * [[VUID-{refpage}-OpEntryPoint-08743]]
    Any <<interfaces-iointerfaces-user,user-defined variables>> shared
    between the code:OpEntryPoint of two shader stages, and declared with
    code:Input as its {StorageClass} for the subsequent shader stage, must:
    have all code:Location slots and code:Component words declared in the
    preceding shader stage's code:OpEntryPoint with code:Output as the
    {StorageClass}
  * [[VUID-{refpage}-OpEntryPoint-07754]]
    Any <<interfaces-iointerfaces-user,user-defined variables>> between the
    code:OpEntryPoint of two shader stages must: have the same type and
    width for each code:Component
  * [[VUID-{refpage}-OpVariable-08746]]
    Any code:OpVariable, code:Block-decorated code:OpTypeStruct, or
    code:Block-decorated code:OpTypeStruct members shared between the
    code:OpEntryPoint of two shader stages must: have matching decorations
    as defined in <<interfaces-iointerfaces-matching,interface matching>>
  * [[VUID-{refpage}-Workgroup-06530]]
    The sum of size in bytes for variables and <<workgroup-padding,
    padding>> in the code:Workgroup {StorageClass} in the code:GLCompute
    {ExecutionModel} must: be less than or equal to
    <<limits-maxComputeSharedMemorySize, pname:maxComputeSharedMemorySize>>
ifdef::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
  * [[VUID-{refpage}-shaderZeroInitializeWorkgroupMemory-06372]]
    If <<features-shaderZeroInitializeWorkgroupMemory,
    pname:shaderZeroInitializeWorkgroupMemory>> is not enabled, any
    code:OpVariable with code:Workgroup as its {StorageClass} must: not have
    an code:Initializer operand
endif::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
ifndef::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
  * [[VUID-{refpage}-OpVariable-06373]]
    Any code:OpVariable with code:Workgroup as its {StorageClass} must: not
    have an code:Initializer operand
endif::VK_VERSION_1_3,VK_KHR_zero_initialize_workgroup_memory[]
  * [[VUID-{refpage}-OpImage-06376]]
    If an code:OpImage*Gather operation has an image operand of code:Offset,
    code:ConstOffset, or code:ConstOffsets the offset value must: be greater
    than or equal to <<limits-minTexelGatherOffset,
    pname:minTexelGatherOffset>>
  * [[VUID-{refpage}-OpImage-06377]]
    If an code:OpImage*Gather operation has an image operand of code:Offset,
    code:ConstOffset, or code:ConstOffsets the offset value must: be less
    than or equal to <<limits-maxTexelGatherOffset,
    pname:maxTexelGatherOffset>>
  * [[VUID-{refpage}-OpImageSample-06435]]
    If an code:OpImageSample* or code:OpImageFetch* operation has an image
    operand of code:ConstOffset then the offset value must: be greater than
    or equal to <<limits-minTexelOffset, pname:minTexelOffset>>
  * [[VUID-{refpage}-OpImageSample-06436]]
    If an code:OpImageSample* or code:OpImageFetch* operation has an image
    operand of code:ConstOffset then the offset value must: be less than or
    equal to <<limits-maxTexelOffset, pname:maxTexelOffset>>
  * [[VUID-{refpage}-samples-08725]]
    If an code:OpTypeImage has an code:MS operand 0, its bound image must:
    have been created with slink:VkImageCreateInfo::pname:samples as
    ename:VK_SAMPLE_COUNT_1_BIT
  * [[VUID-{refpage}-samples-08726]]
    If an code:OpTypeImage has an code:MS operand 1, its bound image must:
    not have been created with slink:VkImageCreateInfo::pname:samples as
    ename:VK_SAMPLE_COUNT_1_BIT
ifdef::VK_QCOM_render_pass_shader_resolve[]
  * [[VUID-{refpage}-SampleRateShading-06378]]
    If the subpass description contains
    ename:VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM, then the SPIR-V
    fragment shader Capability code:SampleRateShading must: not be enabled
endif::VK_QCOM_render_pass_shader_resolve[]
ifdef::VK_KHR_shader_subgroup_uniform_control_flow[]
  * [[VUID-{refpage}-SubgroupUniformControlFlowKHR-06379]]
    The {ExecutionMode} code:SubgroupUniformControlFlowKHR must: not be
    applied to an entry point unless
    <<features-shaderSubgroupUniformControlFlow,
    pname:shaderSubgroupUniformControlFlow>> is enabled and the
    corresponding shader stage bit is set in subgroup
    <<limits-subgroup-supportedStages, pname:supportedStages>> and the entry
    point does not execute any <<ray-tracing-repack,_invocation repack
    instructions_>>
endif::VK_KHR_shader_subgroup_uniform_control_flow[]
ifdef::VK_AMD_shader_early_and_late_fragment_tests[]
  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06767]]
    If <<features-shaderEarlyAndLateFragmentTests,
    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
    code:EarlyAndLateFragmentTestsEXT {ExecutionMode} must: not be used
  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06768]]
    If <<features-shaderEarlyAndLateFragmentTests,
    pname:shaderEarlyAndLateFragmentTests>> feature is not enabled, the
    code:StencilRefUnchangedFrontEXT {ExecutionMode} must: not be used
  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06769]]
    If <<features-shaderEarlyAndLateFragmentTests,
    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
    code:StencilRefUnchangedBackEXT {ExecutionMode} must: not be used
  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06770]]
    If <<features-shaderEarlyAndLateFragmentTests,
    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
    code:StencilRefGreaterFrontEXT {ExecutionMode} must: not be used
  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06771]]
    If <<features-shaderEarlyAndLateFragmentTests,
    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
    code:StencilRefGreaterBackEXT {ExecutionMode} must: not be used
  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06772]]
    If <<features-shaderEarlyAndLateFragmentTests,
    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
    code:StencilRefLessFrontEXT {ExecutionMode} must: not be used
  * [[VUID-{refpage}-shaderEarlyAndLateFragmentTests-06773]]
    If <<features-shaderEarlyAndLateFragmentTests,
    pname:shaderEarlyAndLateFragmentTests>> is not enabled, the
    code:StencilRefLessBackEXT {ExecutionMode} must: not be used
endif::VK_AMD_shader_early_and_late_fragment_tests[]
ifdef::VK_QCOM_image_processing[]
  * [[VUID-{refpage}-OpImageWeightedSampleQCOM-06979]]
    If an code:OpImageWeightedSampleQCOM operation is used, then the
    code:Texture code:Sampled code:Image and code:Weight code:Image
    parameters must: both be _dynamically uniform_ for the quad
  * [[VUID-{refpage}-OpImageWeightedSampleQCOM-06980]]
    If an code:OpImageWeightedSampleQCOM operation is used, then the
    code:Weight code:Image parameter must: be of {StorageClass}
    code:UniformConstant and type code:OpTypeImage with code:Depth=0,
    code:Dim=code:2D, code:Arrayed=1, code:MS=0, and code:Sampled=1
  * [[VUID-{refpage}-OpImageWeightedSampleQCOM-06981]]
    If an code:OpImageWeightedSampleQCOM operation is used, then the
    code:Weight code:Image parameter must: be decorated with
    code:WeightTextureQCOM
  * [[VUID-{refpage}-OpImageBlockMatchSADQCOM-06982]]
    If an code:OpImageBlockMatchSADQCOM or code:OpImageBlockMatchSSDQCOM
    operation is used, then the code:target code:sampled code:image,
    code:reference code:sampled code:image, and code:Block code:Size
    parameters must: both be _dynamically uniform_ for the quad
  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06983]]
    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
    operation is used, then code:target code:sampled code:image and
    code:reference code:sampled code:image parameters must: be of storage
    class code:UniformConstant and type code:OpTypeImage with code:Depth=0,
    code:Dim=code:2D, code:Arrayed=0, code:MS=0, and code:Sampled=1
  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06984]]
    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
    operation is used, then the code:target code:sampled code:image and
    code:reference code:sampled code:image parameters must: be decorated
    with code:BlockMatchTextureQCOM
  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06985]]
    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
    operation is used, then code:target code:sampled code:image and
    code:reference code:sampled code:image parameters must: have been
    created using an identical sampler object
  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06986]]
    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
    operation is used, then code:target code:sampled code:image and
    code:reference code:sampled code:image parameters must: have been
    created with a sampler object with pname:unnormalizedCoordinates equal
    to ename:VK_TRUE
  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06987]]
    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
    operation is used, then code:target code:sampled code:image and
    code:reference code:sampled code:image parameters must: have been
    created with a sampler object with pname:unnormalizedCoordinates equal
    to ename:VK_TRUE
  * [[VUID-{refpage}-OpImageBlockMatchSSDQCOM-06988]]
    If an code:OpImageBlockMatchSSDQCOM or code:OpImageBlockMatchSADQCOM
    operation is used, then code:Block code:Size less than or equal to
    <<limits-blockmatch-maxblocksize, pname:maxBlockMatchRegion>>
  * [[VUID-{refpage}-OpImageBoxFilterQCOM-06989]]
    If an code:OpImageBoxFilterQCOM operation is used, then code:Box
    code:Size.y must: be equal to or greater than 1.0 and less than or equal
    to <<limits-boxfilter-maxblocksize,
    pname:maxBoxFilterBlockSize>>.code:height
  * [[VUID-{refpage}-OpImageBoxFilterQCOM-06990]]
    If an code:OpImageBoxFilterQCOM operation is used, then code:Sampled
    code:Texture code:Image and code:Box code:Size parameters must: be
    _dynamically uniform_
endif::VK_QCOM_image_processing[]
  * [[VUID-{refpage}-OpEntryPoint-08727]]
    Each code:OpEntryPoint must: not have more than one variable decorated
    with code:InputAttachmentIndex per image aspect of the attachment image
    bound to it, either explicitly or implicitly as described by
    <<interfaces-inputattachment, input attachment interface>>
ifdef::VK_EXT_shader_tile_image[]
  * [[VUID-{refpage}-shaderTileImageColorReadAccess-08728]]
    If <<features-shaderTileImageColorReadAccess,
    pname:shaderTileImageColorReadAccess>> is not enabled,
    code:OpColorAttachmentReadEXT operation must: not be used
  * [[VUID-{refpage}-shaderTileImageDepthReadAccess-08729]]
    If <<features-shaderTileImageDepthReadAccess,
    pname:shaderTileImageDepthReadAccess>> is not enabled,
    code:OpDepthAttachmentReadEXT operation must: not be used
  * [[VUID-{refpage}-shaderTileImageStencilReadAccess-08730]]
    If <<features-shaderTileImageStencilReadAccess,
    pname:shaderTileImageStencilReadAccess>> is not enabled,
    code:OpStencilAttachmentReadEXT operation must: not be used
  * [[VUID-{refpage}-minSampleShading-08731]]
    If <<primsrast-sampleshading, sample shading>> is enabled and
    pname:minSampleShading is 1.0, the code:sample operand of any
    code:OpColorAttachmentReadEXT, code:OpDepthAttachmentReadEXT, or
    code:OpStencilAttachmentReadEXT operation must: evaluate to the value of
    the <<primsrast-multisampling-coverage-mask, coverage index>> for any
    given fragment invocation
  * [[VUID-{refpage}-minSampleShading-08732]]
    If <<primsrast-sampleshading, sample shading>> is enabled and any of the
    code:OpColorAttachmentReadEXT, code:OpDepthAttachmentReadEXT, or
    code:OpStencilAttachmentReadEXT operations are used, then
    pname:minSampleShading must: be 1.0
endif::VK_EXT_shader_tile_image[]
  * [[VUID-{refpage}-MeshEXT-09218]]
    In mesh shaders using the code:MeshEXT or code:MeshNV {ExecutionModel}
    and the code:OutputPoints {ExecutionMode},
ifdef::VK_KHR_maintenance5[]
    if <<features-maintenance5, pname:maintenance5>> is not enabled, and
endif::VK_KHR_maintenance5[]
    if the number of output points is greater than 0, a code:PointSize
    decorated variable must: be written to for each output point
ifdef::VK_KHR_maintenance5[]
  * [[VUID-{refpage}-maintenance5-09190]]
    If <<features-maintenance5, pname:maintenance5>> is enabled and a
    code:PointSize decorated variable is written to, all execution paths
    must: write to a code:PointSize decorated variable
endif::VK_KHR_maintenance5[]
ifdef::VK_AMDX_shader_enqueue[]
  * [[VUID-{refpage}-ShaderEnqueueAMDX-09191]]
    The code:ShaderEnqueueAMDX capability must: only be used in shaders with
    the code:GLCompute execution model
  * [[VUID-{refpage}-NodePayloadAMDX-09192]]
    Variables in the code:NodePayloadAMDX storage class must: only be
    declared in the code:GLCompute execution model
  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadSize-09193]]
    Variables declared in the code:NodePayloadAMDX storage class must: not
    be larger than the <<limits-maxExecutionGraphShaderPayloadSize,
    pname:maxExecutionGraphShaderPayloadSize>> limit
  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadSize-09194]]
    Variables declared in the code:NodeOutputPayloadAMDX storage class must:
    not be larger than the <<limits-maxExecutionGraphShaderPayloadSize,
    pname:maxExecutionGraphShaderPayloadSize>> limit
  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadSize-09195]]
    For a given entry point, the sum of the size of any variable in the
    code:NodePayloadAMDX storage class, and the combined size of all
    statically initialized variables in the code:NodeOutputPayloadAMDX
    storage class must: not be greater than
    <<limits-maxExecutionGraphShaderPayloadSize,
    pname:maxExecutionGraphShaderPayloadSize>>
  * [[VUID-{refpage}-maxExecutionGraphShaderPayloadCount-09196]]
    Shaders must: not statically initialize more than
    <<limits-maxExecutionGraphShaderPayloadCount,
    pname:maxExecutionGraphShaderPayloadCount>> variables in the
    code:NodeOutputPayloadAMDX storage class
  * [[VUID-{refpage}-maxExecutionGraphShaderOutputNodes-09197]]
    Shaders must: not include more than
    <<limits-maxExecutionGraphShaderOutputNodes,
    pname:maxExecutionGraphShaderOutputNodes>> instances of
    code:OpInitializeNodePayloadsAMDX
endif::VK_AMDX_shader_enqueue[]
ifdef::VK_QCOM_image_processing2[]
  * [[VUID-{refpage}-OpImageBlockMatchWindow-09219]]
    If a code:OpImageBlockMatchWindow*QCOM or
    code:OpImageBlockMatchGather*QCOM operation is used, then the
    code:target code:sampled code:image, code:reference code:sampled
    code:image, and code:Block code:Size parameters must: both be
    _dynamically uniform_ for the quad
  * [[VUID-{refpage}-OpImageBlockMatchWindow-09220]]
    If a code:OpImageBlockMatchWindow*QCOM or
    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
    code:sampled code:image and code:reference code:sampled code:image
    parameters must: be of storage class code:UniformConstant and type
    code:OpTypeImage with code:Depth=0, code:Dim=code:2D, code:Arrayed=0,
    code:MS=0, and code:Sampled=1
  * [[VUID-{refpage}-OpImageBlockMatchWindow-09221]]
    If a code:OpImageBlockMatchWindow*QCOM or
    code:OpImageBlockMatchGather*QCOM operation is used, then the
    code:target code:sampled code:image and code:reference code:sampled
    code:image parameters must: be decorated with code:BlockMatchTextureQCOM
  * [[VUID-{refpage}-OpImageBlockMatchWindow-09222]]
    If a code:OpImageBlockMatchWindow*QCOM or
    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
    code:sampled code:image and code:reference code:sampled code:image
    parameters must: have been created using an identical sampler object
  * [[VUID-{refpage}-OpImageBlockMatchWindow-09223]]
    If a code:OpImageBlockMatchWindow*QCOM or
    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
    code:sampled code:image and code:reference code:sampled code:image
    parameters must: have been created with a sampler object with
    pname:unnormalizedCoordinates equal to ename:VK_TRUE
  * [[VUID-{refpage}-OpImageBlockMatchWindow-09224]]
    If a code:OpImageBlockMatchWindow*QCOM or
    code:OpImageBlockMatchGather*QCOM operation is used, then code:target
    code:sampled code:image and code:reference code:sampled code:image
    parameters must: have been created with sampler object with
    pname:unnormalizedCoordinates equal to ename:VK_TRUE
  * [[VUID-{refpage}-maxBlockMatchRegion-09225]]
    If a code:OpImageBlockMatchWindow*QCOM or
    code:OpImageBlockMatchGather*QCOM operation is used, then code:Block
    code:Size less than or equal to <<limits-blockmatch-maxblocksize,
    pname:maxBlockMatchRegion>>
  * [[VUID-{refpage}-pNext-09226]]
    If a code:OpImageBlockMatchWindow*QCOM operation is used, then
    code:target code:sampled code:image must: have been created using
    asampler object that included
    slink:VkSamplerBlockMatchWindowCreateInfoQCOM in the pname:pNext chain.
endif::VK_QCOM_image_processing2[]

****
--


[[spirvenv-precision-operation]]
== Precision and Operation of SPIR-V Instructions

The following rules apply to half, single, and double-precision floating
point instructions:

  * Positive and negative infinities and positive and negative zeros are
    generated as dictated by <<ieee-754,IEEE 754>>, but subject to the
    precisions allowed in the following table.
  * Dividing a non-zero by a zero results in the appropriately signed
    <<ieee-754,IEEE 754>> infinity.
  * Signaling [eq]##NaN##s are not required to be generated and exceptions
    are never raised.
    Signaling [eq]##NaN## may: be converted to quiet [eq]##NaN##s values by
    any floating point instruction.
  * By default, the implementation may: perform optimizations on half,
    single, or double-precision floating-point instructions that ignore sign
    of a zero, or assume that arguments and results are not NaNs or
    infinities.
ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
    If the entry point is declared with the code:SignedZeroInfNanPreserve
    {ExecutionMode}, then NaNs, infinities, and the sign of zero must: not
    be ignored.
  ** The following core SPIR-V instructions must: respect the
     code:SignedZeroInfNanPreserve {ExecutionMode}: code:OpPhi,
     code:OpSelect, code:OpReturnValue, code:OpVectorExtractDynamic,
     code:OpVectorInsertDynamic, code:OpVectorShuffle,
     code:OpCompositeConstruct, code:OpCompositeExtract,
     code:OpCompositeInsert, code:OpCopyObject, code:OpTranspose,
     code:OpFConvert, code:OpFNegate, code:OpFAdd, code:OpFSub, code:OpFMul,
     code:OpStore.
     This {ExecutionMode} must: also be respected by code:OpLoad except for
     loads from the code:Input {StorageClass} in the fragment shader stage
     with the floating-point result type.
     Other SPIR-V instructions may: also respect the
     code:SignedZeroInfNanPreserve {ExecutionMode}.
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
  * The following instructions must: not flush denormalized values:
    code:OpConstant, code:OpConstantComposite, code:OpSpecConstant,
    code:OpSpecConstantComposite, code:OpLoad, code:OpStore, code:OpBitcast,
    code:OpPhi, code:OpSelect, code:OpFunctionCall, code:OpReturnValue,
    code:OpVectorExtractDynamic, code:OpVectorInsertDynamic,
    code:OpVectorShuffle, code:OpCompositeConstruct,
    code:OpCompositeExtract, code:OpCompositeInsert, code:OpCopyMemory,
    code:OpCopyObject.
ifndef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
  * Any denormalized value input into a shader or potentially generated by
    any instruction in a shader (except those listed above) may: be flushed
    to 0.
  * The rounding mode cannot: be set, and results will be
    <<spirvenv-correctly-rounded, correctly rounded>>, as described below.
  * [eq]##NaN##s may: not be generated.
    Instructions that operate on a [eq]#NaN# may: not result in a [eq]#NaN#.
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
  * Denormalized values are supported.
  ** By default, any half, single, or double-precision denormalized value
     input into a shader or potentially generated by any instruction (except
     those listed above) or any extended instructions for GLSL in a shader
     may: be flushed to zero.
  ** If the entry point is declared with the code:DenormFlushToZero
     {ExecutionMode} then for the affected instructions the denormalized
     result must: be flushed to zero and the denormalized operands may: be
     flushed to zero.
     Denormalized values obtained via unpacking an integer into a vector of
     values with smaller bit width and interpreting those values as
     floating-point numbers must: be flushed to zero.
  ** The following core SPIR-V instructions must: respect the
     code:DenormFlushToZero {ExecutionMode}: code:OpSpecConstantOp (with
     opcode code:OpFConvert), code:OpFConvert, code:OpFNegate, code:OpFAdd,
     code:OpFSub, code:OpFMul, code:OpFDiv, code:OpFRem, code:OpFMod,
     code:OpVectorTimesScalar, code:OpMatrixTimesScalar,
     code:OpVectorTimesMatrix, code:OpMatrixTimesVector,
     code:OpMatrixTimesMatrix, code:OpOuterProduct, code:OpDot; and the
     following extended instructions for GLSL: code:Round, code:RoundEven,
     code:Trunc, code:FAbs, code:Floor, code:Ceil, code:Fract, code:Radians,
     code:Degrees, code:Sin, code:Cos, code:Tan, code:Asin, code:Acos,
     code:Atan, code:Sinh, code:Cosh, code:Tanh, code:Asinh, code:Acosh,
     code:Atanh, code:Atan2, code:Pow, code:Exp, code:Log, code:Exp2,
     code:Log2, code:Sqrt, code:InverseSqrt, code:Determinant,
     code:MatrixInverse, code:Modf, code:ModfStruct, code:FMin, code:FMax,
     code:FClamp, code:FMix, code:Step, code:SmoothStep, code:Fma,
     code:UnpackHalf2x16, code:UnpackDouble2x32, code:Length, code:Distance,
     code:Cross, code:Normalize, code:FaceForward, code:Reflect,
     code:Refract, code:NMin, code:NMax, code:NClamp.
     Other SPIR-V instructions (except those excluded above) may: also flush
     denormalized values.
  ** The following core SPIR-V instructions must: respect the
     code:DenormPreserve {ExecutionMode}: code:OpTranspose,
     code:OpSpecConstantOp, code:OpFConvert, code:OpFNegate, code:OpFAdd,
     code:OpFSub, code:OpFMul, code:OpVectorTimesScalar,
     code:OpMatrixTimesScalar, code:OpVectorTimesMatrix,
     code:OpMatrixTimesVector, code:OpMatrixTimesMatrix,
     code:OpOuterProduct, code:OpDot, code:OpFOrdEqual, code:OpFUnordEqual,
     code:OpFOrdNotEqual, code:OpFUnordNotEqual, code:OpFOrdLessThan,
     code:OpFUnordLessThan, code:OpFOrdGreaterThan,
     code:OpFUnordGreaterThan, code:OpFOrdLessThanEqual,
     code:OpFUnordLessThanEqual, code:OpFOrdGreaterThanEqual,
     code:OpFUnordGreaterThanEqual; and the following extended instructions
     for GLSL: code:FAbs, code:FSign, code:Radians, code:Degrees, code:FMin,
     code:FMax, code:FClamp, code:FMix, code:Fma, code:PackHalf2x16,
     code:PackDouble2x32, code:UnpackHalf2x16, code:UnpackDouble2x32,
     code:NMin, code:NMax, code:NClamp.
     Other SPIR-V instructions may: also preserve denorm values.
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]

The precision of double-precision instructions is at least that of single
precision.

The precision of individual operations is defined in
<<spirvenv-op-prec,Precision of Individual Operations>>.
Subject to the constraints below, however, implementations may: reorder or
combine operations, resulting in expressions exhibiting different precisions
than might be expected from the constituent operations.


[[spirvenv-evaluation-expressions]]
=== Evaluation of Expressions

Implementations may: rearrange floating-point operations using any of the
mathematical properties governing the expressions in precise arithmetic,
even where the floating- point operations do not share these properties.
This includes, but is not limited to, associativity and distributivity, and
may: involve a different number of rounding steps than would occur if the
operations were not rearranged.
In shaders that use the code:SignedZeroInfNanPreserve {ExecutionMode} the
values must: be preserved if they are generated after any rearrangement but
the {ExecutionMode} does not change which rearrangements are valid.
This rearrangement can: be prevented for particular operations by using the
code:NoContraction decoration.

ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
[NOTE]
.Note
====
For example, in the absence of the code:NoContraction decoration
implementations are allowed to implement [eq]#a + b - a# and latexmath:[{a
\times b}\over{a}] as [eq]#b#.
The code:SignedZeroInfNanPreserve does not prevent these transformations,
even though they may overflow to infinity or NaN when evaluated in
floating-point.

If the code:NoContraction decoration is applied then operations may not be
rearranged, so, for example, [eq]#a + a - a# must account for possible
overflow to infinity.
If infinities are not preserved then the expression may be replaced with
[eq]#a#, since the replacement is exact when overflow does not occur and
infinities may be replaced with undefined: values.
If both code:NoContraction and code:SignedZeroInfNanPreserve are used then
the result must be infinity for sufficiently large [eq]#a#.
====
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]


[[spirvenv-op-prec]]
=== Precision of Individual Operations

The precision of individual operations is defined either in terms of
rounding (correctly rounded), as an error bound in ULP, or as inherited from
a formula as follows:

[[spirvenv-correctly-rounded]]
.Correctly Rounded
Operations described as "`correctly rounded`" will return the infinitely
precise result, [eq]#x#, rounded so as to be representable in
floating-point.
ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
The rounding mode is not specified, unless the entry point is declared with
the code:RoundingModeRTE or the code:RoundingModeRTZ {ExecutionMode}.
These execution modes affect only correctly rounded SPIR-V instructions.
These execution modes do not affect code:OpQuantizeToF16.
If the rounding mode is not specified then this rounding is implementation
specific, subject to the following rules.
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
ifndef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
The rounding mode used is not defined but must: obey the following rules.
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
If [eq]#x# is exactly representable then [eq]#x# will be returned.
Otherwise, either the floating-point value closest to and no less than
[eq]#x# or the value closest to and no greater than [eq]#x# will be
returned.

.ULP
Where an error bound of [eq]#n# ULP (units in the last place) is given, for
an operation with infinitely precise result #x# the value returned must: be
in the range [eq]#[x - n {times} ulp(x), x {plus} n {times} ulp(x)]#.
The function [eq]#ulp(x)# is defined as follows:

  {empty}:: If there exist non-equal, finite floating-point numbers #a# and
    #b# such that [eq]#a {leq} x {leq} b# then [eq]#ulp(x)# is the minimum
    possible distance between such numbers, latexmath:[ulp(x) =
    \mathrm{min}_{a,b} | b - a |].
    If such numbers do not exist then [eq]#ulp(x)# is defined to be the
    difference between the two non-equal, finite floating-point numbers
    nearest to [eq]#x#.

Where the range of allowed return values includes any value of magnitude
larger than that of the largest representable finite floating-point number,
operations may:, additionally, return either an infinity of the appropriate
sign or the finite number with the largest magnitude of the appropriate
sign.
If the infinitely precise result of the operation is not mathematically
defined then the value returned is undefined:.

.Inherited From ...
Where an operation's precision is described as being inherited from a
formula, the result returned must: be at least as accurate as the result of
computing an approximation to [eq]#x# using a formula equivalent to the
given formula applied to the supplied inputs.
Specifically, the formula given may be transformed using the mathematical
associativity, commutativity and distributivity of the operators involved to
yield an equivalent formula.
The SPIR-V precision rules, when applied to each such formula and the given
input values, define a range of permitted values.
If [eq]#NaN# is one of the permitted values then the operation may return
any result, otherwise let the largest permitted value in any of the ranges
be [eq]#F~max~# and the smallest be [eq]#F~min~#.
The operation must: return a value in the range [eq]#[x - E, x {plus} E]#
where latexmath:[E = \mathrm{max} \left( | x - F_{\mathrm{min}} |, | x -
F_{\mathrm{max}} | \right) ].
ifdef::VK_VERSION_1_2,VK_KHR_shader_float_controls[]
If the entry point is declared with the code:DenormFlushToZero execution
mode, then any intermediate denormal value(s) while evaluating the formula
may: be flushed to zero.
Denormal final results must: be flushed to zero.
If the entry point is declared with the code:DenormPreserve {ExecutionMode},
then denormals must: be preserved throughout the formula.
endif::VK_VERSION_1_2,VK_KHR_shader_float_controls[]

ifdef::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]
For half- (16 bit) and single- (32 bit) precision instructions, precisions
are required: to be at least as follows:

.Precision of core SPIR-V Instructions
[options="header", cols=",,"]
|====
| Instruction
 | Single precision, unless decorated with RelaxedPrecision | Half precision
| code:OpFAdd
2+| Correctly rounded.
| code:OpFSub
2+| Correctly rounded.
| code:OpFMul, code:OpVectorTimesScalar, code:OpMatrixTimesScalar
2+| Correctly rounded.
| code:OpDot(x, y)
2+a| Inherited from latexmath:[\sum_{i = 0}^{n - 1} x_{i} \times y_{i}].
| code:OpFOrdEqual, code:OpFUnordEqual
2+| Correct result.
| code:OpFOrdLessThan, code:OpFUnordLessThan
2+| Correct result.
| code:OpFOrdGreaterThan, code:OpFUnordGreaterThan
2+| Correct result.
| code:OpFOrdLessThanEqual, code:OpFUnordLessThanEqual
2+| Correct result.
| code:OpFOrdGreaterThanEqual, code:OpFUnordGreaterThanEqual
2+| Correct result.
| code:OpFDiv(x,y)
 | 2.5 ULP for [eq]#{vert}y{vert}# in the range [2^-126^, 2^126^].   | 2.5 ULP for [eq]#{vert}y{vert}# in the range [2^-14^, 2^14^].
| code:OpFRem(x,y)
2+| Inherited from [eq]#x - y {times} trunc(x/y)#.
| code:OpFMod(x,y)
2+| Inherited from [eq]#x - y {times} floor(x/y)#.
| conversions between types
2+| Correctly rounded.
|====

[NOTE]
.Note
====
The code:OpFRem and code:OpFMod instructions use cheap approximations of
remainder, and the error can be large due to the discontinuity in trunc()
and floor().
This can produce mathematically unexpected results in some cases, such as
FMod(x,x) computing x rather than 0, and can also cause the result to have a
different sign than the infinitely precise result.
====

.Precision of GLSL.std.450 Instructions
[options="header", cols=",,"]
|====
|Instruction
  | Single precision, unless decorated with RelaxedPrecision | Half precision
| code:fma()
2+| Inherited from code:OpFMul followed by code:OpFAdd.
| code:exp(x),  code:exp2(x)
 a| latexmath:[3 + 2 \times \vert x \vert] ULP.             a| latexmath:[1 + 2 \times \vert x \vert] ULP.
| code:log(),  code:log2()
 a| 3 ULP outside the range latexmath:[[0.5, 2.0\]]. Absolute error < latexmath:[2^{-21}] inside the range latexmath:[[0.5, 2.0\]].
 a| 3 ULP outside the range latexmath:[[0.5, 2.0\]]. Absolute error < latexmath:[2^{-7}] inside the range latexmath:[[0.5, 2.0\]].
| code:pow(x, y)
2+| Inherited from code:exp2(y {times} code:log2(x)).
| code:sqrt()
2+| Inherited from 1.0 / code:inversesqrt().
| code:inversesqrt()
2+| 2 ULP.
| code:radians(x)
2+a| Inherited from latexmath:[x \times C_{\pi\_180}], where latexmath:[C_{\pi\_180}] is a correctly rounded approximation to latexmath:[\frac{\pi}{180}].
| code:degrees(x)
2+a| Inherited from latexmath:[x \times C_{180\_\pi}], where latexmath:[C_{180\_\pi}] is a correctly rounded approximation to latexmath:[\frac{180}{\pi}].
| code:sin()
  a| Absolute error latexmath:[\leq 2^{-11}] inside the range latexmath:[[-\pi, \pi\]]. a| Absolute error latexmath:[\leq 2^{-7}] inside the range latexmath:[[-\pi, \pi\]].
| code:cos()
  a| Absolute error latexmath:[\leq 2^{-11}] inside the range latexmath:[[-\pi, \pi\]]. a| Absolute error latexmath:[\leq 2^{-7}] inside the range latexmath:[[-\pi, \pi\]].
| code:tan()
2+a| Inherited from latexmath:[\frac{\sin()}{\cos()}].
| code:asin(x)
2+a| Inherited from latexmath:[\mathrm{atan2}(x, sqrt(1.0 - x \times x))].
| code:acos(x)
2+a| Inherited from latexmath:[\mathrm{atan2}(sqrt(1.0 - x \times x), x)].
| code:atan(), code:atan2()
   | 4096 ULP                                                      | 5 ULP.
| code:sinh(x)
2+a| Inherited from latexmath:[(\exp(x) - \exp(-x)) \times 0.5].
| code:cosh(x)
2+a| Inherited from latexmath:[(\exp(x) + \exp(-x)) \times 0.5].
| code:tanh()
2+a| Inherited from latexmath:[\frac{\sinh()}{\cosh()}].
| code:asinh(x)
2+a| Inherited from latexmath:[\log(x + sqrt(x \times x + 1.0))].
| code:acosh(x)
2+a| Inherited from latexmath:[\log(x + sqrt(x \times x - 1.0))].
| code:atanh(x)
2+a| Inherited from latexmath:[\log(\frac{1.0 + x}{1.0 - x}) \times 0.5].
| code:frexp()
2+| Correctly rounded.
| code:ldexp()
2+| Correctly rounded.
| code:length(x)
2+a| Inherited from latexmath:[sqrt(dot(x, x))].
| code:distance(x, y)
2+a| Inherited from latexmath:[length(x - y)].
| code:cross()
2+| Inherited from [eq]#code:OpFSub(code:OpFMul, code:OpFMul)#.
| code:normalize(x)
2+a| Inherited from latexmath:[x \times inversesqrt(dot(x, x))].
| code:faceforward(N, I, NRef)
2+| Inherited from [eq]#code:dot(NRef, I) < 0.0 ? N : -N#.
| code:reflect(x, y)
2+| Inherited from [eq]#x - 2.0 {times} code:dot(y, x) {times} y#.
| code:refract(I, N, eta)
2+| Inherited from [eq]#k < 0.0 ? 0.0 : eta {times} I - (eta {times} code:dot(N, I) {plus} code:sqrt(k)) {times} N#, where [eq]#k = 1 - eta {times} eta {times} (1.0 - code:dot(N, I) {times} code:dot(N, I))#.
| code:round
2+| Correctly rounded.
| code:roundEven
2+| Correctly rounded.
| code:trunc
2+| Correctly rounded.
| code:fabs
2+| Correctly rounded.
| code:fsign
2+| Correctly rounded.
| code:floor
2+| Correctly rounded.
| code:ceil
2+| Correctly rounded.
| code:fract
2+| Correctly rounded.
| code:modf
2+| Correctly rounded.
| code:fmin
2+| Correctly rounded.
| code:fmax
2+| Correctly rounded.
| code:fclamp
2+| Correctly rounded.
| code:fmix(x, y, a)
2+a| Inherited from latexmath:[x \times (1.0 - a) + y \times a].
| code:step
2+| Correctly rounded.
| code:smoothStep(edge0, edge1, x)
2+a| Inherited from latexmath:[t \times t \times (3.0 - 2.0 \times t)],
where latexmath:[t = clamp(\frac{x - edge0}{edge1 - edge0}, 0.0, 1.0)].
| code:nmin
2+| Correctly rounded.
| code:nmax
2+| Correctly rounded.
| code:nclamp
2+| Correctly rounded.
|====
endif::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]

ifndef::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]
For single precision (32 bit) instructions, precisions are required: to be
at least as follows, unless decorated with RelaxedPrecision:

.Precision of core SPIR-V Instructions
[options="header"]
|====
| Instruction                                                     | Precision
| code:OpFAdd                                                     | Correctly rounded.
| code:OpFSub                                                     | Correctly rounded.
| code:OpFMul, code:OpVectorTimesScalar, code:OpMatrixTimesScalar | Correctly rounded.
| code:OpFOrdEqual, code:OpFUnordEqual                            | Correct result.
| code:OpFOrdLessThan, code:OpFUnordLessThan                      | Correct result.
| code:OpFOrdGreaterThan, code:OpFUnordGreaterThan                | Correct result.
| code:OpFOrdLessThanEqual, code:OpFUnordLessThanEqual            | Correct result.
| code:OpFOrdGreaterThanEqual, code:OpFUnordGreaterThanEqual      | Correct result.
| code:OpFDiv(x,y)                                                | 2.5 ULP for [eq]#{vert}y{vert}# in the range [2^-126^, 2^126^].
| conversions between types                                       | Correctly rounded.
|====

.Precision of GLSL.std.450 Instructions
[options="header"]
|====
|Instruction                 | Precision
| code:fma()                 | Inherited from code:OpFMul followed by code:OpFAdd.
| code:exp(x),  code:exp2(x) | [eq]#3 {plus} 2 {times} {vert}x{vert}# ULP.
| code:log(),  code:log2()   | 3 ULP outside the range [eq]#[0.5, 2.0]#. Absolute error < [eq]#2^-21^# inside the range [eq]#[0.5, 2.0]#.
| code:pow(x, y)             | Inherited from code:exp2(y {times} code:log2(x)).
| code:sqrt()                | Inherited from 1.0 / code:inversesqrt().
| code:inversesqrt()         | 2 ULP.
|====
endif::VK_VERSION_1_2,VK_KHR_shader_float16_int8[]

GLSL.std.450 extended instructions specifically defined in terms of the
above instructions inherit the above errors.
GLSL.std.450 extended instructions not listed above and not defined in terms
of the above have undefined: precision.

For the code:OpSRem and code:OpSMod instructions, if either operand is
negative the result is undefined:.

[NOTE]
.Note
====
While the code:OpSRem and code:OpSMod instructions are supported by the
Vulkan environment, they require non-negative values and thus do not enable
additional functionality beyond what code:OpUMod provides.
====

ifdef::VK_NV_cooperative_matrix[]
code:OpCooperativeMatrixMulAddNV performs its operations in an
implementation-dependent order and internal precision.
endif::VK_NV_cooperative_matrix[]

ifdef::VK_KHR_cooperative_matrix[]
code:OpCooperativeMatrixMulAddKHR performs its operations in an
implementation-dependent order and internal precision.
endif::VK_KHR_cooperative_matrix[]

[[spirvenv-image-signedness]]
== Signedness of SPIR-V Image Accesses

SPIR-V associates a signedness with all integer image accesses.
This is required in certain parts of the SPIR-V and the Vulkan image access
pipeline to ensure defined results.
The signedness is determined from a combination of the access instruction's
code:Image code:Operands and the underlying image's code:Sampled code:Type
as follows:

 1. If the instruction's code:Image code:Operands contains the
    code:SignExtend operand then the access is signed.
 2. If the instruction's code:Image code:Operands contains the
    code:ZeroExtend operand then the access is unsigned.
 3. Otherwise, the image accesses signedness matches that of the
    code:Sampled code:Type of the code:OpTypeImage being accessed.


[[spirvenv-format-type-matching]]
== Image Format and Type Matching

When specifying the code:Image code:Format of an code:OpTypeImage, the
converted bit width and type, as shown in the table below, must: match the
code:Sampled code:Type.
The signedness must: match the <<spirvenv-image-signedness,signedness of any
access>> to the image.

[NOTE]
.Note
====
Formatted accesses are always converted from a shader readable type to the
resource's format or vice versa via <<textures-format-conversion>> for reads
and <<textures-output-format-conversion>> for writes.
As such, the bit width and format below do not necessarily match 1:1 with
what might be expected for some formats.
====

For a given code:Image code:Format, the code:Sampled code:Type must: be the
type described in the _Type_ column of the below table, with its
code:Literal code:Width set to that in the _Bit Width_ column.
Every access that is made to the image must: have a signedness equal to that
in the _Signedness_ column (where applicable).

[options="autowidth"]
|===
| Image Format       | Type-Declaration instructions | Bit Width | Signedness

| code:Unknown       | Any                  | Any       | Any
| code:Rgba32f   .20+| code:OpTypeFloat .20+| 32    .20+| N/A
| code:Rg32f
| code:R32f
| code:Rgba16f
| code:Rg16f
| code:R16f
| code:Rgba16
| code:Rg16
| code:R16
| code:Rgba16Snorm
| code:Rg16Snorm
| code:R16Snorm
| code:Rgb10A2
| code:R11fG11fB10f
| code:Rgba8
| code:Rg8
| code:R8
| code:Rgba8Snorm
| code:Rg8Snorm
| code:R8Snorm
| code:Rgba32i   .19+| code:OpTypeInt   .19+| 32     .9+| 1
| code:Rg32i
| code:R32i
| code:Rgba16i
| code:Rg16i
| code:R16i
| code:Rgba8i
| code:Rg8i
| code:R8i
| code:Rgba32ui                                     .10+| 0
| code:Rg32ui
| code:R32ui
| code:Rgba16ui
| code:Rg16ui
| code:R16ui
| code:Rgb10a2ui
| code:Rgba8ui
| code:Rg8ui
| code:R8ui
| code:R64i       .2+| code:OpTypeInt    .2+| 64        | 1
| code:R64ui                                            | 0
|===

[[spirv-type]]
The _SPIR-V Type_ is defined by an instruction in SPIR-V, declared with the
Type-Declaration Instruction, Bit Width, and Signedness from above.

[[spirvenv-image-formats]]
== Compatibility Between SPIR-V Image Formats and Vulkan Formats

SPIR-V code:Image code:Format values are compatible with elink:VkFormat
values as defined below:

.SPIR-V and Vulkan Image Format Compatibility
[cols="2*", options="header"]
|====
|SPIR-V Image Format    |Compatible Vulkan Format
include::{generated}/formats/spirvimageformat.adoc[]
|====


ifdef::VK_KHR_ray_query+VK_KHR_ray_tracing_position_fetch[]
// TODO: add more Ray Query instructions here and move second ifdef down
[[spirenv-ray-query-precision-operation]]
== Ray Query Precision and Operation

The values returned by
code:OpRayQueryGetIntersectionTriangleVertexPositionsKHR are transformed by
the geometry transform, which is performed at standard
<<fundamentals-floatingpoint, floating point>> precision, but without a
specifically defined order of floating point operations to perform the
matrix multiplication.

endif::VK_KHR_ray_query+VK_KHR_ray_tracing_position_fetch[]