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
|
// This file is the single source of truth for all capabilities
// supported by the Slang language.
//
// This file will be parsed and processed by the slang-capability-generator
// tool during the build process to produce slang-generated-capability-defs.h
// and slang-generated-capability-defs-impl.h files that constitute the final
// C++ source of the compiler. New capabilties should be added by editing
// this file instead of the generated .h files.
//
// A capability atom represent a basic unit that characterizes a single code-gen target or
// a platform-specific API/feature, e.g. _GL_EXT_ray_tracing represents the GLSL ray tracing
// extension, and `glsl` represents the GLSL code gen target.
//
// A capability name is defined by a unique disjunction of conjunction of capability atoms.
// For example, `raytracing` is a name that expands to
// glsl + _GL_EXT_ray_tracing | spirv_1_4 + SPV_KHR_ray_tracing | hlsl + _sm_6_4
// which means it requires the `_GL_EXT_ray_tracing` extension when generating code for glsl,
// requires SPV_KHR_ray_tracing for spirv, and requires sm_6_4 when generating hlsl.
//
// There are three types of capability definitions:
// - `def`: this will introduce an new capability atom. If there is an inheritance clause,
// the capability name will expand to all inherited atoms plus the newly introduced atom.
// - `abstract`: an abstract capability does not introduce an actual atom. Primarily used to
// make disjunctions using the following rules:
// 1. Each type of abstract atom defines a "keyhole". `target` and `stage` are distinct "keyholes".
// 2. Any atom immediately derived off of an abstract atom is a "key atom".
// 3. Every conjunction may only populate each "keyhole" once, else the set is incompatible.
// * If joining ('+') incompatible sets, an invalid capability is made.
// * If Inclusive joining ('|') incompatible sets, a disjunction is made.
// 4. ex: `hlsl + glsl` both populate the same "keyhole" of `target`, this is incompatible.
// 5. ex: `hlsl + _sm_6_0` both populate same keyholes of `hlsl` and `hlsl`, this is compatible.
// 6. ex: `hlsl | glsl` creates a disjunction of 2 sets: `hlsl` and `glsl`. This is due to the
// 2 sets being incompatible.
// 7. Having a not populated "keyhole" means your set is compatible with any "key atom" of
// distinct "keyhole".
// 8. ex: `vertex + glsl` works because 'vertex' has a unpopulated `target` "keyhole", and
// therefore is compatible with all `target` "key atoms"
// - `alias`: this defines an alias and does not introduce actual atoms.
// Several capabilities represent the target formats in which we generate code.
// Because we can only generate code in one format at a time, all of these are
// marked as conflicting with one another along the `TargetFormat` axis.
//
// Note: We are only including here the source code formats we initially generate
// code in and not the formats that code might be translated into "downstream."
// Trying to figure out how to integrate both kinds of formats into our capability
// system will be an interesting challenge (e.g., can we compile code for `hlsl+spirv`
// and for `glsl+spirv` or even just for `spirv`, and how should all of those impact
// overloading).
//
def textualTarget;
abstract target;
def hlsl : target + textualTarget;
def glsl : target + textualTarget;
def c : target + textualTarget;
def cpp : target + textualTarget;
def cuda : target + textualTarget;
def metal : target + textualTarget;
def spirv : target;
// Capabilities that stand for target spirv version for GLSL backend.
// These are not compilation targets. We will convert `_spirv_*`->`glsl_spirv_*` during a compile.
def glsl_spirv_1_0 : glsl;
def glsl_spirv_1_1 : glsl_spirv_1_0;
def glsl_spirv_1_2 : glsl_spirv_1_1;
def glsl_spirv_1_3 : glsl_spirv_1_2;
def glsl_spirv_1_4 : glsl_spirv_1_3;
def glsl_spirv_1_5 : glsl_spirv_1_4;
def glsl_spirv_1_6 : glsl_spirv_1_5;
// We have multiple capabilities for the various SPIR-V versions,
// arranged so that they inherit from one another to represent which versions
// provide a super-set of the features of earlier ones (e.g., SPIR-V 1.4 is
// expressed as inheriting from SPIR-V 1.3).
//
def _spirv_1_0 : spirv;
def _spirv_1_1 : _spirv_1_0;
def _spirv_1_2 : _spirv_1_1;
def _spirv_1_3 : _spirv_1_2;
def _spirv_1_4 : _spirv_1_3;
def _spirv_1_5 : _spirv_1_4;
def _spirv_1_6 : _spirv_1_5;
alias _spirv_latest = _spirv_1_6;
def _GLSL_130 : glsl;
def _GLSL_140 : _GLSL_130;
def _GLSL_150 : _GLSL_140;
def _GLSL_330 : _GLSL_150;
def _GLSL_400 : _GLSL_330;
def _GLSL_410 : _GLSL_400;
def _GLSL_420 : _GLSL_410;
def _GLSL_430 : _GLSL_420;
def _GLSL_440 : _GLSL_430;
def _GLSL_450 : _GLSL_440;
def _GLSL_460 : _GLSL_450;
// metal versions
def metallib_2_3 : metal;
def metallib_2_4 : metallib_2_3;
def metallib_3_0 : metallib_2_4;
def metallib_3_1 : metallib_3_0;
alias metallib_latest = metallib_3_1;
// hlsl versions
def _sm_4_0 : hlsl;
def _sm_4_1 : _sm_4_0;
def _sm_5_0 : _sm_4_1;
def _sm_5_1 : _sm_5_0;
def _sm_6_0 : _sm_5_1;
def _sm_6_1 : _sm_6_0;
def _sm_6_2 : _sm_6_1;
def _sm_6_3 : _sm_6_2;
def _sm_6_4 : _sm_6_3;
def _sm_6_5 : _sm_6_4;
def _sm_6_6 : _sm_6_5;
def _sm_6_7 : _sm_6_6;
def hlsl_nvapi : hlsl;
// cuda versions
def _cuda_sm_1_0 : cuda;
def _cuda_sm_2_0 : _cuda_sm_1_0;
def _cuda_sm_3_0 : _cuda_sm_2_0;
def _cuda_sm_3_5 : _cuda_sm_3_0;
def _cuda_sm_4_0 : _cuda_sm_3_5;
def _cuda_sm_5_0 : _cuda_sm_4_0;
def _cuda_sm_6_0 : _cuda_sm_5_0;
def _cuda_sm_7_0 : _cuda_sm_6_0;
def _cuda_sm_8_0 : _cuda_sm_7_0;
def _cuda_sm_9_0 : _cuda_sm_8_0;
alias any_target = hlsl | metal | glsl | c | cpp | cuda | spirv;
alias any_textual_target = hlsl | metal | glsl | c | cpp | cuda;
alias any_gfx_target = hlsl | metal | glsl | spirv;
alias any_cpp_target = cpp | cuda;
alias cpp_cuda = cpp | cuda;
alias cpp_cuda_glsl_spirv = cpp | cuda | glsl | spirv;
alias cpp_cuda_glsl_hlsl = cpp | cuda | glsl | hlsl;
alias cpp_cuda_glsl_hlsl_spirv = cpp | cuda | glsl | hlsl | spirv;
alias cpp_cuda_glsl_hlsl_metal_spirv = cpp | cuda | glsl | hlsl | metal | spirv;
alias cpp_cuda_hlsl = cpp | cuda | hlsl;
alias cpp_cuda_hlsl_spirv = cpp | cuda | hlsl | spirv;
alias cpp_cuda_hlsl_metal_spirv = cpp | cuda | hlsl | metal | spirv;
alias cpp_glsl = cpp | glsl;
alias cpp_glsl_hlsl_spirv = cpp | glsl | hlsl | spirv;
alias cpp_glsl_hlsl_metal_spirv = cpp | glsl | hlsl | metal | spirv;
alias cpp_hlsl = cpp | hlsl;
alias cuda_glsl_hlsl = cuda | glsl | hlsl;
alias cuda_hlsl_metal_spirv = cuda | hlsl | metal | spirv;
alias cuda_glsl_hlsl_spirv = cuda | glsl | hlsl | spirv;
alias cuda_glsl_hlsl_metal_spirv = cuda | glsl | hlsl | metal | spirv;
alias cuda_glsl_spirv = cuda | glsl | spirv;
alias cuda_glsl_metal_spirv = cuda | glsl | metal | spirv;
alias cuda_hlsl = cuda | hlsl;
alias cuda_hlsl_spirv = cuda | hlsl | spirv;
alias glsl_hlsl_spirv = glsl | hlsl | spirv;
alias glsl_hlsl_metal_spirv = glsl | hlsl | metal | spirv;
alias glsl_metal_spirv = glsl | metal | spirv;
alias glsl_spirv = glsl | spirv;
alias hlsl_spirv = hlsl | spirv;
abstract stage;
def vertex : stage;
def fragment : stage;
def compute : stage;
def hull : stage;
def domain : stage;
def geometry : stage;
def raygen : stage;
def intersection : stage;
def anyhit : stage;
def closesthit: stage;
def miss : stage;
def mesh : stage;
def amplification : stage;
def callable : stage;
alias any_stage = vertex | fragment | compute | hull | domain | geometry
| raygen | intersection | anyhit | closesthit | miss | mesh
| amplification | callable
;
// shader stage alias's
alias pixel = fragment;
alias raygeneration = raygen;
alias tesscontrol = hull;
alias tesseval = domain;
alias amplification_mesh = amplification | mesh;
alias raytracing_stages = raygen | intersection | anyhit | closesthit | miss | callable;
alias anyhit_closesthit = anyhit | closesthit;
alias raygen_closesthit_miss = raygen | closesthit | miss;
alias anyhit_closesthit_intersection = anyhit | closesthit | intersection;
alias anyhit_closesthit_intersection_miss = anyhit | closesthit | intersection | miss;
alias raygen_closesthit_miss_callable = raygen | closesthit | miss | callable;
alias compute_tesscontrol_tesseval = compute | tesscontrol | tesseval;
alias compute_fragment = compute | fragment;
alias compute_fragment_geometry_vertex = compute | fragment | geometry | vertex;
alias domain_hull = domain | hull;
alias raytracingstages_fragment = raytracing_stages | fragment;
alias raytracingstages_compute = raytracing_stages | compute;
alias raytracingstages_compute_amplification_mesh = raytracingstages_compute | amplification_mesh;
alias raytracingstages_compute_fragment = raytracing_stages | compute_fragment;
alias raytracingstages_compute_fragment_geometry_vertex = raytracing_stages | compute_fragment_geometry_vertex;
// SPIRV extensions.
def SPV_EXT_fragment_shader_interlock : _spirv_1_0;
def SPV_EXT_physical_storage_buffer : _spirv_1_3;
def SPV_EXT_fragment_fully_covered : _spirv_1_0;
def SPV_EXT_descriptor_indexing : _spirv_1_0;
def SPV_EXT_shader_atomic_float_add : _spirv_1_0;
def SPV_EXT_shader_atomic_float16_add : SPV_EXT_shader_atomic_float_add;
def SPV_EXT_shader_atomic_float_min_max : _spirv_1_0;
def SPV_EXT_mesh_shader : _spirv_1_4;
def SPV_EXT_demote_to_helper_invocation : _spirv_1_4;
def SPV_KHR_fragment_shader_barycentric : _spirv_1_0;
def SPV_KHR_non_semantic_info : _spirv_1_0;
def SPV_KHR_ray_tracing : _spirv_1_4;
def SPV_KHR_ray_query : _spirv_1_0;
def SPV_KHR_ray_tracing_position_fetch : _spirv_1_0; // requires SPV_KHR_ray_query or SPV_KHR_ray_tracing
def SPV_KHR_shader_clock : _spirv_1_0;
def SPV_NV_shader_subgroup_partitioned : _spirv_1_0;
def SPV_NV_ray_tracing_motion_blur : _spirv_1_0;
def SPV_NV_shader_invocation_reorder : _spirv_1_5 + SPV_KHR_ray_tracing;
def SPV_NV_shader_image_footprint : _spirv_1_0;
def SPV_NV_compute_shader_derivatives : _spirv_1_0;
def SPV_GOOGLE_user_type : _spirv_1_0;
// SPIRV Capabilities.
def spvAtomicFloat32AddEXT : SPV_EXT_shader_atomic_float_add;
def spvAtomicFloat16AddEXT : SPV_EXT_shader_atomic_float16_add;
def spvInt64Atomics : _spirv_1_0;
def spvAtomicFloat32MinMaxEXT : SPV_EXT_shader_atomic_float_min_max;
def spvAtomicFloat16MinMaxEXT : SPV_EXT_shader_atomic_float_min_max;
def spvDerivativeControl : _spirv_1_0;
def spvImageQuery : _spirv_1_0;
def spvImageGatherExtended : _spirv_1_0;
def spvSparseResidency : _spirv_1_0;
def spvImageFootprintNV : SPV_NV_shader_image_footprint;
def spvMinLod : _spirv_1_0;
def spvFragmentShaderPixelInterlockEXT : SPV_EXT_fragment_shader_interlock;
def spvFragmentBarycentricKHR : SPV_KHR_fragment_shader_barycentric;
def spvFragmentFullyCoveredEXT : SPV_EXT_fragment_fully_covered;
def spvGroupNonUniformBallot : _spirv_1_3;
def spvGroupNonUniformShuffle : _spirv_1_3;
def spvGroupNonUniformArithmetic : _spirv_1_3;
def spvGroupNonUniformQuad : _spirv_1_3;
def spvGroupNonUniformVote : _spirv_1_3;
def spvGroupNonUniformPartitionedNV : _spirv_1_3 + SPV_NV_shader_subgroup_partitioned;
def spvRayTracingMotionBlurNV : SPV_NV_ray_tracing_motion_blur;
def spvMeshShadingEXT : SPV_EXT_mesh_shader;
def spvRayTracingKHR : SPV_KHR_ray_tracing;
def spvRayTracingPositionFetchKHR : SPV_KHR_ray_tracing_position_fetch + spvRayTracingKHR;
def spvRayQueryKHR : SPV_KHR_ray_query;
def spvRayQueryPositionFetchKHR : SPV_KHR_ray_tracing_position_fetch + spvRayQueryKHR;
def spvShaderInvocationReorderNV : SPV_NV_shader_invocation_reorder;
def spvShaderClockKHR : SPV_KHR_shader_clock;
def spvShaderNonUniformEXT : SPV_EXT_descriptor_indexing;
def spvShaderNonUniform : spvShaderNonUniformEXT;
def spvDemoteToHelperInvocationEXT : SPV_EXT_demote_to_helper_invocation;
def spvDemoteToHelperInvocation : spvDemoteToHelperInvocationEXT;
// The following capabilities all pertain to how ray tracing shaders are translated
// to GLSL, where there are two different extensions that can provide the core
// functionality of `TraceRay` and the related operations.
//
// The two extensions are expressed as distinct capabilities that both are marked
// as conflicting on the `RayTracingExtension` axis, so that a compilation target
// cannot have both enabled at once.
//
// The `_GL_EXT_ray_tracing` extension should be favored, so it has a rank of `1`
// instead of `0`, which means that when comparing overloads that require these
// extensions, the `EXT` extension will be favored over the `NV` extension, if
// all other factors are equal.
//
// If a user enabled a GL_ARB/GL_NV/GL_KHR, the user will also be-able to enable any equal GL_EXT
// To describe this relationship, all GL_EXT which were promoted (or originally not an EXT)
// will be set as a derived atom.
def _GL_EXT_buffer_reference : _GLSL_450;
def _GL_EXT_buffer_reference_uvec2 : _GLSL_450;
def _GL_EXT_debug_printf : glsl;
def _GL_EXT_demote_to_helper_invocation : _GLSL_140;
def _GL_EXT_fragment_shader_barycentric : _GLSL_450;
def _GL_EXT_mesh_shader : _GLSL_450;
def _GL_EXT_nonuniform_qualifier : glsl;
def _GL_EXT_ray_query : _GLSL_460 + glsl_spirv_1_4; // spirv_1_4 is required due to glslang bug which enables `SPV_KHR_ray_tracing` regardless of context
def _GL_EXT_ray_tracing : _GLSL_460;
def _GL_EXT_ray_tracing_position_fetch : _GL_EXT_ray_query; // requires _GL_EXT_ray_tracing or _GL_EXT_ray_query
def _GL_EXT_samplerless_texture_functions : _GLSL_140;
def _GL_EXT_shader_atomic_float : glsl;
def _GL_EXT_shader_atomic_float_min_max : glsl;
def _GL_EXT_shader_atomic_float2 : glsl;
def _GL_EXT_shader_atomic_int64 : glsl;
def _GL_EXT_shader_explicit_arithmetic_types_int64 : _GLSL_140;
def _GL_EXT_shader_image_load_store : _GLSL_130;
def _GL_EXT_shader_realtime_clock : glsl;
def _GL_EXT_texture_query_lod : glsl;
def _GL_EXT_texture_shadow_lod : _GLSL_130;
def _GL_ARB_derivative_control : _GLSL_400;
def _GL_ARB_fragment_shader_interlock : _GLSL_450;
def _GL_ARB_gpu_shader5 : _GLSL_150;
def _GL_ARB_shader_image_load_store : _GL_EXT_shader_image_load_store;
def _GL_ARB_shader_image_size : _GLSL_420;
def _GL_ARB_texture_multisample : _GLSL_140;
def _GL_ARB_shader_texture_image_samples : _GLSL_150;
def _GL_ARB_sparse_texture : glsl;
def _GL_ARB_sparse_texture2 : _GL_ARB_sparse_texture;
def _GL_ARB_sparse_texture_clamp : _GL_ARB_sparse_texture2;
def _GL_ARB_texture_gather : _GLSL_130;
def _GL_ARB_texture_query_levels : _GLSL_130;
def _GL_KHR_memory_scope_semantics : _GLSL_420;
def _GL_KHR_shader_subgroup_arithmetic : _GLSL_140;
def _GL_KHR_shader_subgroup_ballot : _GLSL_140;
def _GL_KHR_shader_subgroup_basic : _GLSL_140;
def _GL_KHR_shader_subgroup_clustered : _GLSL_140;
def _GL_KHR_shader_subgroup_quad : _GLSL_140;
def _GL_KHR_shader_subgroup_shuffle : _GLSL_140;
def _GL_KHR_shader_subgroup_shuffle_relative : _GLSL_140;
def _GL_KHR_shader_subgroup_vote : _GLSL_140;
def _GL_NV_compute_shader_derivatives : _GLSL_450;
def _GL_NV_fragment_shader_barycentric : _GL_EXT_fragment_shader_barycentric;
def _GL_NV_gpu_shader5 : _GL_ARB_gpu_shader5;
def _GL_NV_ray_tracing : _GL_EXT_ray_tracing;
def _GL_NV_ray_tracing_motion_blur : _GLSL_460;
def _GL_NV_shader_atomic_fp16_vector : _GL_NV_gpu_shader5;
def _GL_NV_shader_invocation_reorder : _GLSL_460;
def _GL_NV_shader_subgroup_partitioned : _GLSL_140;
def _GL_NV_shader_texture_footprint : _GLSL_450;
// GLSL extension and SPV extension associations.
alias GL_EXT_buffer_reference = _GL_EXT_buffer_reference | SPV_EXT_physical_storage_buffer;
alias GL_EXT_buffer_reference_uvec2 = _GL_EXT_buffer_reference_uvec2 | _spirv_1_0;
alias GL_EXT_debug_printf = _GL_EXT_debug_printf | SPV_KHR_non_semantic_info;
alias GL_EXT_demote_to_helper_invocation = _GL_EXT_demote_to_helper_invocation | spvDemoteToHelperInvocationEXT;
alias GL_EXT_fragment_shader_barycentric = _GL_EXT_fragment_shader_barycentric | spvFragmentBarycentricKHR;
alias GL_EXT_mesh_shader = _GL_EXT_mesh_shader | spvMeshShadingEXT;
alias GL_EXT_nonuniform_qualifier = _GL_EXT_nonuniform_qualifier | spvShaderNonUniformEXT;
alias GL_EXT_ray_query = _GL_EXT_ray_query | spvRayQueryKHR;
alias GL_EXT_ray_tracing = _GL_EXT_ray_tracing | spvRayTracingKHR;
alias GL_EXT_ray_tracing_position_fetch_ray_tracing = _GL_EXT_ray_tracing_position_fetch | spvRayTracingPositionFetchKHR;
alias GL_EXT_ray_tracing_position_fetch_ray_query = _GL_EXT_ray_tracing_position_fetch | spvRayQueryPositionFetchKHR;
alias GL_EXT_samplerless_texture_functions = _GL_EXT_samplerless_texture_functions | _spirv_1_0;
alias GL_EXT_shader_atomic_float = _GL_EXT_shader_atomic_float | spvAtomicFloat32AddEXT + spvAtomicFloat32MinMaxEXT;
alias GL_EXT_shader_atomic_float_min_max = _GL_EXT_shader_atomic_float_min_max | spvAtomicFloat32MinMaxEXT + spvAtomicFloat16MinMaxEXT;
alias GL_EXT_shader_atomic_float2 = _GL_EXT_shader_atomic_float2 | spvAtomicFloat32AddEXT + spvAtomicFloat32MinMaxEXT + spvAtomicFloat16AddEXT + spvAtomicFloat16MinMaxEXT;
alias GL_EXT_shader_atomic_int64 = _GL_EXT_shader_atomic_int64 | spvInt64Atomics;
alias GL_EXT_shader_explicit_arithmetic_types_int64 = _GL_EXT_shader_explicit_arithmetic_types_int64 | _spirv_1_0;
alias GL_EXT_shader_image_load_store = _GL_EXT_shader_image_load_store | _spirv_1_0;
alias GL_EXT_shader_realtime_clock = _GL_EXT_shader_realtime_clock | spvShaderClockKHR;
alias GL_EXT_texture_query_lod = _GL_EXT_texture_query_lod | spvImageQuery | metal;
alias GL_EXT_texture_shadow_lod = _GL_EXT_texture_shadow_lod | _spirv_1_0;
alias GL_ARB_derivative_control = _GL_ARB_derivative_control | spvDerivativeControl;
alias GL_ARB_fragment_shader_interlock = _GL_ARB_fragment_shader_interlock | spvFragmentShaderPixelInterlockEXT;
alias GL_ARB_gpu_shader5 = _GL_ARB_gpu_shader5 | _spirv_1_0;
alias GL_ARB_shader_image_load_store = GL_EXT_shader_image_load_store;
alias GL_ARB_shader_image_size = _GL_ARB_shader_image_size | spvImageQuery | metal;
alias GL_ARB_texture_multisample = _GL_ARB_texture_multisample | _spirv_1_0;
alias GL_ARB_shader_texture_image_samples = _GL_ARB_shader_texture_image_samples | spvImageQuery | metal;
alias GL_ARB_sparse_texture_clamp = _GL_ARB_sparse_texture_clamp | spvSparseResidency;
alias GL_ARB_texture_gather = _GL_ARB_texture_gather | spvImageGatherExtended | metal;
alias GL_ARB_texture_query_levels = _GL_ARB_texture_query_levels | spvImageQuery | metal;
alias GL_KHR_memory_scope_semantics = _GL_KHR_memory_scope_semantics | _spirv_1_0;
alias GL_KHR_shader_subgroup_arithmetic = _GL_KHR_shader_subgroup_arithmetic | spvGroupNonUniformArithmetic;
alias GL_KHR_shader_subgroup_ballot = _GL_KHR_shader_subgroup_ballot | spvGroupNonUniformBallot;
alias GL_KHR_shader_subgroup_basic = _GL_KHR_shader_subgroup_basic | spvGroupNonUniformBallot;
alias GL_KHR_shader_subgroup_clustered = _GL_KHR_shader_subgroup_clustered | spvGroupNonUniformShuffle;
alias GL_KHR_shader_subgroup_quad = _GL_KHR_shader_subgroup_quad | spvGroupNonUniformQuad;
alias GL_KHR_shader_subgroup_shuffle = _GL_KHR_shader_subgroup_shuffle | spvGroupNonUniformShuffle;
alias GL_KHR_shader_subgroup_shuffle_relative = _GL_KHR_shader_subgroup_shuffle_relative | spvGroupNonUniformShuffle;
alias GL_KHR_shader_subgroup_vote = _GL_KHR_shader_subgroup_vote | spvGroupNonUniformVote;
alias GL_NV_compute_shader_derivatives = _GL_NV_compute_shader_derivatives | SPV_NV_compute_shader_derivatives | _sm_6_6;
alias GL_NV_fragment_shader_barycentric = GL_EXT_fragment_shader_barycentric;
alias GL_NV_gpu_shader5 = GL_ARB_gpu_shader5;
alias GL_NV_ray_tracing = GL_EXT_ray_tracing;
alias GL_NV_ray_tracing_motion_blur = _GL_NV_ray_tracing_motion_blur | spvRayTracingMotionBlurNV;
alias GL_NV_shader_atomic_fp16_vector = _GL_NV_shader_atomic_fp16_vector + _GL_NV_gpu_shader5 | _spirv_1_0;
alias GL_NV_shader_invocation_reorder = _GL_NV_shader_invocation_reorder + _GL_EXT_buffer_reference_uvec2 | spvShaderInvocationReorderNV;
alias GL_NV_shader_subgroup_partitioned = _GL_NV_shader_subgroup_partitioned | spvGroupNonUniformPartitionedNV;
alias GL_NV_shader_texture_footprint = _GL_NV_shader_texture_footprint | spvImageFootprintNV;
// Define feature names
alias nvapi = hlsl_nvapi;
alias raytracing = GL_EXT_ray_tracing | _sm_6_3 | cuda;
alias ser = raytracing + GL_NV_shader_invocation_reorder | raytracing + hlsl_nvapi | cuda;
alias motionblur = GL_NV_ray_tracing_motion_blur | _sm_6_3 + hlsl_nvapi | cuda;
alias rayquery = GL_EXT_ray_query | _sm_6_3;
alias raytracing_motionblur = raytracing + motionblur | cuda;
alias ser_motion = ser + motionblur;
alias shaderclock = GL_EXT_shader_realtime_clock | hlsl_nvapi | cpp | cuda;
alias meshshading_internal = GL_EXT_mesh_shader | _sm_6_5;
alias meshshading = amplification_mesh + meshshading_internal;
alias fragmentshaderinterlock = _GL_ARB_fragment_shader_interlock | hlsl_nvapi | spvFragmentShaderPixelInterlockEXT;
alias atomic64 = GL_EXT_shader_atomic_int64 | _sm_6_6 | cpp | cuda;
alias atomicfloat = GL_EXT_shader_atomic_float | _sm_6_0 + hlsl_nvapi | cpp | cuda;
alias atomicfloat2 = GL_EXT_shader_atomic_float2 | _sm_6_6 + hlsl_nvapi | cpp | cuda;
alias fragmentshaderbarycentric = GL_EXT_fragment_shader_barycentric | _sm_6_1;
alias shadermemorycontrol = glsl | _spirv_1_0 | _sm_5_0;
alias shadermemorycontrol_compute = raytracingstages_compute + shadermemorycontrol;
alias subpass = fragment + any_gfx_target;
alias waveprefix = _sm_6_5 | _cuda_sm_7_0 | GL_KHR_shader_subgroup_arithmetic;
alias bufferreference = GL_EXT_buffer_reference;
alias bufferreference_int64 = bufferreference + GL_EXT_shader_explicit_arithmetic_types_int64;
// Define what each shader model means on different targets.
alias spirv_1_0 = _spirv_1_0;
alias spirv_1_1 = _spirv_1_1
| spirv_1_0
;
alias spirv_1_2 = _spirv_1_2
| spirv_1_1
;
alias spirv_1_3 = _spirv_1_3
| spirv_1_2
;
alias spirv_1_4 = _spirv_1_4
| spirv_1_3
;
alias spirv_1_5 = _spirv_1_5 + GL_EXT_nonuniform_qualifier + GL_EXT_buffer_reference
| spirv_1_4
;
alias spirv_1_6 = _spirv_1_6 + GL_EXT_debug_printf + GL_EXT_demote_to_helper_invocation
| spirv_1_5
;
alias spirv_latest = _spirv_1_6;
alias sm_4_0_version = _sm_4_0
| _GLSL_150
| spirv_1_0
| _cuda_sm_2_0
| metal
| cpp
;
alias sm_4_0 = sm_4_0_version
| SPV_GOOGLE_user_type + spvMinLod
| GL_ARB_sparse_texture_clamp + GL_EXT_samplerless_texture_functions + GL_EXT_texture_query_lod + GL_EXT_texture_shadow_lod + GL_EXT_debug_printf
;
alias sm_4_1_version = _sm_4_1
| _GLSL_150
| spirv_1_0
| _cuda_sm_6_0
| metal
| cpp
;
alias sm_4_1 = sm_4_1_version
// previous
| sm_4_0
;
alias sm_5_0_version = _sm_5_0
| _GLSL_330
| spirv_1_0
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_5_0 = sm_5_0_version
| GL_KHR_memory_scope_semantics + GL_ARB_gpu_shader5 + GL_ARB_derivative_control
| spvFragmentFullyCoveredEXT
// previous
| sm_4_1
;
alias sm_5_1_version = _sm_5_1
| _GLSL_330
| spirv_1_0
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_5_1 = sm_5_1_version
| GL_EXT_nonuniform_qualifier + GL_ARB_gpu_shader5
// previous
| sm_5_0
;
alias sm_6_0_version = _sm_6_0
| _GLSL_450
| spirv_1_3
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_0 = sm_6_0_version
| GL_KHR_shader_subgroup_ballot + GL_KHR_shader_subgroup_shuffle + GL_KHR_shader_subgroup_arithmetic + GL_KHR_shader_subgroup_quad + GL_KHR_shader_subgroup_vote
// previous
| sm_5_1
;
alias sm_6_1_version = _sm_6_1
| _GLSL_450
| spirv_1_3
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_1 = sm_6_1_version
| GL_EXT_fragment_shader_barycentric
// previous
| sm_6_0
;
alias sm_6_2_version = _sm_6_2
| _GLSL_450
| spirv_1_3
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_2 = sm_6_2_version
// previous
| sm_6_1
;
alias sm_6_3_version = _sm_6_3
| _GLSL_460
| spirv_1_4
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_3 = sm_6_3_version
| GL_EXT_ray_tracing + GL_EXT_ray_tracing_position_fetch_ray_tracing
// previous
| sm_6_2
;
alias sm_6_4_version = _sm_6_4
| _GLSL_460
| spirv_1_4
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_4 = sm_6_4_version
// previous
| sm_6_3
;
alias sm_6_5_version = _sm_6_5
| _GLSL_460
| spirv_1_4
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_5 = sm_6_5_version
// also requires: GL_NV_shader_subgroup_partitioned
| GL_EXT_mesh_shader + GL_EXT_ray_query + GL_EXT_ray_tracing_position_fetch_ray_query
// previous
| sm_6_4
;
alias sm_6_6_version = _sm_6_6
| _GLSL_460
| spirv_1_4
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_6 = sm_6_6_version
| GL_EXT_shader_atomic_int64 + GL_EXT_shader_atomic_float2 + GL_EXT_shader_atomic_float + _GL_EXT_shader_atomic_float_min_max
| sm_6_5
;
alias sm_6_7_version = _sm_6_7
| _GLSL_460
| spirv_1_4
| _cuda_sm_9_0
| metal
| cpp
;
alias sm_6_7 = sm_6_7_version
| sm_6_6
;
// Profiles
alias GLSL_130 = _GLSL_130
| _sm_4_0
| _cuda_sm_2_0
| spirv_1_0
| metal
| cpp
;
alias GLSL_140 = _GLSL_140
| _sm_4_1
| _cuda_sm_2_0
| spirv_1_0
| metal
| cpp
// previous
| GLSL_130
;
alias GLSL_150 = _GLSL_150
| _sm_4_1
| _cuda_sm_2_0
| spirv_1_0
| metal
| cpp
// extensions to propagate
| glsl_spirv + GL_ARB_texture_multisample
// previous
| GLSL_140
;
alias GLSL_330 = _GLSL_330
| _sm_5_0
| _cuda_sm_6_0
| spirv_1_0
| metal
| cpp
// previous
| GLSL_150
;
alias GLSL_400 = _GLSL_400
| _sm_5_1
| _cuda_sm_6_0
| spirv_1_3
| metal
| cpp
// extensions to propagate
| glsl_spirv + GL_ARB_gpu_shader5 + GL_ARB_texture_gather
// previous
| GLSL_330
;
alias GLSL_410 = _GLSL_410
| _sm_5_1
| _cuda_sm_6_0
| spirv_1_3
| metal
| cpp
// previous
| GLSL_400
;
alias GLSL_420 = _GLSL_420
| _sm_5_1
| _cuda_sm_6_0
| spirv_1_3
| metal
| cpp
// extensions to propagate
| glsl_spirv + GL_ARB_shader_image_load_store
// previous
| GLSL_410
;
alias GLSL_430 = _GLSL_430
| _sm_5_1
| _cuda_sm_6_0
| spirv_1_3
| metal
| cpp
// extensions to propagate
| glsl_spirv + GL_ARB_shader_image_size + GL_ARB_texture_query_levels
// previous
| GLSL_420
;
alias GLSL_440 = _GLSL_440
| _sm_6_0
| _cuda_sm_6_0
| spirv_1_3
| metal
| cpp
// previous
| GLSL_430
;
alias GLSL_450 = _GLSL_450
| _sm_6_0
| _cuda_sm_6_0
| spirv_1_3
| metal
| cpp
// extensions to propagate
| glsl_spirv + GL_ARB_derivative_control + GL_ARB_shader_texture_image_samples
// previous
| GLSL_440
;
alias GLSL_460 = _GLSL_460
| _sm_6_6
| _cuda_sm_6_0
| spirv_1_3
| metal
| cpp
// previous
| GLSL_450
;
alias GLSL_410_SPIRV_1_0 = _GLSL_410 | spirv_1_0;
alias GLSL_420_SPIRV_1_0 = _GLSL_420 + GLSL_410_SPIRV_1_0 | GLSL_410_SPIRV_1_0;
alias GLSL_430_SPIRV_1_0 = _GLSL_430 + GLSL_420_SPIRV_1_0 | GLSL_420_SPIRV_1_0;
alias DX_4_0 = sm_4_0;
alias DX_4_1 = sm_4_1;
alias DX_5_0 = sm_5_0;
alias DX_5_1 = sm_5_1;
alias DX_6_0 = sm_6_0;
alias DX_6_1 = sm_6_1;
alias DX_6_2 = sm_6_2;
alias DX_6_3 = sm_6_3;
alias DX_6_4 = sm_6_4;
alias DX_6_5 = sm_6_5;
alias DX_6_6 = sm_6_6;
alias DX_6_7 = sm_6_7;
alias METAL_2_3 = metallib_2_3;
alias METAL_2_4 = metallib_2_4;
alias SPIRV_1_0 = spirv_1_0;
alias SPIRV_1_1 = spirv_1_1;
alias SPIRV_1_2 = spirv_1_2;
alias SPIRV_1_3 = spirv_1_3;
alias SPIRV_1_4 = spirv_1_4;
alias SPIRV_1_5 = spirv_1_5;
alias SPIRV_1_6 = spirv_1_6;
alias appendstructuredbuffer = sm_5_0_version;
alias atomic_hlsl = _sm_4_0;
alias atomic_hlsl_nvapi = _sm_4_0 + hlsl_nvapi;
alias atomic_hlsl_sm_6_6 = _sm_6_6;
alias byteaddressbuffer = sm_4_0_version;
alias byteaddressbuffer_rw = sm_4_0_version;
alias consumestructuredbuffer = sm_5_0_version;
alias fragmentprocessing = fragment + _sm_5_0
| fragment + glsl_spirv
| raytracingstages_compute_amplification_mesh + GL_NV_compute_shader_derivatives
;
alias fragmentprocessing_derivativecontrol = fragment + _sm_5_0
| fragment + GL_ARB_derivative_control
| raytracingstages_compute_amplification_mesh + GL_NV_compute_shader_derivatives
;
alias getattributeatvertex = fragment + _sm_6_1 | fragment + GL_EXT_fragment_shader_barycentric;
alias memorybarrier = sm_5_0_version;
alias structuredbuffer = sm_4_0_version;
alias structuredbuffer_rw = sm_4_0_version;
alias texture_sm_4_0 = sm_4_0_version | GL_ARB_sparse_texture_clamp + GL_EXT_texture_query_lod
;
alias texture_sm_4_1 = sm_4_1_version | GL_ARB_sparse_texture_clamp + GL_EXT_texture_query_lod
;
alias texture_sm_4_1_samplerless = texture_sm_4_1
// add samplerless to all targets that need an extension
| GL_EXT_samplerless_texture_functions
;
// supposedly works on only limited stages, support all stages for now
alias texture_sm_4_1_compute_fragment = texture_sm_4_1;
alias texture_sm_4_0_fragment = texture_sm_4_0;
alias texture_sm_4_1_clamp_fragment = texture_sm_4_0_fragment + GL_ARB_sparse_texture_clamp;
alias texture_sm_4_1_vertex_fragment_geometry = texture_sm_4_1;
alias texture_gather = texture_sm_4_1_vertex_fragment_geometry + GL_ARB_texture_gather;
alias image_samples = texture_sm_4_1_compute_fragment + GL_ARB_shader_texture_image_samples;
alias image_size = texture_sm_4_1_compute_fragment + GL_ARB_shader_image_size;
alias texture_size = texture_sm_4_1 + GL_ARB_shader_image_size;
alias texture_querylod = texture_sm_4_1 + GL_EXT_texture_query_lod;
alias texture_querylevels = texture_sm_4_1 + GL_ARB_texture_query_levels;
alias texture_shadowlod = texture_sm_4_1 + GL_EXT_texture_shadow_lod
| texture_sm_4_1;
alias atomic_glsl_float1 = GL_EXT_shader_atomic_float;
alias atomic_glsl_float2 = GL_EXT_shader_atomic_float2;
alias atomic_glsl_halfvec = GL_NV_shader_atomic_fp16_vector;
alias atomic_glsl = spirv_1_0 | _GLSL_400;
alias atomic_glsl_int64 = atomic_glsl + GL_EXT_shader_atomic_int64;
alias GLSL_430_SPIRV_1_0_compute = GLSL_430_SPIRV_1_0 + compute;
alias image_loadstore = GL_EXT_shader_image_load_store + GLSL_420;
alias nonuniformqualifier = sm_5_1;
alias printf = GL_EXT_debug_printf | _sm_4_0 | _cuda_sm_2_0 | cpp;
alias texturefootprint = GL_NV_shader_texture_footprint + GLSL_450 | hlsl_nvapi + _sm_4_0;
alias texturefootprintclamp = texturefootprint + GL_ARB_sparse_texture_clamp;
alias shader5_sm_4_0 = GL_ARB_gpu_shader5 | sm_4_0_version;
alias shader5_sm_5_0 = GL_ARB_gpu_shader5 | sm_5_0_version;
alias subgroup_basic = GL_KHR_shader_subgroup_basic | _sm_6_0 | _cuda_sm_7_0;
alias subgroup_ballot = spirv_1_0 + GL_KHR_shader_subgroup_ballot
| glsl + GL_KHR_shader_subgroup_ballot + shader5_sm_5_0
| _sm_6_0 + shader5_sm_5_0
| _cuda_sm_7_0 + shader5_sm_5_0
;
alias subgroup_ballot_activemask = spirv_1_0 + GL_KHR_shader_subgroup_ballot
| glsl + GL_KHR_shader_subgroup_ballot
| _sm_6_0
| _cuda_sm_7_0
;
alias subgroup_basic_ballot = glsl + GL_KHR_shader_subgroup_basic + subgroup_ballot
| spirv + GL_KHR_shader_subgroup_basic + subgroup_ballot
| hlsl + subgroup_ballot
| cuda + subgroup_ballot
;
alias subgroup_vote = GL_KHR_shader_subgroup_vote | _sm_6_0 | _cuda_sm_7_0;
alias shaderinvocationgroup = subgroup_vote;
alias subgroup_arithmetic = GL_KHR_shader_subgroup_arithmetic | _sm_6_0 | _cuda_sm_7_0;
alias subgroup_shuffle = glsl + GL_KHR_shader_subgroup_shuffle | _sm_6_0 | _cuda_sm_7_0;
alias subgroup_shufflerelative = GL_KHR_shader_subgroup_shuffle_relative | _sm_6_0 | _cuda_sm_7_0;
alias subgroup_clustered = GL_KHR_shader_subgroup_clustered | _sm_6_0 | _cuda_sm_7_0;
alias subgroup_quad = GL_KHR_shader_subgroup_quad | _sm_6_0 | _cuda_sm_7_0;
alias subgroup_partitioned = GL_NV_shader_subgroup_partitioned + subgroup_ballot_activemask | _sm_6_5;
alias atomic_glsl_hlsl_nvapi_cuda_float1 = atomic_glsl_float1 | hlsl_nvapi + _sm_4_0 | _cuda_sm_2_0;
alias atomic_glsl_hlsl_nvapi_cuda5_int64 = atomic_glsl_int64 | hlsl_nvapi + _sm_4_0 | _cuda_sm_6_0;
alias atomic_glsl_hlsl_nvapi_cuda6_int64 = atomic_glsl_int64 | hlsl_nvapi + _sm_4_0 | _cuda_sm_6_0;
alias atomic_glsl_hlsl_nvapi_cuda9_int64 = atomic_glsl_int64 | hlsl_nvapi + _sm_4_0 | _cuda_sm_9_0;
alias atomic_glsl_hlsl_cuda = atomic_glsl | _sm_5_0 | _cuda_sm_2_0;
alias atomic_glsl_hlsl_cuda9_int64 = atomic_glsl_int64 | _sm_6_6 | _cuda_sm_9_0;
alias breakpoint = GL_EXT_debug_printf | hlsl | _cuda_sm_8_0 | cpp;
alias raytracing_allstages = raytracing_stages + raytracing;
alias raytracing_anyhit = anyhit + raytracing;
alias raytracing_intersection = intersection + raytracing;
alias raytracing_anyhit_closesthit = anyhit_closesthit + raytracing;
alias raytracing_anyhit_closesthit_intersection = anyhit_closesthit_intersection + raytracing;
alias raytracing_raygen_closesthit_miss = raygen_closesthit_miss + raytracing;
alias raytracing_anyhit_closesthit_intersection_miss = anyhit_closesthit_intersection_miss + raytracing;
alias raytracing_raygen_closesthit_miss_callable = raygen_closesthit_miss_callable + raytracing;
alias raytracing_position = raytracing + GL_EXT_ray_tracing_position_fetch_ray_tracing + anyhit_closesthit;
alias raytracing_motionblur_anyhit_closesthit_intersection_miss = anyhit_closesthit_intersection_miss + raytracing_motionblur;
alias raytracing_motionblur_raygen_closesthit_miss = raygen_closesthit_miss + raytracing_motionblur;
alias rayquery_position = rayquery + GL_EXT_ray_tracing_position_fetch_ray_query;
alias ser_raygen = raygen + ser;
alias ser_raygen_closesthit_miss = raygen_closesthit_miss + ser;
alias ser_any_closesthit_intersection_miss = anyhit_closesthit_intersection_miss + ser;
alias ser_anyhit_closesthit_intersection = anyhit_closesthit_intersection + ser;
alias ser_anyhit_closesthit = anyhit_closesthit + ser;
alias ser_motion_raygen_closesthit_miss = raygen_closesthit_miss + ser_motion;
alias ser_motion_raygen = raygen + ser_motion;
alias all = _sm_6_7 + hlsl_nvapi
| sm_6_7
+ ser + shaderclock + texturefootprint + fragmentshaderinterlock + _GL_NV_shader_subgroup_partitioned
+ _GL_NV_ray_tracing_motion_blur + _GL_NV_shader_texture_footprint
| spirv_1_5 + sm_6_7
+ ser + shaderclock + texturefootprint + fragmentshaderinterlock + spvGroupNonUniformPartitionedNV
+ spvRayTracingMotionBlurNV + spvRayTracingMotionBlurNV;
|