rspirv/dr/
autogen_operand.rs

1// AUTOMATICALLY GENERATED from the SPIR-V JSON grammar:
2//   external/spirv.core.grammar.json.
3// DO NOT MODIFY!
4
5#[doc = "Data representation of a SPIR-V operand."]
6#[derive(Clone, Debug, PartialEq, Eq, Hash)]
7#[allow(clippy::upper_case_acronyms)]
8pub enum Operand {
9    ImageOperands(spirv::ImageOperands),
10    FPFastMathMode(spirv::FPFastMathMode),
11    SelectionControl(spirv::SelectionControl),
12    LoopControl(spirv::LoopControl),
13    FunctionControl(spirv::FunctionControl),
14    MemorySemantics(spirv::MemorySemantics),
15    MemoryAccess(spirv::MemoryAccess),
16    KernelProfilingInfo(spirv::KernelProfilingInfo),
17    RayFlags(spirv::RayFlags),
18    FragmentShadingRate(spirv::FragmentShadingRate),
19    SourceLanguage(spirv::SourceLanguage),
20    ExecutionModel(spirv::ExecutionModel),
21    AddressingModel(spirv::AddressingModel),
22    MemoryModel(spirv::MemoryModel),
23    ExecutionMode(spirv::ExecutionMode),
24    StorageClass(spirv::StorageClass),
25    Dim(spirv::Dim),
26    SamplerAddressingMode(spirv::SamplerAddressingMode),
27    SamplerFilterMode(spirv::SamplerFilterMode),
28    ImageFormat(spirv::ImageFormat),
29    ImageChannelOrder(spirv::ImageChannelOrder),
30    ImageChannelDataType(spirv::ImageChannelDataType),
31    FPRoundingMode(spirv::FPRoundingMode),
32    FPDenormMode(spirv::FPDenormMode),
33    QuantizationModes(spirv::QuantizationModes),
34    FPOperationMode(spirv::FPOperationMode),
35    OverflowModes(spirv::OverflowModes),
36    LinkageType(spirv::LinkageType),
37    AccessQualifier(spirv::AccessQualifier),
38    HostAccessQualifier(spirv::HostAccessQualifier),
39    FunctionParameterAttribute(spirv::FunctionParameterAttribute),
40    Decoration(spirv::Decoration),
41    BuiltIn(spirv::BuiltIn),
42    Scope(spirv::Scope),
43    GroupOperation(spirv::GroupOperation),
44    KernelEnqueueFlags(spirv::KernelEnqueueFlags),
45    Capability(spirv::Capability),
46    RayQueryIntersection(spirv::RayQueryIntersection),
47    RayQueryCommittedIntersectionType(spirv::RayQueryCommittedIntersectionType),
48    RayQueryCandidateIntersectionType(spirv::RayQueryCandidateIntersectionType),
49    PackedVectorFormat(spirv::PackedVectorFormat),
50    CooperativeMatrixOperands(spirv::CooperativeMatrixOperands),
51    CooperativeMatrixLayout(spirv::CooperativeMatrixLayout),
52    CooperativeMatrixUse(spirv::CooperativeMatrixUse),
53    InitializationModeQualifier(spirv::InitializationModeQualifier),
54    LoadCacheControl(spirv::LoadCacheControl),
55    StoreCacheControl(spirv::StoreCacheControl),
56    IdMemorySemantics(spirv::Word),
57    IdScope(spirv::Word),
58    IdRef(spirv::Word),
59    LiteralBit32(u32),
60    LiteralBit64(u64),
61    LiteralExtInstInteger(u32),
62    LiteralSpecConstantOpInteger(spirv::Op),
63    LiteralString(String),
64}
65impl From<spirv::ImageOperands> for Operand {
66    fn from(o: spirv::ImageOperands) -> Self {
67        Self::ImageOperands(o)
68    }
69}
70impl From<spirv::FPFastMathMode> for Operand {
71    fn from(o: spirv::FPFastMathMode) -> Self {
72        Self::FPFastMathMode(o)
73    }
74}
75impl From<spirv::SelectionControl> for Operand {
76    fn from(o: spirv::SelectionControl) -> Self {
77        Self::SelectionControl(o)
78    }
79}
80impl From<spirv::LoopControl> for Operand {
81    fn from(o: spirv::LoopControl) -> Self {
82        Self::LoopControl(o)
83    }
84}
85impl From<spirv::FunctionControl> for Operand {
86    fn from(o: spirv::FunctionControl) -> Self {
87        Self::FunctionControl(o)
88    }
89}
90impl From<spirv::MemorySemantics> for Operand {
91    fn from(o: spirv::MemorySemantics) -> Self {
92        Self::MemorySemantics(o)
93    }
94}
95impl From<spirv::MemoryAccess> for Operand {
96    fn from(o: spirv::MemoryAccess) -> Self {
97        Self::MemoryAccess(o)
98    }
99}
100impl From<spirv::KernelProfilingInfo> for Operand {
101    fn from(o: spirv::KernelProfilingInfo) -> Self {
102        Self::KernelProfilingInfo(o)
103    }
104}
105impl From<spirv::RayFlags> for Operand {
106    fn from(o: spirv::RayFlags) -> Self {
107        Self::RayFlags(o)
108    }
109}
110impl From<spirv::FragmentShadingRate> for Operand {
111    fn from(o: spirv::FragmentShadingRate) -> Self {
112        Self::FragmentShadingRate(o)
113    }
114}
115impl From<spirv::SourceLanguage> for Operand {
116    fn from(o: spirv::SourceLanguage) -> Self {
117        Self::SourceLanguage(o)
118    }
119}
120impl From<spirv::ExecutionModel> for Operand {
121    fn from(o: spirv::ExecutionModel) -> Self {
122        Self::ExecutionModel(o)
123    }
124}
125impl From<spirv::AddressingModel> for Operand {
126    fn from(o: spirv::AddressingModel) -> Self {
127        Self::AddressingModel(o)
128    }
129}
130impl From<spirv::MemoryModel> for Operand {
131    fn from(o: spirv::MemoryModel) -> Self {
132        Self::MemoryModel(o)
133    }
134}
135impl From<spirv::ExecutionMode> for Operand {
136    fn from(o: spirv::ExecutionMode) -> Self {
137        Self::ExecutionMode(o)
138    }
139}
140impl From<spirv::StorageClass> for Operand {
141    fn from(o: spirv::StorageClass) -> Self {
142        Self::StorageClass(o)
143    }
144}
145impl From<spirv::Dim> for Operand {
146    fn from(o: spirv::Dim) -> Self {
147        Self::Dim(o)
148    }
149}
150impl From<spirv::SamplerAddressingMode> for Operand {
151    fn from(o: spirv::SamplerAddressingMode) -> Self {
152        Self::SamplerAddressingMode(o)
153    }
154}
155impl From<spirv::SamplerFilterMode> for Operand {
156    fn from(o: spirv::SamplerFilterMode) -> Self {
157        Self::SamplerFilterMode(o)
158    }
159}
160impl From<spirv::ImageFormat> for Operand {
161    fn from(o: spirv::ImageFormat) -> Self {
162        Self::ImageFormat(o)
163    }
164}
165impl From<spirv::ImageChannelOrder> for Operand {
166    fn from(o: spirv::ImageChannelOrder) -> Self {
167        Self::ImageChannelOrder(o)
168    }
169}
170impl From<spirv::ImageChannelDataType> for Operand {
171    fn from(o: spirv::ImageChannelDataType) -> Self {
172        Self::ImageChannelDataType(o)
173    }
174}
175impl From<spirv::FPRoundingMode> for Operand {
176    fn from(o: spirv::FPRoundingMode) -> Self {
177        Self::FPRoundingMode(o)
178    }
179}
180impl From<spirv::FPDenormMode> for Operand {
181    fn from(o: spirv::FPDenormMode) -> Self {
182        Self::FPDenormMode(o)
183    }
184}
185impl From<spirv::QuantizationModes> for Operand {
186    fn from(o: spirv::QuantizationModes) -> Self {
187        Self::QuantizationModes(o)
188    }
189}
190impl From<spirv::FPOperationMode> for Operand {
191    fn from(o: spirv::FPOperationMode) -> Self {
192        Self::FPOperationMode(o)
193    }
194}
195impl From<spirv::OverflowModes> for Operand {
196    fn from(o: spirv::OverflowModes) -> Self {
197        Self::OverflowModes(o)
198    }
199}
200impl From<spirv::LinkageType> for Operand {
201    fn from(o: spirv::LinkageType) -> Self {
202        Self::LinkageType(o)
203    }
204}
205impl From<spirv::AccessQualifier> for Operand {
206    fn from(o: spirv::AccessQualifier) -> Self {
207        Self::AccessQualifier(o)
208    }
209}
210impl From<spirv::HostAccessQualifier> for Operand {
211    fn from(o: spirv::HostAccessQualifier) -> Self {
212        Self::HostAccessQualifier(o)
213    }
214}
215impl From<spirv::FunctionParameterAttribute> for Operand {
216    fn from(o: spirv::FunctionParameterAttribute) -> Self {
217        Self::FunctionParameterAttribute(o)
218    }
219}
220impl From<spirv::Decoration> for Operand {
221    fn from(o: spirv::Decoration) -> Self {
222        Self::Decoration(o)
223    }
224}
225impl From<spirv::BuiltIn> for Operand {
226    fn from(o: spirv::BuiltIn) -> Self {
227        Self::BuiltIn(o)
228    }
229}
230impl From<spirv::Scope> for Operand {
231    fn from(o: spirv::Scope) -> Self {
232        Self::Scope(o)
233    }
234}
235impl From<spirv::GroupOperation> for Operand {
236    fn from(o: spirv::GroupOperation) -> Self {
237        Self::GroupOperation(o)
238    }
239}
240impl From<spirv::KernelEnqueueFlags> for Operand {
241    fn from(o: spirv::KernelEnqueueFlags) -> Self {
242        Self::KernelEnqueueFlags(o)
243    }
244}
245impl From<spirv::Capability> for Operand {
246    fn from(o: spirv::Capability) -> Self {
247        Self::Capability(o)
248    }
249}
250impl From<spirv::RayQueryIntersection> for Operand {
251    fn from(o: spirv::RayQueryIntersection) -> Self {
252        Self::RayQueryIntersection(o)
253    }
254}
255impl From<spirv::RayQueryCommittedIntersectionType> for Operand {
256    fn from(o: spirv::RayQueryCommittedIntersectionType) -> Self {
257        Self::RayQueryCommittedIntersectionType(o)
258    }
259}
260impl From<spirv::RayQueryCandidateIntersectionType> for Operand {
261    fn from(o: spirv::RayQueryCandidateIntersectionType) -> Self {
262        Self::RayQueryCandidateIntersectionType(o)
263    }
264}
265impl From<spirv::PackedVectorFormat> for Operand {
266    fn from(o: spirv::PackedVectorFormat) -> Self {
267        Self::PackedVectorFormat(o)
268    }
269}
270impl From<spirv::CooperativeMatrixOperands> for Operand {
271    fn from(o: spirv::CooperativeMatrixOperands) -> Self {
272        Self::CooperativeMatrixOperands(o)
273    }
274}
275impl From<spirv::CooperativeMatrixLayout> for Operand {
276    fn from(o: spirv::CooperativeMatrixLayout) -> Self {
277        Self::CooperativeMatrixLayout(o)
278    }
279}
280impl From<spirv::CooperativeMatrixUse> for Operand {
281    fn from(o: spirv::CooperativeMatrixUse) -> Self {
282        Self::CooperativeMatrixUse(o)
283    }
284}
285impl From<spirv::InitializationModeQualifier> for Operand {
286    fn from(o: spirv::InitializationModeQualifier) -> Self {
287        Self::InitializationModeQualifier(o)
288    }
289}
290impl From<spirv::LoadCacheControl> for Operand {
291    fn from(o: spirv::LoadCacheControl) -> Self {
292        Self::LoadCacheControl(o)
293    }
294}
295impl From<spirv::StoreCacheControl> for Operand {
296    fn from(o: spirv::StoreCacheControl) -> Self {
297        Self::StoreCacheControl(o)
298    }
299}
300impl From<u32> for Operand {
301    fn from(o: u32) -> Self {
302        Self::LiteralBit32(o)
303    }
304}
305impl From<u64> for Operand {
306    fn from(o: u64) -> Self {
307        Self::LiteralBit64(o)
308    }
309}
310impl From<spirv::Op> for Operand {
311    fn from(o: spirv::Op) -> Self {
312        Self::LiteralSpecConstantOpInteger(o)
313    }
314}
315impl From<String> for Operand {
316    fn from(o: String) -> Self {
317        Self::LiteralString(o)
318    }
319}
320impl fmt::Display for Operand {
321    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
322        match *self {
323            Operand::ImageOperands(ref v) => write!(f, "{:?}", v),
324            Operand::FPFastMathMode(ref v) => write!(f, "{:?}", v),
325            Operand::SelectionControl(ref v) => write!(f, "{:?}", v),
326            Operand::LoopControl(ref v) => write!(f, "{:?}", v),
327            Operand::FunctionControl(ref v) => write!(f, "{:?}", v),
328            Operand::MemorySemantics(ref v) => write!(f, "{:?}", v),
329            Operand::MemoryAccess(ref v) => write!(f, "{:?}", v),
330            Operand::KernelProfilingInfo(ref v) => write!(f, "{:?}", v),
331            Operand::RayFlags(ref v) => write!(f, "{:?}", v),
332            Operand::FragmentShadingRate(ref v) => write!(f, "{:?}", v),
333            Operand::SourceLanguage(ref v) => write!(f, "{:?}", v),
334            Operand::ExecutionModel(ref v) => write!(f, "{:?}", v),
335            Operand::AddressingModel(ref v) => write!(f, "{:?}", v),
336            Operand::MemoryModel(ref v) => write!(f, "{:?}", v),
337            Operand::ExecutionMode(ref v) => write!(f, "{:?}", v),
338            Operand::StorageClass(ref v) => write!(f, "{:?}", v),
339            Operand::Dim(ref v) => write!(f, "{}", &format!("{:?}", v)[3..]),
340            Operand::SamplerAddressingMode(ref v) => write!(f, "{:?}", v),
341            Operand::SamplerFilterMode(ref v) => write!(f, "{:?}", v),
342            Operand::ImageFormat(ref v) => write!(f, "{:?}", v),
343            Operand::ImageChannelOrder(ref v) => write!(f, "{:?}", v),
344            Operand::ImageChannelDataType(ref v) => write!(f, "{:?}", v),
345            Operand::FPRoundingMode(ref v) => write!(f, "{:?}", v),
346            Operand::FPDenormMode(ref v) => write!(f, "{:?}", v),
347            Operand::QuantizationModes(ref v) => write!(f, "{:?}", v),
348            Operand::FPOperationMode(ref v) => write!(f, "{:?}", v),
349            Operand::OverflowModes(ref v) => write!(f, "{:?}", v),
350            Operand::LinkageType(ref v) => write!(f, "{:?}", v),
351            Operand::AccessQualifier(ref v) => write!(f, "{:?}", v),
352            Operand::HostAccessQualifier(ref v) => write!(f, "{:?}", v),
353            Operand::FunctionParameterAttribute(ref v) => write!(f, "{:?}", v),
354            Operand::Decoration(ref v) => write!(f, "{:?}", v),
355            Operand::BuiltIn(ref v) => write!(f, "{:?}", v),
356            Operand::Scope(ref v) => write!(f, "{:?}", v),
357            Operand::GroupOperation(ref v) => write!(f, "{:?}", v),
358            Operand::KernelEnqueueFlags(ref v) => write!(f, "{:?}", v),
359            Operand::Capability(ref v) => write!(f, "{:?}", v),
360            Operand::RayQueryIntersection(ref v) => write!(f, "{:?}", v),
361            Operand::RayQueryCommittedIntersectionType(ref v) => write!(f, "{:?}", v),
362            Operand::RayQueryCandidateIntersectionType(ref v) => write!(f, "{:?}", v),
363            Operand::PackedVectorFormat(ref v) => write!(f, "{:?}", v),
364            Operand::CooperativeMatrixOperands(ref v) => write!(f, "{:?}", v),
365            Operand::CooperativeMatrixLayout(ref v) => write!(f, "{:?}", v),
366            Operand::CooperativeMatrixUse(ref v) => write!(f, "{:?}", v),
367            Operand::InitializationModeQualifier(ref v) => write!(f, "{:?}", v),
368            Operand::LoadCacheControl(ref v) => write!(f, "{:?}", v),
369            Operand::StoreCacheControl(ref v) => write!(f, "{:?}", v),
370            Operand::IdMemorySemantics(ref v) => write!(f, "%{}", v),
371            Operand::IdScope(ref v) => write!(f, "%{}", v),
372            Operand::IdRef(ref v) => write!(f, "%{}", v),
373            Operand::LiteralString(ref v) => write!(f, "{:?}", v),
374            Operand::LiteralExtInstInteger(ref v) => write!(f, "{:?}", v),
375            Operand::LiteralSpecConstantOpInteger(ref v) => write!(f, "{:?}", v),
376            Operand::LiteralBit32(ref v) => write!(f, "{:?}", v),
377            Operand::LiteralBit64(ref v) => write!(f, "{:?}", v),
378        }
379    }
380}
381impl Operand {
382    pub fn unwrap_image_operands(&self) -> spirv::ImageOperands {
383        match *self {
384            Self::ImageOperands(v) => v,
385            ref other => panic!("Expected Operand::ImageOperands, got {} instead", other),
386        }
387    }
388    pub fn unwrap_fp_fast_math_mode(&self) -> spirv::FPFastMathMode {
389        match *self {
390            Self::FPFastMathMode(v) => v,
391            ref other => panic!("Expected Operand::FPFastMathMode, got {} instead", other),
392        }
393    }
394    pub fn unwrap_selection_control(&self) -> spirv::SelectionControl {
395        match *self {
396            Self::SelectionControl(v) => v,
397            ref other => panic!("Expected Operand::SelectionControl, got {} instead", other),
398        }
399    }
400    pub fn unwrap_loop_control(&self) -> spirv::LoopControl {
401        match *self {
402            Self::LoopControl(v) => v,
403            ref other => panic!("Expected Operand::LoopControl, got {} instead", other),
404        }
405    }
406    pub fn unwrap_function_control(&self) -> spirv::FunctionControl {
407        match *self {
408            Self::FunctionControl(v) => v,
409            ref other => panic!("Expected Operand::FunctionControl, got {} instead", other),
410        }
411    }
412    pub fn unwrap_memory_semantics(&self) -> spirv::MemorySemantics {
413        match *self {
414            Self::MemorySemantics(v) => v,
415            ref other => panic!("Expected Operand::MemorySemantics, got {} instead", other),
416        }
417    }
418    pub fn unwrap_memory_access(&self) -> spirv::MemoryAccess {
419        match *self {
420            Self::MemoryAccess(v) => v,
421            ref other => panic!("Expected Operand::MemoryAccess, got {} instead", other),
422        }
423    }
424    pub fn unwrap_kernel_profiling_info(&self) -> spirv::KernelProfilingInfo {
425        match *self {
426            Self::KernelProfilingInfo(v) => v,
427            ref other => panic!(
428                "Expected Operand::KernelProfilingInfo, got {} instead",
429                other
430            ),
431        }
432    }
433    pub fn unwrap_ray_flags(&self) -> spirv::RayFlags {
434        match *self {
435            Self::RayFlags(v) => v,
436            ref other => panic!("Expected Operand::RayFlags, got {} instead", other),
437        }
438    }
439    pub fn unwrap_fragment_shading_rate(&self) -> spirv::FragmentShadingRate {
440        match *self {
441            Self::FragmentShadingRate(v) => v,
442            ref other => panic!(
443                "Expected Operand::FragmentShadingRate, got {} instead",
444                other
445            ),
446        }
447    }
448    pub fn unwrap_source_language(&self) -> spirv::SourceLanguage {
449        match *self {
450            Self::SourceLanguage(v) => v,
451            ref other => panic!("Expected Operand::SourceLanguage, got {} instead", other),
452        }
453    }
454    pub fn unwrap_execution_model(&self) -> spirv::ExecutionModel {
455        match *self {
456            Self::ExecutionModel(v) => v,
457            ref other => panic!("Expected Operand::ExecutionModel, got {} instead", other),
458        }
459    }
460    pub fn unwrap_addressing_model(&self) -> spirv::AddressingModel {
461        match *self {
462            Self::AddressingModel(v) => v,
463            ref other => panic!("Expected Operand::AddressingModel, got {} instead", other),
464        }
465    }
466    pub fn unwrap_memory_model(&self) -> spirv::MemoryModel {
467        match *self {
468            Self::MemoryModel(v) => v,
469            ref other => panic!("Expected Operand::MemoryModel, got {} instead", other),
470        }
471    }
472    pub fn unwrap_execution_mode(&self) -> spirv::ExecutionMode {
473        match *self {
474            Self::ExecutionMode(v) => v,
475            ref other => panic!("Expected Operand::ExecutionMode, got {} instead", other),
476        }
477    }
478    pub fn unwrap_storage_class(&self) -> spirv::StorageClass {
479        match *self {
480            Self::StorageClass(v) => v,
481            ref other => panic!("Expected Operand::StorageClass, got {} instead", other),
482        }
483    }
484    pub fn unwrap_dim(&self) -> spirv::Dim {
485        match *self {
486            Self::Dim(v) => v,
487            ref other => panic!("Expected Operand::Dim, got {} instead", other),
488        }
489    }
490    pub fn unwrap_sampler_addressing_mode(&self) -> spirv::SamplerAddressingMode {
491        match *self {
492            Self::SamplerAddressingMode(v) => v,
493            ref other => panic!(
494                "Expected Operand::SamplerAddressingMode, got {} instead",
495                other
496            ),
497        }
498    }
499    pub fn unwrap_sampler_filter_mode(&self) -> spirv::SamplerFilterMode {
500        match *self {
501            Self::SamplerFilterMode(v) => v,
502            ref other => panic!("Expected Operand::SamplerFilterMode, got {} instead", other),
503        }
504    }
505    pub fn unwrap_image_format(&self) -> spirv::ImageFormat {
506        match *self {
507            Self::ImageFormat(v) => v,
508            ref other => panic!("Expected Operand::ImageFormat, got {} instead", other),
509        }
510    }
511    pub fn unwrap_image_channel_order(&self) -> spirv::ImageChannelOrder {
512        match *self {
513            Self::ImageChannelOrder(v) => v,
514            ref other => panic!("Expected Operand::ImageChannelOrder, got {} instead", other),
515        }
516    }
517    pub fn unwrap_image_channel_data_type(&self) -> spirv::ImageChannelDataType {
518        match *self {
519            Self::ImageChannelDataType(v) => v,
520            ref other => panic!(
521                "Expected Operand::ImageChannelDataType, got {} instead",
522                other
523            ),
524        }
525    }
526    pub fn unwrap_fp_rounding_mode(&self) -> spirv::FPRoundingMode {
527        match *self {
528            Self::FPRoundingMode(v) => v,
529            ref other => panic!("Expected Operand::FPRoundingMode, got {} instead", other),
530        }
531    }
532    pub fn unwrap_fp_denorm_mode(&self) -> spirv::FPDenormMode {
533        match *self {
534            Self::FPDenormMode(v) => v,
535            ref other => panic!("Expected Operand::FPDenormMode, got {} instead", other),
536        }
537    }
538    pub fn unwrap_quantization_modes(&self) -> spirv::QuantizationModes {
539        match *self {
540            Self::QuantizationModes(v) => v,
541            ref other => panic!("Expected Operand::QuantizationModes, got {} instead", other),
542        }
543    }
544    pub fn unwrap_fp_operation_mode(&self) -> spirv::FPOperationMode {
545        match *self {
546            Self::FPOperationMode(v) => v,
547            ref other => panic!("Expected Operand::FPOperationMode, got {} instead", other),
548        }
549    }
550    pub fn unwrap_overflow_modes(&self) -> spirv::OverflowModes {
551        match *self {
552            Self::OverflowModes(v) => v,
553            ref other => panic!("Expected Operand::OverflowModes, got {} instead", other),
554        }
555    }
556    pub fn unwrap_linkage_type(&self) -> spirv::LinkageType {
557        match *self {
558            Self::LinkageType(v) => v,
559            ref other => panic!("Expected Operand::LinkageType, got {} instead", other),
560        }
561    }
562    pub fn unwrap_access_qualifier(&self) -> spirv::AccessQualifier {
563        match *self {
564            Self::AccessQualifier(v) => v,
565            ref other => panic!("Expected Operand::AccessQualifier, got {} instead", other),
566        }
567    }
568    pub fn unwrap_host_access_qualifier(&self) -> spirv::HostAccessQualifier {
569        match *self {
570            Self::HostAccessQualifier(v) => v,
571            ref other => panic!(
572                "Expected Operand::HostAccessQualifier, got {} instead",
573                other
574            ),
575        }
576    }
577    pub fn unwrap_function_parameter_attribute(&self) -> spirv::FunctionParameterAttribute {
578        match *self {
579            Self::FunctionParameterAttribute(v) => v,
580            ref other => panic!(
581                "Expected Operand::FunctionParameterAttribute, got {} instead",
582                other
583            ),
584        }
585    }
586    pub fn unwrap_decoration(&self) -> spirv::Decoration {
587        match *self {
588            Self::Decoration(v) => v,
589            ref other => panic!("Expected Operand::Decoration, got {} instead", other),
590        }
591    }
592    pub fn unwrap_built_in(&self) -> spirv::BuiltIn {
593        match *self {
594            Self::BuiltIn(v) => v,
595            ref other => panic!("Expected Operand::BuiltIn, got {} instead", other),
596        }
597    }
598    pub fn unwrap_scope(&self) -> spirv::Scope {
599        match *self {
600            Self::Scope(v) => v,
601            ref other => panic!("Expected Operand::Scope, got {} instead", other),
602        }
603    }
604    pub fn unwrap_group_operation(&self) -> spirv::GroupOperation {
605        match *self {
606            Self::GroupOperation(v) => v,
607            ref other => panic!("Expected Operand::GroupOperation, got {} instead", other),
608        }
609    }
610    pub fn unwrap_kernel_enqueue_flags(&self) -> spirv::KernelEnqueueFlags {
611        match *self {
612            Self::KernelEnqueueFlags(v) => v,
613            ref other => panic!(
614                "Expected Operand::KernelEnqueueFlags, got {} instead",
615                other
616            ),
617        }
618    }
619    pub fn unwrap_capability(&self) -> spirv::Capability {
620        match *self {
621            Self::Capability(v) => v,
622            ref other => panic!("Expected Operand::Capability, got {} instead", other),
623        }
624    }
625    pub fn unwrap_ray_query_intersection(&self) -> spirv::RayQueryIntersection {
626        match *self {
627            Self::RayQueryIntersection(v) => v,
628            ref other => panic!(
629                "Expected Operand::RayQueryIntersection, got {} instead",
630                other
631            ),
632        }
633    }
634    pub fn unwrap_ray_query_committed_intersection_type(
635        &self,
636    ) -> spirv::RayQueryCommittedIntersectionType {
637        match *self {
638            Self::RayQueryCommittedIntersectionType(v) => v,
639            ref other => panic!(
640                "Expected Operand::RayQueryCommittedIntersectionType, got {} instead",
641                other
642            ),
643        }
644    }
645    pub fn unwrap_ray_query_candidate_intersection_type(
646        &self,
647    ) -> spirv::RayQueryCandidateIntersectionType {
648        match *self {
649            Self::RayQueryCandidateIntersectionType(v) => v,
650            ref other => panic!(
651                "Expected Operand::RayQueryCandidateIntersectionType, got {} instead",
652                other
653            ),
654        }
655    }
656    pub fn unwrap_packed_vector_format(&self) -> spirv::PackedVectorFormat {
657        match *self {
658            Self::PackedVectorFormat(v) => v,
659            ref other => panic!(
660                "Expected Operand::PackedVectorFormat, got {} instead",
661                other
662            ),
663        }
664    }
665    pub fn unwrap_cooperative_matrix_operands(&self) -> spirv::CooperativeMatrixOperands {
666        match *self {
667            Self::CooperativeMatrixOperands(v) => v,
668            ref other => panic!(
669                "Expected Operand::CooperativeMatrixOperands, got {} instead",
670                other
671            ),
672        }
673    }
674    pub fn unwrap_cooperative_matrix_layout(&self) -> spirv::CooperativeMatrixLayout {
675        match *self {
676            Self::CooperativeMatrixLayout(v) => v,
677            ref other => panic!(
678                "Expected Operand::CooperativeMatrixLayout, got {} instead",
679                other
680            ),
681        }
682    }
683    pub fn unwrap_cooperative_matrix_use(&self) -> spirv::CooperativeMatrixUse {
684        match *self {
685            Self::CooperativeMatrixUse(v) => v,
686            ref other => panic!(
687                "Expected Operand::CooperativeMatrixUse, got {} instead",
688                other
689            ),
690        }
691    }
692    pub fn unwrap_initialization_mode_qualifier(&self) -> spirv::InitializationModeQualifier {
693        match *self {
694            Self::InitializationModeQualifier(v) => v,
695            ref other => panic!(
696                "Expected Operand::InitializationModeQualifier, got {} instead",
697                other
698            ),
699        }
700    }
701    pub fn unwrap_load_cache_control(&self) -> spirv::LoadCacheControl {
702        match *self {
703            Self::LoadCacheControl(v) => v,
704            ref other => panic!("Expected Operand::LoadCacheControl, got {} instead", other),
705        }
706    }
707    pub fn unwrap_store_cache_control(&self) -> spirv::StoreCacheControl {
708        match *self {
709            Self::StoreCacheControl(v) => v,
710            ref other => panic!("Expected Operand::StoreCacheControl, got {} instead", other),
711        }
712    }
713    pub fn unwrap_id_memory_semantics(&self) -> spirv::Word {
714        match *self {
715            Self::IdMemorySemantics(v) => v,
716            ref other => panic!("Expected Operand::IdMemorySemantics, got {} instead", other),
717        }
718    }
719    pub fn unwrap_id_scope(&self) -> spirv::Word {
720        match *self {
721            Self::IdScope(v) => v,
722            ref other => panic!("Expected Operand::IdScope, got {} instead", other),
723        }
724    }
725    pub fn unwrap_id_ref(&self) -> spirv::Word {
726        match *self {
727            Self::IdRef(v) => v,
728            ref other => panic!("Expected Operand::IdRef, got {} instead", other),
729        }
730    }
731    pub fn unwrap_literal_bit32(&self) -> u32 {
732        match *self {
733            Self::LiteralBit32(v) => v,
734            ref other => panic!("Expected Operand::LiteralBit32, got {} instead", other),
735        }
736    }
737    pub fn unwrap_literal_bit64(&self) -> u64 {
738        match *self {
739            Self::LiteralBit64(v) => v,
740            ref other => panic!("Expected Operand::LiteralBit64, got {} instead", other),
741        }
742    }
743    pub fn unwrap_literal_ext_inst_integer(&self) -> u32 {
744        match *self {
745            Self::LiteralExtInstInteger(v) => v,
746            ref other => panic!(
747                "Expected Operand::LiteralExtInstInteger, got {} instead",
748                other
749            ),
750        }
751    }
752    pub fn unwrap_literal_spec_constant_op_integer(&self) -> spirv::Op {
753        match *self {
754            Self::LiteralSpecConstantOpInteger(v) => v,
755            ref other => panic!(
756                "Expected Operand::LiteralSpecConstantOpInteger, got {} instead",
757                other
758            ),
759        }
760    }
761    pub fn unwrap_literal_string(&self) -> &str {
762        match self {
763            Self::LiteralString(v) => v,
764            ref other => panic!("Expected Operand::LiteralString, got {} instead", other),
765        }
766    }
767    pub fn id_ref_any(&self) -> Option<spirv::Word> {
768        match *self {
769            Self::IdRef(v) | Self::IdScope(v) | Self::IdMemorySemantics(v) => Some(v),
770            _ => None,
771        }
772    }
773    pub fn id_ref_any_mut(&mut self) -> Option<&mut spirv::Word> {
774        match self {
775            Self::IdRef(v) | Self::IdScope(v) | Self::IdMemorySemantics(v) => Some(v),
776            _ => None,
777        }
778    }
779    pub fn required_capabilities(&self) -> Vec<spirv::Capability> {
780        use spirv as s;
781        match self {
782            Self::ImageOperands(v) => {
783                let mut result = vec![];
784                if v.intersects(s::ImageOperands::OFFSET | s::ImageOperands::CONST_OFFSETS) {
785                    result.extend_from_slice(&[spirv::Capability::ImageGatherExtended])
786                };
787                if v.intersects(s::ImageOperands::MIN_LOD) {
788                    result.extend_from_slice(&[spirv::Capability::MinLod])
789                };
790                if v.intersects(s::ImageOperands::BIAS) {
791                    result.extend_from_slice(&[spirv::Capability::Shader])
792                };
793                if v.intersects(
794                    s::ImageOperands::MAKE_TEXEL_AVAILABLE
795                        | s::ImageOperands::MAKE_TEXEL_VISIBLE
796                        | s::ImageOperands::NON_PRIVATE_TEXEL
797                        | s::ImageOperands::VOLATILE_TEXEL,
798                ) {
799                    result.extend_from_slice(&[spirv::Capability::VulkanMemoryModel])
800                };
801                result
802            }
803            Self::FPFastMathMode(v) => {
804                let mut result = vec![];
805                if v.intersects(
806                    s::FPFastMathMode::ALLOW_CONTRACT_FAST_INTEL
807                        | s::FPFastMathMode::ALLOW_REASSOC_INTEL,
808                ) {
809                    result.extend_from_slice(&[spirv::Capability::FPFastMathModeINTEL])
810                };
811                result
812            }
813            Self::LoopControl(v) => {
814                let mut result = vec![];
815                if v.intersects(
816                    s::LoopControl::INITIATION_INTERVAL_INTEL
817                        | s::LoopControl::MAX_CONCURRENCY_INTEL
818                        | s::LoopControl::DEPENDENCY_ARRAY_INTEL
819                        | s::LoopControl::PIPELINE_ENABLE_INTEL
820                        | s::LoopControl::LOOP_COALESCE_INTEL
821                        | s::LoopControl::MAX_INTERLEAVING_INTEL
822                        | s::LoopControl::SPECULATED_ITERATIONS_INTEL
823                        | s::LoopControl::NO_FUSION_INTEL
824                        | s::LoopControl::LOOP_COUNT_INTEL
825                        | s::LoopControl::MAX_REINVOCATION_DELAY_INTEL,
826                ) {
827                    result.extend_from_slice(&[spirv::Capability::FPGALoopControlsINTEL])
828                };
829                result
830            }
831            Self::FunctionControl(v) => {
832                let mut result = vec![];
833                if v.intersects(s::FunctionControl::OPT_NONE_INTEL) {
834                    result.extend_from_slice(&[spirv::Capability::OptNoneINTEL])
835                };
836                result
837            }
838            Self::MemorySemantics(v) => {
839                let mut result = vec![];
840                if v.intersects(s::MemorySemantics::ATOMIC_COUNTER_MEMORY) {
841                    result.extend_from_slice(&[spirv::Capability::AtomicStorage])
842                };
843                if v.intersects(s::MemorySemantics::UNIFORM_MEMORY) {
844                    result.extend_from_slice(&[spirv::Capability::Shader])
845                };
846                if v.intersects(
847                    s::MemorySemantics::OUTPUT_MEMORY
848                        | s::MemorySemantics::MAKE_AVAILABLE
849                        | s::MemorySemantics::MAKE_VISIBLE
850                        | s::MemorySemantics::VOLATILE,
851                ) {
852                    result.extend_from_slice(&[spirv::Capability::VulkanMemoryModel])
853                };
854                result
855            }
856            Self::MemoryAccess(v) => {
857                let mut result = vec![];
858                if v.intersects(
859                    s::MemoryAccess::ALIAS_SCOPE_INTEL_MASK | s::MemoryAccess::NO_ALIAS_INTEL_MASK,
860                ) {
861                    result.extend_from_slice(&[spirv::Capability::MemoryAccessAliasingINTEL])
862                };
863                if v.intersects(
864                    s::MemoryAccess::MAKE_POINTER_AVAILABLE
865                        | s::MemoryAccess::MAKE_POINTER_VISIBLE
866                        | s::MemoryAccess::NON_PRIVATE_POINTER,
867                ) {
868                    result.extend_from_slice(&[spirv::Capability::VulkanMemoryModel])
869                };
870                result
871            }
872            Self::KernelProfilingInfo(v) => {
873                let mut result = vec![];
874                if v.intersects(s::KernelProfilingInfo::CMD_EXEC_TIME) {
875                    result.extend_from_slice(&[spirv::Capability::Kernel])
876                };
877                result
878            }
879            Self::RayFlags(v) => {
880                let mut result = vec![];
881                if v.intersects(
882                    s::RayFlags::NONE_KHR
883                        | s::RayFlags::OPAQUE_KHR
884                        | s::RayFlags::NO_OPAQUE_KHR
885                        | s::RayFlags::TERMINATE_ON_FIRST_HIT_KHR
886                        | s::RayFlags::SKIP_CLOSEST_HIT_SHADER_KHR
887                        | s::RayFlags::CULL_BACK_FACING_TRIANGLES_KHR
888                        | s::RayFlags::CULL_FRONT_FACING_TRIANGLES_KHR
889                        | s::RayFlags::CULL_OPAQUE_KHR
890                        | s::RayFlags::CULL_NO_OPAQUE_KHR,
891                ) {
892                    result.extend_from_slice(&[
893                        spirv::Capability::RayQueryKHR,
894                        spirv::Capability::RayTracingKHR,
895                    ])
896                };
897                if v.intersects(s::RayFlags::FORCE_OPACITY_MICROMAP2_STATE_EXT) {
898                    result.extend_from_slice(&[spirv::Capability::RayTracingOpacityMicromapEXT])
899                };
900                if v.intersects(s::RayFlags::SKIP_TRIANGLES_KHR | s::RayFlags::SKIP_AAB_BS_KHR) {
901                    result.extend_from_slice(&[spirv::Capability::RayTraversalPrimitiveCullingKHR])
902                };
903                result
904            }
905            Self::FragmentShadingRate(v) => {
906                let mut result = vec![];
907                if v.intersects(
908                    s::FragmentShadingRate::VERTICAL2_PIXELS
909                        | s::FragmentShadingRate::VERTICAL4_PIXELS
910                        | s::FragmentShadingRate::HORIZONTAL2_PIXELS
911                        | s::FragmentShadingRate::HORIZONTAL4_PIXELS,
912                ) {
913                    result.extend_from_slice(&[spirv::Capability::FragmentShadingRateKHR])
914                };
915                result
916            }
917            Self::SourceLanguage(v) => match v {
918                s::SourceLanguage::Unknown
919                | s::SourceLanguage::ESSL
920                | s::SourceLanguage::GLSL
921                | s::SourceLanguage::OpenCL_C
922                | s::SourceLanguage::OpenCL_CPP
923                | s::SourceLanguage::HLSL
924                | s::SourceLanguage::CPP_for_OpenCL
925                | s::SourceLanguage::SYCL
926                | s::SourceLanguage::HERO_C
927                | s::SourceLanguage::NZSL
928                | s::SourceLanguage::WGSL
929                | s::SourceLanguage::Slang => vec![],
930            },
931            Self::ExecutionModel(v) => match v {
932                s::ExecutionModel::Geometry => vec![spirv::Capability::Geometry],
933                s::ExecutionModel::Kernel => vec![spirv::Capability::Kernel],
934                s::ExecutionModel::TaskEXT | s::ExecutionModel::MeshEXT => {
935                    vec![spirv::Capability::MeshShadingEXT]
936                }
937                s::ExecutionModel::TaskNV | s::ExecutionModel::MeshNV => {
938                    vec![spirv::Capability::MeshShadingNV]
939                }
940                s::ExecutionModel::RayGenerationNV
941                | s::ExecutionModel::IntersectionNV
942                | s::ExecutionModel::AnyHitNV
943                | s::ExecutionModel::ClosestHitNV
944                | s::ExecutionModel::MissNV
945                | s::ExecutionModel::CallableNV => vec![
946                    spirv::Capability::RayTracingNV,
947                    spirv::Capability::RayTracingKHR,
948                ],
949                s::ExecutionModel::Vertex
950                | s::ExecutionModel::Fragment
951                | s::ExecutionModel::GLCompute => vec![spirv::Capability::Shader],
952                s::ExecutionModel::TessellationControl
953                | s::ExecutionModel::TessellationEvaluation => {
954                    vec![spirv::Capability::Tessellation]
955                }
956            },
957            Self::AddressingModel(v) => match v {
958                s::AddressingModel::Logical => vec![],
959                s::AddressingModel::Physical32 | s::AddressingModel::Physical64 => {
960                    vec![spirv::Capability::Addresses]
961                }
962                s::AddressingModel::PhysicalStorageBuffer64 => {
963                    vec![spirv::Capability::PhysicalStorageBufferAddresses]
964                }
965            },
966            Self::MemoryModel(v) => match v {
967                s::MemoryModel::OpenCL => vec![spirv::Capability::Kernel],
968                s::MemoryModel::Simple | s::MemoryModel::GLSL450 => vec![spirv::Capability::Shader],
969                s::MemoryModel::Vulkan => vec![spirv::Capability::VulkanMemoryModel],
970            },
971            Self::ExecutionMode(v) => match v {
972                s::ExecutionMode::LocalSize | s::ExecutionMode::LocalSizeId => vec![],
973                s::ExecutionMode::DerivativeGroupLinearNV => {
974                    vec![spirv::Capability::ComputeDerivativeGroupLinearNV]
975                }
976                s::ExecutionMode::DerivativeGroupQuadsNV => {
977                    vec![spirv::Capability::ComputeDerivativeGroupQuadsNV]
978                }
979                s::ExecutionMode::DenormFlushToZero => vec![spirv::Capability::DenormFlushToZero],
980                s::ExecutionMode::DenormPreserve => vec![spirv::Capability::DenormPreserve],
981                s::ExecutionMode::NumSIMDWorkitemsINTEL
982                | s::ExecutionMode::SchedulerTargetFmaxMhzINTEL
983                | s::ExecutionMode::StreamingInterfaceINTEL => {
984                    vec![spirv::Capability::FPGAKernelAttributesINTEL]
985                }
986                s::ExecutionMode::RegisterMapInterfaceINTEL => {
987                    vec![spirv::Capability::FPGAKernelAttributesv2INTEL]
988                }
989                s::ExecutionMode::PixelInterlockOrderedEXT
990                | s::ExecutionMode::PixelInterlockUnorderedEXT => {
991                    vec![spirv::Capability::FragmentShaderPixelInterlockEXT]
992                }
993                s::ExecutionMode::SampleInterlockOrderedEXT
994                | s::ExecutionMode::SampleInterlockUnorderedEXT => {
995                    vec![spirv::Capability::FragmentShaderSampleInterlockEXT]
996                }
997                s::ExecutionMode::ShadingRateInterlockOrderedEXT
998                | s::ExecutionMode::ShadingRateInterlockUnorderedEXT => {
999                    vec![spirv::Capability::FragmentShaderShadingRateInterlockEXT]
1000                }
1001                s::ExecutionMode::Invocations
1002                | s::ExecutionMode::InputPoints
1003                | s::ExecutionMode::InputLines
1004                | s::ExecutionMode::InputLinesAdjacency
1005                | s::ExecutionMode::InputTrianglesAdjacency
1006                | s::ExecutionMode::OutputLineStrip
1007                | s::ExecutionMode::OutputTriangleStrip => vec![spirv::Capability::Geometry],
1008                s::ExecutionMode::OutputPoints => vec![
1009                    spirv::Capability::Geometry,
1010                    spirv::Capability::MeshShadingNV,
1011                    spirv::Capability::MeshShadingEXT,
1012                ],
1013                s::ExecutionMode::Triangles => {
1014                    vec![spirv::Capability::Geometry, spirv::Capability::Tessellation]
1015                }
1016                s::ExecutionMode::OutputVertices => vec![
1017                    spirv::Capability::Geometry,
1018                    spirv::Capability::Tessellation,
1019                    spirv::Capability::MeshShadingNV,
1020                    spirv::Capability::MeshShadingEXT,
1021                ],
1022                s::ExecutionMode::LocalSizeHint
1023                | s::ExecutionMode::VecTypeHint
1024                | s::ExecutionMode::ContractionOff
1025                | s::ExecutionMode::Initializer
1026                | s::ExecutionMode::Finalizer
1027                | s::ExecutionMode::LocalSizeHintId => vec![spirv::Capability::Kernel],
1028                s::ExecutionMode::MaxWorkgroupSizeINTEL
1029                | s::ExecutionMode::MaxWorkDimINTEL
1030                | s::ExecutionMode::NoGlobalOffsetINTEL => {
1031                    vec![spirv::Capability::KernelAttributesINTEL]
1032                }
1033                s::ExecutionMode::OutputLinesNV
1034                | s::ExecutionMode::OutputPrimitivesNV
1035                | s::ExecutionMode::OutputTrianglesNV => vec![
1036                    spirv::Capability::MeshShadingNV,
1037                    spirv::Capability::MeshShadingEXT,
1038                ],
1039                s::ExecutionMode::RoundingModeRTPINTEL
1040                | s::ExecutionMode::RoundingModeRTNINTEL
1041                | s::ExecutionMode::FloatingPointModeALTINTEL
1042                | s::ExecutionMode::FloatingPointModeIEEEINTEL => {
1043                    vec![spirv::Capability::RoundToInfinityINTEL]
1044                }
1045                s::ExecutionMode::RoundingModeRTE => vec![spirv::Capability::RoundingModeRTE],
1046                s::ExecutionMode::RoundingModeRTZ => vec![spirv::Capability::RoundingModeRTZ],
1047                s::ExecutionMode::PostDepthCoverage => {
1048                    vec![spirv::Capability::SampleMaskPostDepthCoverage]
1049                }
1050                s::ExecutionMode::PixelCenterInteger
1051                | s::ExecutionMode::OriginUpperLeft
1052                | s::ExecutionMode::OriginLowerLeft
1053                | s::ExecutionMode::EarlyFragmentTests
1054                | s::ExecutionMode::DepthReplacing
1055                | s::ExecutionMode::DepthGreater
1056                | s::ExecutionMode::DepthLess
1057                | s::ExecutionMode::DepthUnchanged
1058                | s::ExecutionMode::SubgroupUniformControlFlowKHR
1059                | s::ExecutionMode::EarlyAndLateFragmentTestsAMD => vec![spirv::Capability::Shader],
1060                s::ExecutionMode::CoalescingAMDX
1061                | s::ExecutionMode::MaxNodeRecursionAMDX
1062                | s::ExecutionMode::StaticNumWorkgroupsAMDX
1063                | s::ExecutionMode::ShaderIndexAMDX
1064                | s::ExecutionMode::MaxNumWorkgroupsAMDX => {
1065                    vec![spirv::Capability::ShaderEnqueueAMDX]
1066                }
1067                s::ExecutionMode::SignedZeroInfNanPreserve => {
1068                    vec![spirv::Capability::SignedZeroInfNanPreserve]
1069                }
1070                s::ExecutionMode::StencilRefReplacingEXT
1071                | s::ExecutionMode::StencilRefUnchangedFrontAMD
1072                | s::ExecutionMode::StencilRefGreaterFrontAMD
1073                | s::ExecutionMode::StencilRefLessFrontAMD
1074                | s::ExecutionMode::StencilRefUnchangedBackAMD
1075                | s::ExecutionMode::StencilRefGreaterBackAMD
1076                | s::ExecutionMode::StencilRefLessBackAMD => {
1077                    vec![spirv::Capability::StencilExportEXT]
1078                }
1079                s::ExecutionMode::SubgroupSize
1080                | s::ExecutionMode::SubgroupsPerWorkgroup
1081                | s::ExecutionMode::SubgroupsPerWorkgroupId => {
1082                    vec![spirv::Capability::SubgroupDispatch]
1083                }
1084                s::ExecutionMode::SpacingEqual
1085                | s::ExecutionMode::SpacingFractionalEven
1086                | s::ExecutionMode::SpacingFractionalOdd
1087                | s::ExecutionMode::VertexOrderCw
1088                | s::ExecutionMode::VertexOrderCcw
1089                | s::ExecutionMode::PointMode
1090                | s::ExecutionMode::Quads
1091                | s::ExecutionMode::Isolines => vec![spirv::Capability::Tessellation],
1092                s::ExecutionMode::NonCoherentColorAttachmentReadEXT => {
1093                    vec![spirv::Capability::TileImageColorReadAccessEXT]
1094                }
1095                s::ExecutionMode::NonCoherentDepthAttachmentReadEXT => {
1096                    vec![spirv::Capability::TileImageDepthReadAccessEXT]
1097                }
1098                s::ExecutionMode::NonCoherentStencilAttachmentReadEXT => {
1099                    vec![spirv::Capability::TileImageStencilReadAccessEXT]
1100                }
1101                s::ExecutionMode::Xfb => vec![spirv::Capability::TransformFeedback],
1102                s::ExecutionMode::SharedLocalMemorySizeINTEL
1103                | s::ExecutionMode::NamedBarrierCountINTEL => {
1104                    vec![spirv::Capability::VectorComputeINTEL]
1105                }
1106            },
1107            Self::StorageClass(v) => match v {
1108                s::StorageClass::UniformConstant
1109                | s::StorageClass::Input
1110                | s::StorageClass::Workgroup
1111                | s::StorageClass::CrossWorkgroup
1112                | s::StorageClass::Function
1113                | s::StorageClass::Image => vec![],
1114                s::StorageClass::AtomicCounter => vec![spirv::Capability::AtomicStorage],
1115                s::StorageClass::CodeSectionINTEL => vec![spirv::Capability::FunctionPointersINTEL],
1116                s::StorageClass::Generic => vec![spirv::Capability::GenericPointer],
1117                s::StorageClass::TaskPayloadWorkgroupEXT => vec![spirv::Capability::MeshShadingEXT],
1118                s::StorageClass::PhysicalStorageBuffer => {
1119                    vec![spirv::Capability::PhysicalStorageBufferAddresses]
1120                }
1121                s::StorageClass::CallableDataNV
1122                | s::StorageClass::IncomingCallableDataNV
1123                | s::StorageClass::RayPayloadNV
1124                | s::StorageClass::HitAttributeNV
1125                | s::StorageClass::IncomingRayPayloadNV
1126                | s::StorageClass::ShaderRecordBufferNV => vec![
1127                    spirv::Capability::RayTracingNV,
1128                    spirv::Capability::RayTracingKHR,
1129                ],
1130                s::StorageClass::Uniform
1131                | s::StorageClass::Output
1132                | s::StorageClass::PushConstant
1133                | s::StorageClass::StorageBuffer => vec![spirv::Capability::Shader],
1134                s::StorageClass::Private => vec![
1135                    spirv::Capability::Shader,
1136                    spirv::Capability::VectorComputeINTEL,
1137                ],
1138                s::StorageClass::NodePayloadAMDX | s::StorageClass::NodeOutputPayloadAMDX => {
1139                    vec![spirv::Capability::ShaderEnqueueAMDX]
1140                }
1141                s::StorageClass::HitObjectAttributeNV => {
1142                    vec![spirv::Capability::ShaderInvocationReorderNV]
1143                }
1144                s::StorageClass::TileImageEXT => {
1145                    vec![spirv::Capability::TileImageColorReadAccessEXT]
1146                }
1147                s::StorageClass::DeviceOnlyINTEL | s::StorageClass::HostOnlyINTEL => {
1148                    vec![spirv::Capability::USMStorageClassesINTEL]
1149                }
1150            },
1151            Self::Dim(v) => match v {
1152                s::Dim::Dim2D | s::Dim::Dim3D => vec![],
1153                s::Dim::DimSubpassData => vec![spirv::Capability::InputAttachment],
1154                s::Dim::Dim1D => vec![spirv::Capability::Sampled1D],
1155                s::Dim::DimBuffer => vec![spirv::Capability::SampledBuffer],
1156                s::Dim::DimRect => vec![spirv::Capability::SampledRect],
1157                s::Dim::DimCube => vec![spirv::Capability::Shader],
1158                s::Dim::DimTileImageDataEXT => vec![spirv::Capability::TileImageColorReadAccessEXT],
1159            },
1160            Self::SamplerAddressingMode(v) => match v {
1161                s::SamplerAddressingMode::None
1162                | s::SamplerAddressingMode::ClampToEdge
1163                | s::SamplerAddressingMode::Clamp
1164                | s::SamplerAddressingMode::Repeat
1165                | s::SamplerAddressingMode::RepeatMirrored => vec![],
1166            },
1167            Self::SamplerFilterMode(v) => match v {
1168                s::SamplerFilterMode::Nearest | s::SamplerFilterMode::Linear => vec![],
1169            },
1170            Self::ImageFormat(v) => match v {
1171                s::ImageFormat::Unknown => vec![],
1172                s::ImageFormat::R64ui | s::ImageFormat::R64i => {
1173                    vec![spirv::Capability::Int64ImageEXT]
1174                }
1175                s::ImageFormat::Rgba32f
1176                | s::ImageFormat::Rgba16f
1177                | s::ImageFormat::R32f
1178                | s::ImageFormat::Rgba8
1179                | s::ImageFormat::Rgba8Snorm
1180                | s::ImageFormat::Rgba32i
1181                | s::ImageFormat::Rgba16i
1182                | s::ImageFormat::Rgba8i
1183                | s::ImageFormat::R32i
1184                | s::ImageFormat::Rgba32ui
1185                | s::ImageFormat::Rgba16ui
1186                | s::ImageFormat::Rgba8ui
1187                | s::ImageFormat::R32ui => vec![spirv::Capability::Shader],
1188                s::ImageFormat::Rg32f
1189                | s::ImageFormat::Rg16f
1190                | s::ImageFormat::R11fG11fB10f
1191                | s::ImageFormat::R16f
1192                | s::ImageFormat::Rgba16
1193                | s::ImageFormat::Rgb10A2
1194                | s::ImageFormat::Rg16
1195                | s::ImageFormat::Rg8
1196                | s::ImageFormat::R16
1197                | s::ImageFormat::R8
1198                | s::ImageFormat::Rgba16Snorm
1199                | s::ImageFormat::Rg16Snorm
1200                | s::ImageFormat::Rg8Snorm
1201                | s::ImageFormat::R16Snorm
1202                | s::ImageFormat::R8Snorm
1203                | s::ImageFormat::Rg32i
1204                | s::ImageFormat::Rg16i
1205                | s::ImageFormat::Rg8i
1206                | s::ImageFormat::R16i
1207                | s::ImageFormat::R8i
1208                | s::ImageFormat::Rgb10a2ui
1209                | s::ImageFormat::Rg32ui
1210                | s::ImageFormat::Rg16ui
1211                | s::ImageFormat::Rg8ui
1212                | s::ImageFormat::R16ui
1213                | s::ImageFormat::R8ui => vec![spirv::Capability::StorageImageExtendedFormats],
1214            },
1215            Self::ImageChannelOrder(v) => match v {
1216                s::ImageChannelOrder::R
1217                | s::ImageChannelOrder::A
1218                | s::ImageChannelOrder::RG
1219                | s::ImageChannelOrder::RA
1220                | s::ImageChannelOrder::RGB
1221                | s::ImageChannelOrder::RGBA
1222                | s::ImageChannelOrder::BGRA
1223                | s::ImageChannelOrder::ARGB
1224                | s::ImageChannelOrder::Intensity
1225                | s::ImageChannelOrder::Luminance
1226                | s::ImageChannelOrder::Rx
1227                | s::ImageChannelOrder::RGx
1228                | s::ImageChannelOrder::RGBx
1229                | s::ImageChannelOrder::Depth
1230                | s::ImageChannelOrder::DepthStencil
1231                | s::ImageChannelOrder::sRGB
1232                | s::ImageChannelOrder::sRGBx
1233                | s::ImageChannelOrder::sRGBA
1234                | s::ImageChannelOrder::sBGRA
1235                | s::ImageChannelOrder::ABGR => vec![spirv::Capability::Kernel],
1236            },
1237            Self::ImageChannelDataType(v) => match v {
1238                s::ImageChannelDataType::SnormInt8
1239                | s::ImageChannelDataType::SnormInt16
1240                | s::ImageChannelDataType::UnormInt8
1241                | s::ImageChannelDataType::UnormInt16
1242                | s::ImageChannelDataType::UnormShort565
1243                | s::ImageChannelDataType::UnormShort555
1244                | s::ImageChannelDataType::UnormInt101010
1245                | s::ImageChannelDataType::SignedInt8
1246                | s::ImageChannelDataType::SignedInt16
1247                | s::ImageChannelDataType::SignedInt32
1248                | s::ImageChannelDataType::UnsignedInt8
1249                | s::ImageChannelDataType::UnsignedInt16
1250                | s::ImageChannelDataType::UnsignedInt32
1251                | s::ImageChannelDataType::HalfFloat
1252                | s::ImageChannelDataType::Float
1253                | s::ImageChannelDataType::UnormInt24
1254                | s::ImageChannelDataType::UnormInt101010_2
1255                | s::ImageChannelDataType::UnsignedIntRaw10EXT
1256                | s::ImageChannelDataType::UnsignedIntRaw12EXT => vec![spirv::Capability::Kernel],
1257            },
1258            Self::FPRoundingMode(v) => match v {
1259                s::FPRoundingMode::RTE
1260                | s::FPRoundingMode::RTZ
1261                | s::FPRoundingMode::RTP
1262                | s::FPRoundingMode::RTN => vec![],
1263            },
1264            Self::FPDenormMode(v) => match v {
1265                s::FPDenormMode::Preserve | s::FPDenormMode::FlushToZero => {
1266                    vec![spirv::Capability::FunctionFloatControlINTEL]
1267                }
1268            },
1269            Self::QuantizationModes(v) => match v {
1270                s::QuantizationModes::TRN
1271                | s::QuantizationModes::TRN_ZERO
1272                | s::QuantizationModes::RND
1273                | s::QuantizationModes::RND_ZERO
1274                | s::QuantizationModes::RND_INF
1275                | s::QuantizationModes::RND_MIN_INF
1276                | s::QuantizationModes::RND_CONV
1277                | s::QuantizationModes::RND_CONV_ODD => {
1278                    vec![spirv::Capability::ArbitraryPrecisionFixedPointINTEL]
1279                }
1280            },
1281            Self::FPOperationMode(v) => match v {
1282                s::FPOperationMode::IEEE | s::FPOperationMode::ALT => {
1283                    vec![spirv::Capability::FunctionFloatControlINTEL]
1284                }
1285            },
1286            Self::OverflowModes(v) => match v {
1287                s::OverflowModes::WRAP
1288                | s::OverflowModes::SAT
1289                | s::OverflowModes::SAT_ZERO
1290                | s::OverflowModes::SAT_SYM => {
1291                    vec![spirv::Capability::ArbitraryPrecisionFixedPointINTEL]
1292                }
1293            },
1294            Self::LinkageType(v) => match v {
1295                s::LinkageType::Export | s::LinkageType::Import | s::LinkageType::LinkOnceODR => {
1296                    vec![spirv::Capability::Linkage]
1297                }
1298            },
1299            Self::AccessQualifier(v) => match v {
1300                s::AccessQualifier::ReadOnly
1301                | s::AccessQualifier::WriteOnly
1302                | s::AccessQualifier::ReadWrite => vec![spirv::Capability::Kernel],
1303            },
1304            Self::HostAccessQualifier(v) => match v {
1305                s::HostAccessQualifier::NoneINTEL
1306                | s::HostAccessQualifier::ReadINTEL
1307                | s::HostAccessQualifier::WriteINTEL
1308                | s::HostAccessQualifier::ReadWriteINTEL => {
1309                    vec![spirv::Capability::GlobalVariableHostAccessINTEL]
1310                }
1311            },
1312            Self::FunctionParameterAttribute(v) => match v {
1313                s::FunctionParameterAttribute::Zext
1314                | s::FunctionParameterAttribute::Sext
1315                | s::FunctionParameterAttribute::ByVal
1316                | s::FunctionParameterAttribute::Sret
1317                | s::FunctionParameterAttribute::NoAlias
1318                | s::FunctionParameterAttribute::NoCapture
1319                | s::FunctionParameterAttribute::NoWrite
1320                | s::FunctionParameterAttribute::NoReadWrite => vec![spirv::Capability::Kernel],
1321                s::FunctionParameterAttribute::RuntimeAlignedINTEL => {
1322                    vec![spirv::Capability::RuntimeAlignedAttributeINTEL]
1323                }
1324            },
1325            Self::Decoration(v) => match v {
1326                s::Decoration::BuiltIn
1327                | s::Decoration::Restrict
1328                | s::Decoration::Aliased
1329                | s::Decoration::Volatile
1330                | s::Decoration::Coherent
1331                | s::Decoration::NonWritable
1332                | s::Decoration::NonReadable
1333                | s::Decoration::FPRoundingMode
1334                | s::Decoration::NoSignedWrap
1335                | s::Decoration::NoUnsignedWrap
1336                | s::Decoration::WeightTextureQCOM
1337                | s::Decoration::BlockMatchTextureQCOM
1338                | s::Decoration::ExplicitInterpAMD
1339                | s::Decoration::CounterBuffer
1340                | s::Decoration::UserSemantic
1341                | s::Decoration::UserTypeGOOGLE => vec![],
1342                s::Decoration::MaxByteOffset | s::Decoration::MaxByteOffsetId => {
1343                    vec![spirv::Capability::Addresses]
1344                }
1345                s::Decoration::ClobberINTEL | s::Decoration::SideEffectsINTEL => {
1346                    vec![spirv::Capability::AsmINTEL]
1347                }
1348                s::Decoration::BindlessSamplerNV
1349                | s::Decoration::BindlessImageNV
1350                | s::Decoration::BoundSamplerNV
1351                | s::Decoration::BoundImageNV => vec![spirv::Capability::BindlessTextureNV],
1352                s::Decoration::CacheControlLoadINTEL | s::Decoration::CacheControlStoreINTEL => {
1353                    vec![spirv::Capability::CacheControlsINTEL]
1354                }
1355                s::Decoration::ConduitKernelArgumentINTEL
1356                | s::Decoration::RegisterMapKernelArgumentINTEL
1357                | s::Decoration::MMHostInterfaceAddressWidthINTEL
1358                | s::Decoration::MMHostInterfaceDataWidthINTEL
1359                | s::Decoration::MMHostInterfaceLatencyINTEL
1360                | s::Decoration::MMHostInterfaceReadWriteModeINTEL
1361                | s::Decoration::MMHostInterfaceMaxBurstINTEL
1362                | s::Decoration::MMHostInterfaceWaitRequestINTEL
1363                | s::Decoration::StableKernelArgumentINTEL => {
1364                    vec![spirv::Capability::FPGAArgumentInterfacesINTEL]
1365                }
1366                s::Decoration::BufferLocationINTEL => {
1367                    vec![spirv::Capability::FPGABufferLocationINTEL]
1368                }
1369                s::Decoration::StallEnableINTEL => {
1370                    vec![spirv::Capability::FPGAClusterAttributesINTEL]
1371                }
1372                s::Decoration::MathOpDSPModeINTEL => vec![spirv::Capability::FPGADSPControlINTEL],
1373                s::Decoration::InitiationIntervalINTEL
1374                | s::Decoration::MaxConcurrencyINTEL
1375                | s::Decoration::PipelineEnableINTEL => {
1376                    vec![spirv::Capability::FPGAInvocationPipeliningAttributesINTEL]
1377                }
1378                s::Decoration::LatencyControlLabelINTEL
1379                | s::Decoration::LatencyControlConstraintINTEL => {
1380                    vec![spirv::Capability::FPGALatencyControlINTEL]
1381                }
1382                s::Decoration::BurstCoalesceINTEL
1383                | s::Decoration::CacheSizeINTEL
1384                | s::Decoration::DontStaticallyCoalesceINTEL
1385                | s::Decoration::PrefetchINTEL => vec![spirv::Capability::FPGAMemoryAccessesINTEL],
1386                s::Decoration::RegisterINTEL
1387                | s::Decoration::MemoryINTEL
1388                | s::Decoration::NumbanksINTEL
1389                | s::Decoration::BankwidthINTEL
1390                | s::Decoration::MaxPrivateCopiesINTEL
1391                | s::Decoration::SinglepumpINTEL
1392                | s::Decoration::DoublepumpINTEL
1393                | s::Decoration::MaxReplicatesINTEL
1394                | s::Decoration::SimpleDualPortINTEL
1395                | s::Decoration::MergeINTEL
1396                | s::Decoration::BankBitsINTEL
1397                | s::Decoration::ForcePow2DepthINTEL => {
1398                    vec![spirv::Capability::FPGAMemoryAttributesINTEL]
1399                }
1400                s::Decoration::FPMaxErrorDecorationINTEL => {
1401                    vec![spirv::Capability::FPMaxErrorINTEL]
1402                }
1403                s::Decoration::PerVertexKHR => vec![
1404                    spirv::Capability::FragmentBarycentricNV,
1405                    spirv::Capability::FragmentBarycentricKHR,
1406                ],
1407                s::Decoration::FunctionRoundingModeINTEL
1408                | s::Decoration::FunctionDenormModeINTEL
1409                | s::Decoration::FunctionFloatingPointModeINTEL => {
1410                    vec![spirv::Capability::FunctionFloatControlINTEL]
1411                }
1412                s::Decoration::PassthroughNV => {
1413                    vec![spirv::Capability::GeometryShaderPassthroughNV]
1414                }
1415                s::Decoration::Stream => vec![spirv::Capability::GeometryStreams],
1416                s::Decoration::InitModeINTEL | s::Decoration::ImplementInRegisterMapINTEL => {
1417                    vec![spirv::Capability::GlobalVariableFPGADecorationsINTEL]
1418                }
1419                s::Decoration::HostAccessINTEL => {
1420                    vec![spirv::Capability::GlobalVariableHostAccessINTEL]
1421                }
1422                s::Decoration::IOPipeStorageINTEL => vec![spirv::Capability::IOPipesINTEL],
1423                s::Decoration::ReferencedIndirectlyINTEL => {
1424                    vec![spirv::Capability::IndirectReferencesINTEL]
1425                }
1426                s::Decoration::InputAttachmentIndex => vec![spirv::Capability::InputAttachment],
1427                s::Decoration::CPacked
1428                | s::Decoration::Constant
1429                | s::Decoration::SaturatedConversion
1430                | s::Decoration::FuncParamAttr
1431                | s::Decoration::FPFastMathMode
1432                | s::Decoration::Alignment
1433                | s::Decoration::AlignmentId => vec![spirv::Capability::Kernel],
1434                s::Decoration::LinkageAttributes => vec![spirv::Capability::Linkage],
1435                s::Decoration::FuseLoopsInFunctionINTEL => vec![spirv::Capability::LoopFuseINTEL],
1436                s::Decoration::RowMajor | s::Decoration::ColMajor | s::Decoration::MatrixStride => {
1437                    vec![spirv::Capability::Matrix]
1438                }
1439                s::Decoration::AliasScopeINTEL | s::Decoration::NoAliasINTEL => {
1440                    vec![spirv::Capability::MemoryAccessAliasingINTEL]
1441                }
1442                s::Decoration::PerViewNV => vec![spirv::Capability::MeshShadingNV],
1443                s::Decoration::PerPrimitiveNV | s::Decoration::PerTaskNV => vec![
1444                    spirv::Capability::MeshShadingNV,
1445                    spirv::Capability::MeshShadingEXT,
1446                ],
1447                s::Decoration::RestrictPointer | s::Decoration::AliasedPointer => {
1448                    vec![spirv::Capability::PhysicalStorageBufferAddresses]
1449                }
1450                s::Decoration::OverrideCoverageNV => {
1451                    vec![spirv::Capability::SampleMaskOverrideCoverageNV]
1452                }
1453                s::Decoration::Sample => vec![spirv::Capability::SampleRateShading],
1454                s::Decoration::RelaxedPrecision
1455                | s::Decoration::Block
1456                | s::Decoration::BufferBlock
1457                | s::Decoration::ArrayStride
1458                | s::Decoration::GLSLShared
1459                | s::Decoration::GLSLPacked
1460                | s::Decoration::NoPerspective
1461                | s::Decoration::Flat
1462                | s::Decoration::Centroid
1463                | s::Decoration::Invariant
1464                | s::Decoration::Location
1465                | s::Decoration::Component
1466                | s::Decoration::Index
1467                | s::Decoration::Binding
1468                | s::Decoration::DescriptorSet
1469                | s::Decoration::Offset
1470                | s::Decoration::NoContraction => vec![spirv::Capability::Shader],
1471                s::Decoration::SpecId => vec![spirv::Capability::Shader, spirv::Capability::Kernel],
1472                s::Decoration::Uniform | s::Decoration::UniformId => vec![
1473                    spirv::Capability::Shader,
1474                    spirv::Capability::UniformDecoration,
1475                ],
1476                s::Decoration::NodeSharesPayloadLimitsWithAMDX
1477                | s::Decoration::NodeMaxPayloadsAMDX
1478                | s::Decoration::TrackFinishWritingAMDX
1479                | s::Decoration::PayloadNodeNameAMDX => vec![spirv::Capability::ShaderEnqueueAMDX],
1480                s::Decoration::HitObjectShaderRecordBufferNV => {
1481                    vec![spirv::Capability::ShaderInvocationReorderNV]
1482                }
1483                s::Decoration::NonUniform => vec![spirv::Capability::ShaderNonUniform],
1484                s::Decoration::SecondaryViewportRelativeNV => {
1485                    vec![spirv::Capability::ShaderStereoViewNV]
1486                }
1487                s::Decoration::ViewportRelativeNV => vec![spirv::Capability::ShaderViewportMaskNV],
1488                s::Decoration::Patch => vec![spirv::Capability::Tessellation],
1489                s::Decoration::XfbBuffer | s::Decoration::XfbStride => {
1490                    vec![spirv::Capability::TransformFeedback]
1491                }
1492                s::Decoration::SIMTCallINTEL
1493                | s::Decoration::VectorComputeVariableINTEL
1494                | s::Decoration::FuncParamIOKindINTEL
1495                | s::Decoration::VectorComputeFunctionINTEL
1496                | s::Decoration::StackCallINTEL
1497                | s::Decoration::GlobalVariableOffsetINTEL
1498                | s::Decoration::SingleElementVectorINTEL
1499                | s::Decoration::VectorComputeCallableFunctionINTEL
1500                | s::Decoration::MediaBlockIOINTEL => vec![spirv::Capability::VectorComputeINTEL],
1501            },
1502            Self::BuiltIn(v) => match v {
1503                s::BuiltIn::NumWorkgroups
1504                | s::BuiltIn::WorkgroupSize
1505                | s::BuiltIn::WorkgroupId
1506                | s::BuiltIn::LocalInvocationId
1507                | s::BuiltIn::GlobalInvocationId
1508                | s::BuiltIn::LocalInvocationIndex
1509                | s::BuiltIn::BaryCoordNoPerspAMD
1510                | s::BuiltIn::BaryCoordNoPerspCentroidAMD
1511                | s::BuiltIn::BaryCoordNoPerspSampleAMD
1512                | s::BuiltIn::BaryCoordSmoothAMD
1513                | s::BuiltIn::BaryCoordSmoothCentroidAMD
1514                | s::BuiltIn::BaryCoordSmoothSampleAMD
1515                | s::BuiltIn::BaryCoordPullModelAMD => vec![],
1516                s::BuiltIn::ClipDistance => vec![spirv::Capability::ClipDistance],
1517                s::BuiltIn::CoreIDARM
1518                | s::BuiltIn::CoreCountARM
1519                | s::BuiltIn::CoreMaxIDARM
1520                | s::BuiltIn::WarpIDARM
1521                | s::BuiltIn::WarpMaxIDARM => vec![spirv::Capability::CoreBuiltinsARM],
1522                s::BuiltIn::CullDistance => vec![spirv::Capability::CullDistance],
1523                s::BuiltIn::DeviceIndex => vec![spirv::Capability::DeviceGroup],
1524                s::BuiltIn::BaseVertex | s::BuiltIn::BaseInstance => {
1525                    vec![spirv::Capability::DrawParameters]
1526                }
1527                s::BuiltIn::DrawIndex => vec![
1528                    spirv::Capability::DrawParameters,
1529                    spirv::Capability::MeshShadingNV,
1530                    spirv::Capability::MeshShadingEXT,
1531                ],
1532                s::BuiltIn::BaryCoordKHR | s::BuiltIn::BaryCoordNoPerspKHR => vec![
1533                    spirv::Capability::FragmentBarycentricNV,
1534                    spirv::Capability::FragmentBarycentricKHR,
1535                ],
1536                s::BuiltIn::FragSizeEXT | s::BuiltIn::FragInvocationCountEXT => vec![
1537                    spirv::Capability::FragmentDensityEXT,
1538                    spirv::Capability::ShadingRateNV,
1539                ],
1540                s::BuiltIn::FullyCoveredEXT => vec![spirv::Capability::FragmentFullyCoveredEXT],
1541                s::BuiltIn::PrimitiveShadingRateKHR | s::BuiltIn::ShadingRateKHR => {
1542                    vec![spirv::Capability::FragmentShadingRateKHR]
1543                }
1544                s::BuiltIn::Layer => vec![
1545                    spirv::Capability::Geometry,
1546                    spirv::Capability::ShaderLayer,
1547                    spirv::Capability::ShaderViewportIndexLayerEXT,
1548                    spirv::Capability::MeshShadingNV,
1549                    spirv::Capability::MeshShadingEXT,
1550                ],
1551                s::BuiltIn::InvocationId => {
1552                    vec![spirv::Capability::Geometry, spirv::Capability::Tessellation]
1553                }
1554                s::BuiltIn::PrimitiveId => vec![
1555                    spirv::Capability::Geometry,
1556                    spirv::Capability::Tessellation,
1557                    spirv::Capability::RayTracingNV,
1558                    spirv::Capability::RayTracingKHR,
1559                    spirv::Capability::MeshShadingNV,
1560                    spirv::Capability::MeshShadingEXT,
1561                ],
1562                s::BuiltIn::WorkDim
1563                | s::BuiltIn::GlobalSize
1564                | s::BuiltIn::EnqueuedWorkgroupSize
1565                | s::BuiltIn::GlobalOffset
1566                | s::BuiltIn::GlobalLinearId
1567                | s::BuiltIn::SubgroupMaxSize
1568                | s::BuiltIn::NumEnqueuedSubgroups => vec![spirv::Capability::Kernel],
1569                s::BuiltIn::NumSubgroups | s::BuiltIn::SubgroupId => vec![
1570                    spirv::Capability::Kernel,
1571                    spirv::Capability::GroupNonUniform,
1572                ],
1573                s::BuiltIn::SubgroupSize | s::BuiltIn::SubgroupLocalInvocationId => vec![
1574                    spirv::Capability::Kernel,
1575                    spirv::Capability::GroupNonUniform,
1576                    spirv::Capability::SubgroupBallotKHR,
1577                ],
1578                s::BuiltIn::PrimitivePointIndicesEXT
1579                | s::BuiltIn::PrimitiveLineIndicesEXT
1580                | s::BuiltIn::PrimitiveTriangleIndicesEXT
1581                | s::BuiltIn::CullPrimitiveEXT => vec![spirv::Capability::MeshShadingEXT],
1582                s::BuiltIn::TaskCountNV
1583                | s::BuiltIn::PrimitiveCountNV
1584                | s::BuiltIn::PrimitiveIndicesNV
1585                | s::BuiltIn::ClipDistancePerViewNV
1586                | s::BuiltIn::CullDistancePerViewNV
1587                | s::BuiltIn::LayerPerViewNV
1588                | s::BuiltIn::MeshViewCountNV
1589                | s::BuiltIn::MeshViewIndicesNV => vec![spirv::Capability::MeshShadingNV],
1590                s::BuiltIn::ViewIndex => vec![spirv::Capability::MultiView],
1591                s::BuiltIn::ViewportIndex => vec![
1592                    spirv::Capability::MultiViewport,
1593                    spirv::Capability::ShaderViewportIndex,
1594                    spirv::Capability::ShaderViewportIndexLayerEXT,
1595                    spirv::Capability::MeshShadingNV,
1596                    spirv::Capability::MeshShadingEXT,
1597                ],
1598                s::BuiltIn::PositionPerViewNV | s::BuiltIn::ViewportMaskPerViewNV => vec![
1599                    spirv::Capability::PerViewAttributesNV,
1600                    spirv::Capability::MeshShadingNV,
1601                ],
1602                s::BuiltIn::CullMaskKHR => vec![spirv::Capability::RayCullMaskKHR],
1603                s::BuiltIn::HitMicroTriangleVertexPositionsNV
1604                | s::BuiltIn::HitMicroTriangleVertexBarycentricsNV
1605                | s::BuiltIn::HitKindFrontFacingMicroTriangleNV
1606                | s::BuiltIn::HitKindBackFacingMicroTriangleNV => {
1607                    vec![spirv::Capability::RayTracingDisplacementMicromapNV]
1608                }
1609                s::BuiltIn::RayGeometryIndexKHR => vec![spirv::Capability::RayTracingKHR],
1610                s::BuiltIn::CurrentRayTimeNV => vec![spirv::Capability::RayTracingMotionBlurNV],
1611                s::BuiltIn::HitTNV => vec![spirv::Capability::RayTracingNV],
1612                s::BuiltIn::LaunchIdNV
1613                | s::BuiltIn::LaunchSizeNV
1614                | s::BuiltIn::WorldRayOriginNV
1615                | s::BuiltIn::WorldRayDirectionNV
1616                | s::BuiltIn::ObjectRayOriginNV
1617                | s::BuiltIn::ObjectRayDirectionNV
1618                | s::BuiltIn::RayTminNV
1619                | s::BuiltIn::RayTmaxNV
1620                | s::BuiltIn::InstanceCustomIndexNV
1621                | s::BuiltIn::ObjectToWorldNV
1622                | s::BuiltIn::WorldToObjectNV
1623                | s::BuiltIn::HitKindNV
1624                | s::BuiltIn::IncomingRayFlagsNV => vec![
1625                    spirv::Capability::RayTracingNV,
1626                    spirv::Capability::RayTracingKHR,
1627                ],
1628                s::BuiltIn::HitTriangleVertexPositionsKHR => {
1629                    vec![spirv::Capability::RayTracingPositionFetchKHR]
1630                }
1631                s::BuiltIn::SampleId | s::BuiltIn::SamplePosition => {
1632                    vec![spirv::Capability::SampleRateShading]
1633                }
1634                s::BuiltIn::Position
1635                | s::BuiltIn::PointSize
1636                | s::BuiltIn::VertexId
1637                | s::BuiltIn::InstanceId
1638                | s::BuiltIn::FragCoord
1639                | s::BuiltIn::PointCoord
1640                | s::BuiltIn::FrontFacing
1641                | s::BuiltIn::SampleMask
1642                | s::BuiltIn::FragDepth
1643                | s::BuiltIn::HelperInvocation
1644                | s::BuiltIn::VertexIndex
1645                | s::BuiltIn::InstanceIndex => vec![spirv::Capability::Shader],
1646                s::BuiltIn::CoalescedInputCountAMDX | s::BuiltIn::ShaderIndexAMDX => {
1647                    vec![spirv::Capability::ShaderEnqueueAMDX]
1648                }
1649                s::BuiltIn::WarpsPerSMNV
1650                | s::BuiltIn::SMCountNV
1651                | s::BuiltIn::WarpIDNV
1652                | s::BuiltIn::SMIDNV => vec![spirv::Capability::ShaderSMBuiltinsNV],
1653                s::BuiltIn::SecondaryPositionNV | s::BuiltIn::SecondaryViewportMaskNV => {
1654                    vec![spirv::Capability::ShaderStereoViewNV]
1655                }
1656                s::BuiltIn::ViewportMaskNV => vec![
1657                    spirv::Capability::ShaderViewportMaskNV,
1658                    spirv::Capability::MeshShadingNV,
1659                ],
1660                s::BuiltIn::FragStencilRefEXT => vec![spirv::Capability::StencilExportEXT],
1661                s::BuiltIn::SubgroupEqMask
1662                | s::BuiltIn::SubgroupGeMask
1663                | s::BuiltIn::SubgroupGtMask
1664                | s::BuiltIn::SubgroupLeMask
1665                | s::BuiltIn::SubgroupLtMask => vec![
1666                    spirv::Capability::SubgroupBallotKHR,
1667                    spirv::Capability::GroupNonUniformBallot,
1668                ],
1669                s::BuiltIn::TessLevelOuter
1670                | s::BuiltIn::TessLevelInner
1671                | s::BuiltIn::TessCoord
1672                | s::BuiltIn::PatchVertices => vec![spirv::Capability::Tessellation],
1673            },
1674            Self::Scope(v) => match v {
1675                s::Scope::CrossDevice
1676                | s::Scope::Device
1677                | s::Scope::Workgroup
1678                | s::Scope::Subgroup
1679                | s::Scope::Invocation => vec![],
1680                s::Scope::ShaderCallKHR => vec![spirv::Capability::RayTracingKHR],
1681                s::Scope::QueueFamily => vec![spirv::Capability::VulkanMemoryModel],
1682            },
1683            Self::GroupOperation(v) => match v {
1684                s::GroupOperation::ClusteredReduce => {
1685                    vec![spirv::Capability::GroupNonUniformClustered]
1686                }
1687                s::GroupOperation::PartitionedReduceNV
1688                | s::GroupOperation::PartitionedInclusiveScanNV
1689                | s::GroupOperation::PartitionedExclusiveScanNV => {
1690                    vec![spirv::Capability::GroupNonUniformPartitionedNV]
1691                }
1692                s::GroupOperation::Reduce
1693                | s::GroupOperation::InclusiveScan
1694                | s::GroupOperation::ExclusiveScan => vec![
1695                    spirv::Capability::Kernel,
1696                    spirv::Capability::GroupNonUniformArithmetic,
1697                    spirv::Capability::GroupNonUniformBallot,
1698                ],
1699            },
1700            Self::KernelEnqueueFlags(v) => match v {
1701                s::KernelEnqueueFlags::NoWait
1702                | s::KernelEnqueueFlags::WaitKernel
1703                | s::KernelEnqueueFlags::WaitWorkGroup => vec![spirv::Capability::Kernel],
1704            },
1705            Self::Capability(v) => match v {
1706                s::Capability::Matrix
1707                | s::Capability::Addresses
1708                | s::Capability::Linkage
1709                | s::Capability::Kernel
1710                | s::Capability::Float16
1711                | s::Capability::Float64
1712                | s::Capability::Int64
1713                | s::Capability::Groups
1714                | s::Capability::Int16
1715                | s::Capability::Int8
1716                | s::Capability::Sampled1D
1717                | s::Capability::SampledBuffer
1718                | s::Capability::GroupNonUniform
1719                | s::Capability::ShaderLayer
1720                | s::Capability::ShaderViewportIndex
1721                | s::Capability::UniformDecoration
1722                | s::Capability::CoreBuiltinsARM
1723                | s::Capability::TileImageColorReadAccessEXT
1724                | s::Capability::TileImageDepthReadAccessEXT
1725                | s::Capability::TileImageStencilReadAccessEXT
1726                | s::Capability::SubgroupBallotKHR
1727                | s::Capability::SubgroupVoteKHR
1728                | s::Capability::StorageBuffer16BitAccess
1729                | s::Capability::StoragePushConstant16
1730                | s::Capability::StorageInputOutput16
1731                | s::Capability::DeviceGroup
1732                | s::Capability::AtomicStorageOps
1733                | s::Capability::SampleMaskPostDepthCoverage
1734                | s::Capability::StorageBuffer8BitAccess
1735                | s::Capability::StoragePushConstant8
1736                | s::Capability::DenormPreserve
1737                | s::Capability::DenormFlushToZero
1738                | s::Capability::SignedZeroInfNanPreserve
1739                | s::Capability::RoundingModeRTE
1740                | s::Capability::RoundingModeRTZ
1741                | s::Capability::TextureSampleWeightedQCOM
1742                | s::Capability::TextureBoxFilterQCOM
1743                | s::Capability::TextureBlockMatchQCOM
1744                | s::Capability::ShaderClockKHR
1745                | s::Capability::ImageFootprintNV
1746                | s::Capability::FragmentBarycentricKHR
1747                | s::Capability::ComputeDerivativeGroupQuadsNV
1748                | s::Capability::GroupNonUniformPartitionedNV
1749                | s::Capability::VulkanMemoryModel
1750                | s::Capability::VulkanMemoryModelDeviceScope
1751                | s::Capability::ComputeDerivativeGroupLinearNV
1752                | s::Capability::BindlessTextureNV
1753                | s::Capability::SubgroupShuffleINTEL
1754                | s::Capability::SubgroupBufferBlockIOINTEL
1755                | s::Capability::SubgroupImageBlockIOINTEL
1756                | s::Capability::SubgroupImageMediaBlockIOINTEL
1757                | s::Capability::RoundToInfinityINTEL
1758                | s::Capability::FloatingPointModeINTEL
1759                | s::Capability::FunctionPointersINTEL
1760                | s::Capability::IndirectReferencesINTEL
1761                | s::Capability::AsmINTEL
1762                | s::Capability::AtomicFloat32MinMaxEXT
1763                | s::Capability::AtomicFloat64MinMaxEXT
1764                | s::Capability::AtomicFloat16MinMaxEXT
1765                | s::Capability::VectorAnyINTEL
1766                | s::Capability::ExpectAssumeKHR
1767                | s::Capability::SubgroupAvcMotionEstimationINTEL
1768                | s::Capability::SubgroupAvcMotionEstimationIntraINTEL
1769                | s::Capability::SubgroupAvcMotionEstimationChromaINTEL
1770                | s::Capability::VariableLengthArrayINTEL
1771                | s::Capability::FunctionFloatControlINTEL
1772                | s::Capability::FPGAMemoryAttributesINTEL
1773                | s::Capability::ArbitraryPrecisionIntegersINTEL
1774                | s::Capability::ArbitraryPrecisionFloatingPointINTEL
1775                | s::Capability::UnstructuredLoopControlsINTEL
1776                | s::Capability::FPGALoopControlsINTEL
1777                | s::Capability::KernelAttributesINTEL
1778                | s::Capability::FPGAKernelAttributesINTEL
1779                | s::Capability::FPGAMemoryAccessesINTEL
1780                | s::Capability::FPGAClusterAttributesINTEL
1781                | s::Capability::LoopFuseINTEL
1782                | s::Capability::FPGADSPControlINTEL
1783                | s::Capability::MemoryAccessAliasingINTEL
1784                | s::Capability::FPGAInvocationPipeliningAttributesINTEL
1785                | s::Capability::FPGABufferLocationINTEL
1786                | s::Capability::ArbitraryPrecisionFixedPointINTEL
1787                | s::Capability::USMStorageClassesINTEL
1788                | s::Capability::RuntimeAlignedAttributeINTEL
1789                | s::Capability::IOPipesINTEL
1790                | s::Capability::BlockingPipesINTEL
1791                | s::Capability::FPGARegINTEL
1792                | s::Capability::DotProductInputAll
1793                | s::Capability::DotProductInput4x8BitPacked
1794                | s::Capability::DotProduct
1795                | s::Capability::RayCullMaskKHR
1796                | s::Capability::CooperativeMatrixKHR
1797                | s::Capability::BitInstructions
1798                | s::Capability::AtomicFloat32AddEXT
1799                | s::Capability::AtomicFloat64AddEXT
1800                | s::Capability::LongConstantCompositeINTEL
1801                | s::Capability::OptNoneINTEL
1802                | s::Capability::AtomicFloat16AddEXT
1803                | s::Capability::DebugInfoModuleINTEL
1804                | s::Capability::BFloat16ConversionINTEL
1805                | s::Capability::SplitBarrierINTEL
1806                | s::Capability::GlobalVariableFPGADecorationsINTEL
1807                | s::Capability::GlobalVariableHostAccessINTEL
1808                | s::Capability::FPMaxErrorINTEL
1809                | s::Capability::FPGALatencyControlINTEL
1810                | s::Capability::FPGAArgumentInterfacesINTEL
1811                | s::Capability::GroupUniformArithmeticKHR
1812                | s::Capability::CacheControlsINTEL => vec![],
1813                s::Capability::GenericPointer => vec![spirv::Capability::Addresses],
1814                s::Capability::SubgroupDispatch => vec![spirv::Capability::DeviceEnqueue],
1815                s::Capability::FPGAKernelAttributesv2INTEL => {
1816                    vec![spirv::Capability::FPGAKernelAttributesINTEL]
1817                }
1818                s::Capability::GeometryPointSize
1819                | s::Capability::GeometryStreams
1820                | s::Capability::MultiViewport
1821                | s::Capability::GeometryShaderPassthroughNV => vec![spirv::Capability::Geometry],
1822                s::Capability::GroupNonUniformVote
1823                | s::Capability::GroupNonUniformArithmetic
1824                | s::Capability::GroupNonUniformBallot
1825                | s::Capability::GroupNonUniformShuffle
1826                | s::Capability::GroupNonUniformShuffleRelative
1827                | s::Capability::GroupNonUniformClustered
1828                | s::Capability::GroupNonUniformQuad
1829                | s::Capability::GroupNonUniformRotateKHR => {
1830                    vec![spirv::Capability::GroupNonUniform]
1831                }
1832                s::Capability::ImageReadWrite | s::Capability::ImageMipmap => {
1833                    vec![spirv::Capability::ImageBasic]
1834                }
1835                s::Capability::StorageTexelBufferArrayDynamicIndexing => {
1836                    vec![spirv::Capability::ImageBuffer]
1837                }
1838                s::Capability::StorageTexelBufferArrayNonUniformIndexing => vec![
1839                    spirv::Capability::ImageBuffer,
1840                    spirv::Capability::ShaderNonUniform,
1841                ],
1842                s::Capability::InputAttachmentArrayDynamicIndexing => {
1843                    vec![spirv::Capability::InputAttachment]
1844                }
1845                s::Capability::InputAttachmentArrayNonUniformIndexing => vec![
1846                    spirv::Capability::InputAttachment,
1847                    spirv::Capability::ShaderNonUniform,
1848                ],
1849                s::Capability::Int64Atomics => vec![spirv::Capability::Int64],
1850                s::Capability::DotProductInput4x8Bit => vec![spirv::Capability::Int8],
1851                s::Capability::Vector16
1852                | s::Capability::Float16Buffer
1853                | s::Capability::ImageBasic
1854                | s::Capability::Pipes
1855                | s::Capability::DeviceEnqueue
1856                | s::Capability::LiteralSampler
1857                | s::Capability::NamedBarrier
1858                | s::Capability::FPFastMathModeINTEL => vec![spirv::Capability::Kernel],
1859                s::Capability::Shader => vec![spirv::Capability::Matrix],
1860                s::Capability::PerViewAttributesNV => vec![spirv::Capability::MultiView],
1861                s::Capability::ShaderViewportIndexLayerEXT => {
1862                    vec![spirv::Capability::MultiViewport]
1863                }
1864                s::Capability::PipeStorage => vec![spirv::Capability::Pipes],
1865                s::Capability::RayTraversalPrimitiveCullingKHR
1866                | s::Capability::RayTracingOpacityMicromapEXT => vec![
1867                    spirv::Capability::RayQueryKHR,
1868                    spirv::Capability::RayTracingKHR,
1869                ],
1870                s::Capability::ShaderInvocationReorderNV
1871                | s::Capability::RayTracingDisplacementMicromapNV => {
1872                    vec![spirv::Capability::RayTracingKHR]
1873                }
1874                s::Capability::SampleMaskOverrideCoverageNV => {
1875                    vec![spirv::Capability::SampleRateShading]
1876                }
1877                s::Capability::Image1D => vec![spirv::Capability::Sampled1D],
1878                s::Capability::ImageBuffer
1879                | s::Capability::UniformTexelBufferArrayDynamicIndexing => {
1880                    vec![spirv::Capability::SampledBuffer]
1881                }
1882                s::Capability::UniformTexelBufferArrayNonUniformIndexing => vec![
1883                    spirv::Capability::SampledBuffer,
1884                    spirv::Capability::ShaderNonUniform,
1885                ],
1886                s::Capability::ImageCubeArray => vec![spirv::Capability::SampledCubeArray],
1887                s::Capability::ImageRect => vec![spirv::Capability::SampledRect],
1888                s::Capability::Geometry
1889                | s::Capability::Tessellation
1890                | s::Capability::AtomicStorage
1891                | s::Capability::ImageGatherExtended
1892                | s::Capability::StorageImageMultisample
1893                | s::Capability::UniformBufferArrayDynamicIndexing
1894                | s::Capability::SampledImageArrayDynamicIndexing
1895                | s::Capability::StorageBufferArrayDynamicIndexing
1896                | s::Capability::StorageImageArrayDynamicIndexing
1897                | s::Capability::ClipDistance
1898                | s::Capability::CullDistance
1899                | s::Capability::SampleRateShading
1900                | s::Capability::SampledRect
1901                | s::Capability::InputAttachment
1902                | s::Capability::SparseResidency
1903                | s::Capability::MinLod
1904                | s::Capability::SampledCubeArray
1905                | s::Capability::ImageMSArray
1906                | s::Capability::StorageImageExtendedFormats
1907                | s::Capability::ImageQuery
1908                | s::Capability::DerivativeControl
1909                | s::Capability::InterpolationFunction
1910                | s::Capability::TransformFeedback
1911                | s::Capability::StorageImageReadWithoutFormat
1912                | s::Capability::StorageImageWriteWithoutFormat
1913                | s::Capability::FragmentShadingRateKHR
1914                | s::Capability::DrawParameters
1915                | s::Capability::WorkgroupMemoryExplicitLayoutKHR
1916                | s::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR
1917                | s::Capability::MultiView
1918                | s::Capability::VariablePointersStorageBuffer
1919                | s::Capability::RayQueryProvisionalKHR
1920                | s::Capability::RayQueryKHR
1921                | s::Capability::RayTracingKHR
1922                | s::Capability::Float16ImageAMD
1923                | s::Capability::ImageGatherBiasLodAMD
1924                | s::Capability::FragmentMaskAMD
1925                | s::Capability::StencilExportEXT
1926                | s::Capability::ImageReadWriteLodAMD
1927                | s::Capability::Int64ImageEXT
1928                | s::Capability::ShaderEnqueueAMDX
1929                | s::Capability::FragmentFullyCoveredEXT
1930                | s::Capability::MeshShadingNV
1931                | s::Capability::MeshShadingEXT
1932                | s::Capability::FragmentDensityEXT
1933                | s::Capability::ShaderNonUniform
1934                | s::Capability::RuntimeDescriptorArray
1935                | s::Capability::RayTracingPositionFetchKHR
1936                | s::Capability::RayTracingNV
1937                | s::Capability::RayTracingMotionBlurNV
1938                | s::Capability::PhysicalStorageBufferAddresses
1939                | s::Capability::RayTracingProvisionalKHR
1940                | s::Capability::CooperativeMatrixNV
1941                | s::Capability::FragmentShaderSampleInterlockEXT
1942                | s::Capability::FragmentShaderShadingRateInterlockEXT
1943                | s::Capability::ShaderSMBuiltinsNV
1944                | s::Capability::FragmentShaderPixelInterlockEXT
1945                | s::Capability::DemoteToHelperInvocation
1946                | s::Capability::DisplacementMicromapNV
1947                | s::Capability::RayQueryPositionFetchKHR
1948                | s::Capability::IntegerFunctions2INTEL => vec![spirv::Capability::Shader],
1949                s::Capability::UniformBufferArrayNonUniformIndexing
1950                | s::Capability::SampledImageArrayNonUniformIndexing
1951                | s::Capability::StorageBufferArrayNonUniformIndexing
1952                | s::Capability::StorageImageArrayNonUniformIndexing => {
1953                    vec![spirv::Capability::ShaderNonUniform]
1954                }
1955                s::Capability::ShaderViewportMaskNV => {
1956                    vec![spirv::Capability::ShaderViewportIndexLayerNV]
1957                }
1958                s::Capability::ShaderStereoViewNV => vec![spirv::Capability::ShaderViewportMaskNV],
1959                s::Capability::UniformAndStorageBuffer16BitAccess => vec![
1960                    spirv::Capability::StorageBuffer16BitAccess,
1961                    spirv::Capability::StorageUniformBufferBlock16,
1962                ],
1963                s::Capability::UniformAndStorageBuffer8BitAccess => {
1964                    vec![spirv::Capability::StorageBuffer8BitAccess]
1965                }
1966                s::Capability::TessellationPointSize => vec![spirv::Capability::Tessellation],
1967                s::Capability::VariablePointers => {
1968                    vec![spirv::Capability::VariablePointersStorageBuffer]
1969                }
1970                s::Capability::VectorComputeINTEL => vec![spirv::Capability::VectorAnyINTEL],
1971                s::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR => {
1972                    vec![spirv::Capability::WorkgroupMemoryExplicitLayoutKHR]
1973                }
1974            },
1975            Self::RayQueryIntersection(v) => match v {
1976                s::RayQueryIntersection::RayQueryCandidateIntersectionKHR
1977                | s::RayQueryIntersection::RayQueryCommittedIntersectionKHR => {
1978                    vec![spirv::Capability::RayQueryKHR]
1979                }
1980            },
1981            Self::RayQueryCommittedIntersectionType(v) => match v {
1982                s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR
1983                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR
1984                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR => {
1985                    vec![spirv::Capability::RayQueryKHR]
1986                }
1987            },
1988            Self::RayQueryCandidateIntersectionType(v) => match v {
1989                s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR
1990                | s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR => {
1991                    vec![spirv::Capability::RayQueryKHR]
1992                }
1993            },
1994            Self::PackedVectorFormat(v) => match v {
1995                s::PackedVectorFormat::PackedVectorFormat4x8Bit => vec![],
1996            },
1997            Self::CooperativeMatrixLayout(v) => match v {
1998                s::CooperativeMatrixLayout::RowMajorKHR
1999                | s::CooperativeMatrixLayout::ColumnMajorKHR => vec![],
2000            },
2001            Self::CooperativeMatrixUse(v) => match v {
2002                s::CooperativeMatrixUse::MatrixAKHR
2003                | s::CooperativeMatrixUse::MatrixBKHR
2004                | s::CooperativeMatrixUse::MatrixAccumulatorKHR => vec![],
2005            },
2006            Self::InitializationModeQualifier(v) => match v {
2007                s::InitializationModeQualifier::InitOnDeviceReprogramINTEL
2008                | s::InitializationModeQualifier::InitOnDeviceResetINTEL => {
2009                    vec![spirv::Capability::GlobalVariableFPGADecorationsINTEL]
2010                }
2011            },
2012            Self::LoadCacheControl(v) => match v {
2013                s::LoadCacheControl::UncachedINTEL
2014                | s::LoadCacheControl::CachedINTEL
2015                | s::LoadCacheControl::StreamingINTEL
2016                | s::LoadCacheControl::InvalidateAfterReadINTEL
2017                | s::LoadCacheControl::ConstCachedINTEL => {
2018                    vec![spirv::Capability::CacheControlsINTEL]
2019                }
2020            },
2021            Self::StoreCacheControl(v) => match v {
2022                s::StoreCacheControl::UncachedINTEL
2023                | s::StoreCacheControl::WriteThroughINTEL
2024                | s::StoreCacheControl::WriteBackINTEL
2025                | s::StoreCacheControl::StreamingINTEL => {
2026                    vec![spirv::Capability::CacheControlsINTEL]
2027                }
2028            },
2029            _ => vec![],
2030        }
2031    }
2032    pub fn required_extensions(&self) -> Vec<&'static str> {
2033        use spirv as s;
2034        match self {
2035            Self::MemorySemantics(v) => {
2036                let mut result = vec![];
2037                if v.intersects(s::MemorySemantics::VOLATILE) {
2038                    result.extend_from_slice(&["SPV_KHR_vulkan_memory_model"])
2039                };
2040                result
2041            }
2042            Self::MemoryAccess(v) => {
2043                let mut result = vec![];
2044                if v.intersects(
2045                    s::MemoryAccess::ALIAS_SCOPE_INTEL_MASK | s::MemoryAccess::NO_ALIAS_INTEL_MASK,
2046                ) {
2047                    result.extend_from_slice(&["SPV_INTEL_memory_access_aliasing"])
2048                };
2049                result
2050            }
2051            Self::SourceLanguage(v) => match v {
2052                s::SourceLanguage::Unknown
2053                | s::SourceLanguage::ESSL
2054                | s::SourceLanguage::GLSL
2055                | s::SourceLanguage::OpenCL_C
2056                | s::SourceLanguage::OpenCL_CPP
2057                | s::SourceLanguage::HLSL
2058                | s::SourceLanguage::CPP_for_OpenCL
2059                | s::SourceLanguage::SYCL
2060                | s::SourceLanguage::HERO_C
2061                | s::SourceLanguage::NZSL
2062                | s::SourceLanguage::WGSL
2063                | s::SourceLanguage::Slang => vec![],
2064            },
2065            Self::ExecutionModel(v) => match v {
2066                s::ExecutionModel::Vertex
2067                | s::ExecutionModel::TessellationControl
2068                | s::ExecutionModel::TessellationEvaluation
2069                | s::ExecutionModel::Geometry
2070                | s::ExecutionModel::Fragment
2071                | s::ExecutionModel::GLCompute
2072                | s::ExecutionModel::Kernel
2073                | s::ExecutionModel::TaskNV
2074                | s::ExecutionModel::MeshNV
2075                | s::ExecutionModel::RayGenerationNV
2076                | s::ExecutionModel::IntersectionNV
2077                | s::ExecutionModel::AnyHitNV
2078                | s::ExecutionModel::ClosestHitNV
2079                | s::ExecutionModel::MissNV
2080                | s::ExecutionModel::CallableNV
2081                | s::ExecutionModel::TaskEXT
2082                | s::ExecutionModel::MeshEXT => vec![],
2083            },
2084            Self::AddressingModel(v) => match v {
2085                s::AddressingModel::Logical
2086                | s::AddressingModel::Physical32
2087                | s::AddressingModel::Physical64 => vec![],
2088                s::AddressingModel::PhysicalStorageBuffer64 => vec![
2089                    "SPV_EXT_physical_storage_buffer",
2090                    "SPV_KHR_physical_storage_buffer",
2091                ],
2092            },
2093            Self::MemoryModel(v) => match v {
2094                s::MemoryModel::Simple
2095                | s::MemoryModel::GLSL450
2096                | s::MemoryModel::OpenCL
2097                | s::MemoryModel::Vulkan => vec![],
2098            },
2099            Self::ExecutionMode(v) => match v {
2100                s::ExecutionMode::Invocations
2101                | s::ExecutionMode::SpacingEqual
2102                | s::ExecutionMode::SpacingFractionalEven
2103                | s::ExecutionMode::SpacingFractionalOdd
2104                | s::ExecutionMode::VertexOrderCw
2105                | s::ExecutionMode::VertexOrderCcw
2106                | s::ExecutionMode::PixelCenterInteger
2107                | s::ExecutionMode::OriginUpperLeft
2108                | s::ExecutionMode::OriginLowerLeft
2109                | s::ExecutionMode::EarlyFragmentTests
2110                | s::ExecutionMode::PointMode
2111                | s::ExecutionMode::Xfb
2112                | s::ExecutionMode::DepthReplacing
2113                | s::ExecutionMode::DepthGreater
2114                | s::ExecutionMode::DepthLess
2115                | s::ExecutionMode::DepthUnchanged
2116                | s::ExecutionMode::LocalSize
2117                | s::ExecutionMode::LocalSizeHint
2118                | s::ExecutionMode::InputPoints
2119                | s::ExecutionMode::InputLines
2120                | s::ExecutionMode::InputLinesAdjacency
2121                | s::ExecutionMode::Triangles
2122                | s::ExecutionMode::InputTrianglesAdjacency
2123                | s::ExecutionMode::Quads
2124                | s::ExecutionMode::Isolines
2125                | s::ExecutionMode::OutputVertices
2126                | s::ExecutionMode::OutputPoints
2127                | s::ExecutionMode::OutputLineStrip
2128                | s::ExecutionMode::OutputTriangleStrip
2129                | s::ExecutionMode::VecTypeHint
2130                | s::ExecutionMode::ContractionOff
2131                | s::ExecutionMode::Initializer
2132                | s::ExecutionMode::Finalizer
2133                | s::ExecutionMode::SubgroupSize
2134                | s::ExecutionMode::SubgroupsPerWorkgroup
2135                | s::ExecutionMode::SubgroupsPerWorkgroupId
2136                | s::ExecutionMode::LocalSizeId
2137                | s::ExecutionMode::LocalSizeHintId
2138                | s::ExecutionMode::NonCoherentColorAttachmentReadEXT
2139                | s::ExecutionMode::NonCoherentDepthAttachmentReadEXT
2140                | s::ExecutionMode::NonCoherentStencilAttachmentReadEXT
2141                | s::ExecutionMode::CoalescingAMDX
2142                | s::ExecutionMode::MaxNodeRecursionAMDX
2143                | s::ExecutionMode::StaticNumWorkgroupsAMDX
2144                | s::ExecutionMode::ShaderIndexAMDX
2145                | s::ExecutionMode::MaxNumWorkgroupsAMDX
2146                | s::ExecutionMode::SharedLocalMemorySizeINTEL
2147                | s::ExecutionMode::RoundingModeRTPINTEL
2148                | s::ExecutionMode::RoundingModeRTNINTEL
2149                | s::ExecutionMode::FloatingPointModeALTINTEL
2150                | s::ExecutionMode::FloatingPointModeIEEEINTEL
2151                | s::ExecutionMode::SchedulerTargetFmaxMhzINTEL
2152                | s::ExecutionMode::StreamingInterfaceINTEL
2153                | s::ExecutionMode::RegisterMapInterfaceINTEL
2154                | s::ExecutionMode::NamedBarrierCountINTEL => vec![],
2155                s::ExecutionMode::EarlyAndLateFragmentTestsAMD => {
2156                    vec!["SPV_AMD_shader_early_and_late_fragment_tests"]
2157                }
2158                s::ExecutionMode::StencilRefUnchangedFrontAMD
2159                | s::ExecutionMode::StencilRefGreaterFrontAMD
2160                | s::ExecutionMode::StencilRefLessFrontAMD
2161                | s::ExecutionMode::StencilRefUnchangedBackAMD
2162                | s::ExecutionMode::StencilRefGreaterBackAMD
2163                | s::ExecutionMode::StencilRefLessBackAMD => vec![
2164                    "SPV_AMD_shader_early_and_late_fragment_tests",
2165                    "SPV_EXT_shader_stencil_export",
2166                ],
2167                s::ExecutionMode::PixelInterlockOrderedEXT
2168                | s::ExecutionMode::PixelInterlockUnorderedEXT
2169                | s::ExecutionMode::SampleInterlockOrderedEXT
2170                | s::ExecutionMode::SampleInterlockUnorderedEXT
2171                | s::ExecutionMode::ShadingRateInterlockOrderedEXT
2172                | s::ExecutionMode::ShadingRateInterlockUnorderedEXT => {
2173                    vec!["SPV_EXT_fragment_shader_interlock"]
2174                }
2175                s::ExecutionMode::StencilRefReplacingEXT => vec!["SPV_EXT_shader_stencil_export"],
2176                s::ExecutionMode::MaxWorkgroupSizeINTEL
2177                | s::ExecutionMode::MaxWorkDimINTEL
2178                | s::ExecutionMode::NoGlobalOffsetINTEL
2179                | s::ExecutionMode::NumSIMDWorkitemsINTEL => vec!["SPV_INTEL_kernel_attributes"],
2180                s::ExecutionMode::DenormPreserve
2181                | s::ExecutionMode::DenormFlushToZero
2182                | s::ExecutionMode::SignedZeroInfNanPreserve
2183                | s::ExecutionMode::RoundingModeRTE
2184                | s::ExecutionMode::RoundingModeRTZ => vec!["SPV_KHR_float_controls"],
2185                s::ExecutionMode::PostDepthCoverage => vec!["SPV_KHR_post_depth_coverage"],
2186                s::ExecutionMode::SubgroupUniformControlFlowKHR => {
2187                    vec!["SPV_KHR_subgroup_uniform_control_flow"]
2188                }
2189                s::ExecutionMode::DerivativeGroupQuadsNV
2190                | s::ExecutionMode::DerivativeGroupLinearNV => {
2191                    vec!["SPV_NV_compute_shader_derivatives"]
2192                }
2193                s::ExecutionMode::OutputLinesNV
2194                | s::ExecutionMode::OutputPrimitivesNV
2195                | s::ExecutionMode::OutputTrianglesNV => {
2196                    vec!["SPV_NV_mesh_shader", "SPV_EXT_mesh_shader"]
2197                }
2198            },
2199            Self::StorageClass(v) => match v {
2200                s::StorageClass::UniformConstant
2201                | s::StorageClass::Input
2202                | s::StorageClass::Uniform
2203                | s::StorageClass::Output
2204                | s::StorageClass::Workgroup
2205                | s::StorageClass::CrossWorkgroup
2206                | s::StorageClass::Private
2207                | s::StorageClass::Function
2208                | s::StorageClass::Generic
2209                | s::StorageClass::PushConstant
2210                | s::StorageClass::AtomicCounter
2211                | s::StorageClass::Image
2212                | s::StorageClass::TileImageEXT
2213                | s::StorageClass::NodePayloadAMDX
2214                | s::StorageClass::NodeOutputPayloadAMDX
2215                | s::StorageClass::HitObjectAttributeNV => vec![],
2216                s::StorageClass::TaskPayloadWorkgroupEXT => vec!["SPV_EXT_mesh_shader"],
2217                s::StorageClass::PhysicalStorageBuffer => vec![
2218                    "SPV_EXT_physical_storage_buffer",
2219                    "SPV_KHR_physical_storage_buffer",
2220                ],
2221                s::StorageClass::CodeSectionINTEL => vec!["SPV_INTEL_function_pointers"],
2222                s::StorageClass::DeviceOnlyINTEL | s::StorageClass::HostOnlyINTEL => {
2223                    vec!["SPV_INTEL_usm_storage_classes"]
2224                }
2225                s::StorageClass::StorageBuffer => vec![
2226                    "SPV_KHR_storage_buffer_storage_class",
2227                    "SPV_KHR_variable_pointers",
2228                ],
2229                s::StorageClass::CallableDataNV
2230                | s::StorageClass::IncomingCallableDataNV
2231                | s::StorageClass::RayPayloadNV
2232                | s::StorageClass::HitAttributeNV
2233                | s::StorageClass::IncomingRayPayloadNV
2234                | s::StorageClass::ShaderRecordBufferNV => {
2235                    vec!["SPV_NV_ray_tracing", "SPV_KHR_ray_tracing"]
2236                }
2237            },
2238            Self::Dim(v) => match v {
2239                s::Dim::Dim1D
2240                | s::Dim::Dim2D
2241                | s::Dim::Dim3D
2242                | s::Dim::DimCube
2243                | s::Dim::DimRect
2244                | s::Dim::DimBuffer
2245                | s::Dim::DimSubpassData
2246                | s::Dim::DimTileImageDataEXT => vec![],
2247            },
2248            Self::SamplerAddressingMode(v) => match v {
2249                s::SamplerAddressingMode::None
2250                | s::SamplerAddressingMode::ClampToEdge
2251                | s::SamplerAddressingMode::Clamp
2252                | s::SamplerAddressingMode::Repeat
2253                | s::SamplerAddressingMode::RepeatMirrored => vec![],
2254            },
2255            Self::SamplerFilterMode(v) => match v {
2256                s::SamplerFilterMode::Nearest | s::SamplerFilterMode::Linear => vec![],
2257            },
2258            Self::ImageFormat(v) => match v {
2259                s::ImageFormat::Unknown
2260                | s::ImageFormat::Rgba32f
2261                | s::ImageFormat::Rgba16f
2262                | s::ImageFormat::R32f
2263                | s::ImageFormat::Rgba8
2264                | s::ImageFormat::Rgba8Snorm
2265                | s::ImageFormat::Rg32f
2266                | s::ImageFormat::Rg16f
2267                | s::ImageFormat::R11fG11fB10f
2268                | s::ImageFormat::R16f
2269                | s::ImageFormat::Rgba16
2270                | s::ImageFormat::Rgb10A2
2271                | s::ImageFormat::Rg16
2272                | s::ImageFormat::Rg8
2273                | s::ImageFormat::R16
2274                | s::ImageFormat::R8
2275                | s::ImageFormat::Rgba16Snorm
2276                | s::ImageFormat::Rg16Snorm
2277                | s::ImageFormat::Rg8Snorm
2278                | s::ImageFormat::R16Snorm
2279                | s::ImageFormat::R8Snorm
2280                | s::ImageFormat::Rgba32i
2281                | s::ImageFormat::Rgba16i
2282                | s::ImageFormat::Rgba8i
2283                | s::ImageFormat::R32i
2284                | s::ImageFormat::Rg32i
2285                | s::ImageFormat::Rg16i
2286                | s::ImageFormat::Rg8i
2287                | s::ImageFormat::R16i
2288                | s::ImageFormat::R8i
2289                | s::ImageFormat::Rgba32ui
2290                | s::ImageFormat::Rgba16ui
2291                | s::ImageFormat::Rgba8ui
2292                | s::ImageFormat::R32ui
2293                | s::ImageFormat::Rgb10a2ui
2294                | s::ImageFormat::Rg32ui
2295                | s::ImageFormat::Rg16ui
2296                | s::ImageFormat::Rg8ui
2297                | s::ImageFormat::R16ui
2298                | s::ImageFormat::R8ui
2299                | s::ImageFormat::R64ui
2300                | s::ImageFormat::R64i => vec![],
2301            },
2302            Self::ImageChannelOrder(v) => match v {
2303                s::ImageChannelOrder::R
2304                | s::ImageChannelOrder::A
2305                | s::ImageChannelOrder::RG
2306                | s::ImageChannelOrder::RA
2307                | s::ImageChannelOrder::RGB
2308                | s::ImageChannelOrder::RGBA
2309                | s::ImageChannelOrder::BGRA
2310                | s::ImageChannelOrder::ARGB
2311                | s::ImageChannelOrder::Intensity
2312                | s::ImageChannelOrder::Luminance
2313                | s::ImageChannelOrder::Rx
2314                | s::ImageChannelOrder::RGx
2315                | s::ImageChannelOrder::RGBx
2316                | s::ImageChannelOrder::Depth
2317                | s::ImageChannelOrder::DepthStencil
2318                | s::ImageChannelOrder::sRGB
2319                | s::ImageChannelOrder::sRGBx
2320                | s::ImageChannelOrder::sRGBA
2321                | s::ImageChannelOrder::sBGRA
2322                | s::ImageChannelOrder::ABGR => vec![],
2323            },
2324            Self::ImageChannelDataType(v) => match v {
2325                s::ImageChannelDataType::SnormInt8
2326                | s::ImageChannelDataType::SnormInt16
2327                | s::ImageChannelDataType::UnormInt8
2328                | s::ImageChannelDataType::UnormInt16
2329                | s::ImageChannelDataType::UnormShort565
2330                | s::ImageChannelDataType::UnormShort555
2331                | s::ImageChannelDataType::UnormInt101010
2332                | s::ImageChannelDataType::SignedInt8
2333                | s::ImageChannelDataType::SignedInt16
2334                | s::ImageChannelDataType::SignedInt32
2335                | s::ImageChannelDataType::UnsignedInt8
2336                | s::ImageChannelDataType::UnsignedInt16
2337                | s::ImageChannelDataType::UnsignedInt32
2338                | s::ImageChannelDataType::HalfFloat
2339                | s::ImageChannelDataType::Float
2340                | s::ImageChannelDataType::UnormInt24
2341                | s::ImageChannelDataType::UnormInt101010_2
2342                | s::ImageChannelDataType::UnsignedIntRaw10EXT
2343                | s::ImageChannelDataType::UnsignedIntRaw12EXT => vec![],
2344            },
2345            Self::FPRoundingMode(v) => match v {
2346                s::FPRoundingMode::RTE
2347                | s::FPRoundingMode::RTZ
2348                | s::FPRoundingMode::RTP
2349                | s::FPRoundingMode::RTN => vec![],
2350            },
2351            Self::FPDenormMode(v) => match v {
2352                s::FPDenormMode::Preserve | s::FPDenormMode::FlushToZero => vec![],
2353            },
2354            Self::QuantizationModes(v) => match v {
2355                s::QuantizationModes::TRN
2356                | s::QuantizationModes::TRN_ZERO
2357                | s::QuantizationModes::RND
2358                | s::QuantizationModes::RND_ZERO
2359                | s::QuantizationModes::RND_INF
2360                | s::QuantizationModes::RND_MIN_INF
2361                | s::QuantizationModes::RND_CONV
2362                | s::QuantizationModes::RND_CONV_ODD => vec![],
2363            },
2364            Self::FPOperationMode(v) => match v {
2365                s::FPOperationMode::IEEE | s::FPOperationMode::ALT => vec![],
2366            },
2367            Self::OverflowModes(v) => match v {
2368                s::OverflowModes::WRAP
2369                | s::OverflowModes::SAT
2370                | s::OverflowModes::SAT_ZERO
2371                | s::OverflowModes::SAT_SYM => vec![],
2372            },
2373            Self::LinkageType(v) => match v {
2374                s::LinkageType::Export | s::LinkageType::Import => vec![],
2375                s::LinkageType::LinkOnceODR => vec!["SPV_KHR_linkonce_odr"],
2376            },
2377            Self::AccessQualifier(v) => match v {
2378                s::AccessQualifier::ReadOnly
2379                | s::AccessQualifier::WriteOnly
2380                | s::AccessQualifier::ReadWrite => vec![],
2381            },
2382            Self::HostAccessQualifier(v) => match v {
2383                s::HostAccessQualifier::NoneINTEL
2384                | s::HostAccessQualifier::ReadINTEL
2385                | s::HostAccessQualifier::WriteINTEL
2386                | s::HostAccessQualifier::ReadWriteINTEL => vec![],
2387            },
2388            Self::FunctionParameterAttribute(v) => match v {
2389                s::FunctionParameterAttribute::Zext
2390                | s::FunctionParameterAttribute::Sext
2391                | s::FunctionParameterAttribute::ByVal
2392                | s::FunctionParameterAttribute::Sret
2393                | s::FunctionParameterAttribute::NoAlias
2394                | s::FunctionParameterAttribute::NoCapture
2395                | s::FunctionParameterAttribute::NoWrite
2396                | s::FunctionParameterAttribute::NoReadWrite
2397                | s::FunctionParameterAttribute::RuntimeAlignedINTEL => vec![],
2398            },
2399            Self::Decoration(v) => match v {
2400                s::Decoration::RelaxedPrecision
2401                | s::Decoration::SpecId
2402                | s::Decoration::Block
2403                | s::Decoration::BufferBlock
2404                | s::Decoration::RowMajor
2405                | s::Decoration::ColMajor
2406                | s::Decoration::ArrayStride
2407                | s::Decoration::MatrixStride
2408                | s::Decoration::GLSLShared
2409                | s::Decoration::GLSLPacked
2410                | s::Decoration::CPacked
2411                | s::Decoration::BuiltIn
2412                | s::Decoration::NoPerspective
2413                | s::Decoration::Flat
2414                | s::Decoration::Patch
2415                | s::Decoration::Centroid
2416                | s::Decoration::Sample
2417                | s::Decoration::Invariant
2418                | s::Decoration::Restrict
2419                | s::Decoration::Aliased
2420                | s::Decoration::Volatile
2421                | s::Decoration::Constant
2422                | s::Decoration::Coherent
2423                | s::Decoration::NonWritable
2424                | s::Decoration::NonReadable
2425                | s::Decoration::Uniform
2426                | s::Decoration::UniformId
2427                | s::Decoration::SaturatedConversion
2428                | s::Decoration::Stream
2429                | s::Decoration::Location
2430                | s::Decoration::Component
2431                | s::Decoration::Index
2432                | s::Decoration::Binding
2433                | s::Decoration::DescriptorSet
2434                | s::Decoration::Offset
2435                | s::Decoration::XfbBuffer
2436                | s::Decoration::XfbStride
2437                | s::Decoration::FuncParamAttr
2438                | s::Decoration::FPRoundingMode
2439                | s::Decoration::FPFastMathMode
2440                | s::Decoration::LinkageAttributes
2441                | s::Decoration::NoContraction
2442                | s::Decoration::InputAttachmentIndex
2443                | s::Decoration::Alignment
2444                | s::Decoration::MaxByteOffset
2445                | s::Decoration::AlignmentId
2446                | s::Decoration::MaxByteOffsetId
2447                | s::Decoration::NodeSharesPayloadLimitsWithAMDX
2448                | s::Decoration::NodeMaxPayloadsAMDX
2449                | s::Decoration::TrackFinishWritingAMDX
2450                | s::Decoration::PayloadNodeNameAMDX
2451                | s::Decoration::ViewportRelativeNV
2452                | s::Decoration::NonUniform
2453                | s::Decoration::HitObjectShaderRecordBufferNV
2454                | s::Decoration::BindlessSamplerNV
2455                | s::Decoration::BindlessImageNV
2456                | s::Decoration::BoundSamplerNV
2457                | s::Decoration::BoundImageNV
2458                | s::Decoration::SIMTCallINTEL
2459                | s::Decoration::ClobberINTEL
2460                | s::Decoration::SideEffectsINTEL
2461                | s::Decoration::VectorComputeVariableINTEL
2462                | s::Decoration::FuncParamIOKindINTEL
2463                | s::Decoration::VectorComputeFunctionINTEL
2464                | s::Decoration::StackCallINTEL
2465                | s::Decoration::GlobalVariableOffsetINTEL
2466                | s::Decoration::CounterBuffer
2467                | s::Decoration::UserSemantic
2468                | s::Decoration::FunctionRoundingModeINTEL
2469                | s::Decoration::FunctionDenormModeINTEL
2470                | s::Decoration::BurstCoalesceINTEL
2471                | s::Decoration::CacheSizeINTEL
2472                | s::Decoration::DontStaticallyCoalesceINTEL
2473                | s::Decoration::PrefetchINTEL
2474                | s::Decoration::StallEnableINTEL
2475                | s::Decoration::FuseLoopsInFunctionINTEL
2476                | s::Decoration::MathOpDSPModeINTEL
2477                | s::Decoration::AliasScopeINTEL
2478                | s::Decoration::NoAliasINTEL
2479                | s::Decoration::InitiationIntervalINTEL
2480                | s::Decoration::MaxConcurrencyINTEL
2481                | s::Decoration::PipelineEnableINTEL
2482                | s::Decoration::BufferLocationINTEL
2483                | s::Decoration::IOPipeStorageINTEL
2484                | s::Decoration::FunctionFloatingPointModeINTEL
2485                | s::Decoration::SingleElementVectorINTEL
2486                | s::Decoration::VectorComputeCallableFunctionINTEL
2487                | s::Decoration::MediaBlockIOINTEL
2488                | s::Decoration::InitModeINTEL
2489                | s::Decoration::ImplementInRegisterMapINTEL
2490                | s::Decoration::HostAccessINTEL
2491                | s::Decoration::FPMaxErrorDecorationINTEL
2492                | s::Decoration::LatencyControlLabelINTEL
2493                | s::Decoration::LatencyControlConstraintINTEL
2494                | s::Decoration::ConduitKernelArgumentINTEL
2495                | s::Decoration::RegisterMapKernelArgumentINTEL
2496                | s::Decoration::MMHostInterfaceAddressWidthINTEL
2497                | s::Decoration::MMHostInterfaceDataWidthINTEL
2498                | s::Decoration::MMHostInterfaceLatencyINTEL
2499                | s::Decoration::MMHostInterfaceReadWriteModeINTEL
2500                | s::Decoration::MMHostInterfaceMaxBurstINTEL
2501                | s::Decoration::MMHostInterfaceWaitRequestINTEL
2502                | s::Decoration::StableKernelArgumentINTEL
2503                | s::Decoration::CacheControlLoadINTEL
2504                | s::Decoration::CacheControlStoreINTEL => vec![],
2505                s::Decoration::ExplicitInterpAMD => {
2506                    vec!["SPV_AMD_shader_explicit_vertex_parameter"]
2507                }
2508                s::Decoration::RestrictPointer | s::Decoration::AliasedPointer => vec![
2509                    "SPV_EXT_physical_storage_buffer",
2510                    "SPV_KHR_physical_storage_buffer",
2511                ],
2512                s::Decoration::UserTypeGOOGLE => vec!["SPV_GOOGLE_user_type"],
2513                s::Decoration::RegisterINTEL
2514                | s::Decoration::MemoryINTEL
2515                | s::Decoration::NumbanksINTEL
2516                | s::Decoration::BankwidthINTEL
2517                | s::Decoration::MaxPrivateCopiesINTEL
2518                | s::Decoration::SinglepumpINTEL
2519                | s::Decoration::DoublepumpINTEL
2520                | s::Decoration::MaxReplicatesINTEL
2521                | s::Decoration::SimpleDualPortINTEL
2522                | s::Decoration::MergeINTEL
2523                | s::Decoration::BankBitsINTEL
2524                | s::Decoration::ForcePow2DepthINTEL => vec!["SPV_INTEL_fpga_memory_attributes"],
2525                s::Decoration::ReferencedIndirectlyINTEL => vec!["SPV_INTEL_function_pointers"],
2526                s::Decoration::NoSignedWrap | s::Decoration::NoUnsignedWrap => {
2527                    vec!["SPV_KHR_no_integer_wrap_decoration"]
2528                }
2529                s::Decoration::PerVertexKHR => vec![
2530                    "SPV_NV_fragment_shader_barycentric",
2531                    "SPV_KHR_fragment_shader_barycentric",
2532                ],
2533                s::Decoration::PassthroughNV => vec!["SPV_NV_geometry_shader_passthrough"],
2534                s::Decoration::PerViewNV => vec!["SPV_NV_mesh_shader"],
2535                s::Decoration::PerPrimitiveNV | s::Decoration::PerTaskNV => {
2536                    vec!["SPV_NV_mesh_shader", "SPV_EXT_mesh_shader"]
2537                }
2538                s::Decoration::OverrideCoverageNV => vec!["SPV_NV_sample_mask_override_coverage"],
2539                s::Decoration::SecondaryViewportRelativeNV => vec!["SPV_NV_stereo_view_rendering"],
2540                s::Decoration::WeightTextureQCOM | s::Decoration::BlockMatchTextureQCOM => {
2541                    vec!["SPV_QCOM_image_processing"]
2542                }
2543            },
2544            Self::BuiltIn(v) => match v {
2545                s::BuiltIn::Position
2546                | s::BuiltIn::PointSize
2547                | s::BuiltIn::ClipDistance
2548                | s::BuiltIn::CullDistance
2549                | s::BuiltIn::VertexId
2550                | s::BuiltIn::InstanceId
2551                | s::BuiltIn::PrimitiveId
2552                | s::BuiltIn::InvocationId
2553                | s::BuiltIn::Layer
2554                | s::BuiltIn::ViewportIndex
2555                | s::BuiltIn::TessLevelOuter
2556                | s::BuiltIn::TessLevelInner
2557                | s::BuiltIn::TessCoord
2558                | s::BuiltIn::PatchVertices
2559                | s::BuiltIn::FragCoord
2560                | s::BuiltIn::PointCoord
2561                | s::BuiltIn::FrontFacing
2562                | s::BuiltIn::SampleId
2563                | s::BuiltIn::SamplePosition
2564                | s::BuiltIn::SampleMask
2565                | s::BuiltIn::FragDepth
2566                | s::BuiltIn::HelperInvocation
2567                | s::BuiltIn::NumWorkgroups
2568                | s::BuiltIn::WorkgroupSize
2569                | s::BuiltIn::WorkgroupId
2570                | s::BuiltIn::LocalInvocationId
2571                | s::BuiltIn::GlobalInvocationId
2572                | s::BuiltIn::LocalInvocationIndex
2573                | s::BuiltIn::WorkDim
2574                | s::BuiltIn::GlobalSize
2575                | s::BuiltIn::EnqueuedWorkgroupSize
2576                | s::BuiltIn::GlobalOffset
2577                | s::BuiltIn::GlobalLinearId
2578                | s::BuiltIn::SubgroupSize
2579                | s::BuiltIn::SubgroupMaxSize
2580                | s::BuiltIn::NumSubgroups
2581                | s::BuiltIn::NumEnqueuedSubgroups
2582                | s::BuiltIn::SubgroupId
2583                | s::BuiltIn::SubgroupLocalInvocationId
2584                | s::BuiltIn::VertexIndex
2585                | s::BuiltIn::InstanceIndex
2586                | s::BuiltIn::CoreIDARM
2587                | s::BuiltIn::CoreCountARM
2588                | s::BuiltIn::CoreMaxIDARM
2589                | s::BuiltIn::WarpIDARM
2590                | s::BuiltIn::WarpMaxIDARM
2591                | s::BuiltIn::SubgroupEqMask
2592                | s::BuiltIn::SubgroupGeMask
2593                | s::BuiltIn::SubgroupGtMask
2594                | s::BuiltIn::SubgroupLeMask
2595                | s::BuiltIn::SubgroupLtMask
2596                | s::BuiltIn::CoalescedInputCountAMDX
2597                | s::BuiltIn::ShaderIndexAMDX
2598                | s::BuiltIn::HitTriangleVertexPositionsKHR
2599                | s::BuiltIn::HitMicroTriangleVertexPositionsNV
2600                | s::BuiltIn::HitMicroTriangleVertexBarycentricsNV
2601                | s::BuiltIn::HitKindFrontFacingMicroTriangleNV
2602                | s::BuiltIn::HitKindBackFacingMicroTriangleNV => vec![],
2603                s::BuiltIn::BaryCoordNoPerspAMD
2604                | s::BuiltIn::BaryCoordNoPerspCentroidAMD
2605                | s::BuiltIn::BaryCoordNoPerspSampleAMD
2606                | s::BuiltIn::BaryCoordSmoothAMD
2607                | s::BuiltIn::BaryCoordSmoothCentroidAMD
2608                | s::BuiltIn::BaryCoordSmoothSampleAMD
2609                | s::BuiltIn::BaryCoordPullModelAMD => {
2610                    vec!["SPV_AMD_shader_explicit_vertex_parameter"]
2611                }
2612                s::BuiltIn::FullyCoveredEXT => vec!["SPV_EXT_fragment_fully_covered"],
2613                s::BuiltIn::FragSizeEXT | s::BuiltIn::FragInvocationCountEXT => {
2614                    vec!["SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate"]
2615                }
2616                s::BuiltIn::PrimitivePointIndicesEXT
2617                | s::BuiltIn::PrimitiveLineIndicesEXT
2618                | s::BuiltIn::PrimitiveTriangleIndicesEXT
2619                | s::BuiltIn::CullPrimitiveEXT => vec!["SPV_EXT_mesh_shader"],
2620                s::BuiltIn::FragStencilRefEXT => vec!["SPV_EXT_shader_stencil_export"],
2621                s::BuiltIn::DeviceIndex => vec!["SPV_KHR_device_group"],
2622                s::BuiltIn::PrimitiveShadingRateKHR | s::BuiltIn::ShadingRateKHR => {
2623                    vec!["SPV_KHR_fragment_shading_rate"]
2624                }
2625                s::BuiltIn::ViewIndex => vec!["SPV_KHR_multiview"],
2626                s::BuiltIn::CullMaskKHR => vec!["SPV_KHR_ray_cull_mask"],
2627                s::BuiltIn::RayGeometryIndexKHR => vec!["SPV_KHR_ray_tracing"],
2628                s::BuiltIn::BaseVertex | s::BuiltIn::BaseInstance => {
2629                    vec!["SPV_KHR_shader_draw_parameters"]
2630                }
2631                s::BuiltIn::DrawIndex => vec![
2632                    "SPV_KHR_shader_draw_parameters",
2633                    "SPV_NV_mesh_shader",
2634                    "SPV_EXT_mesh_shader",
2635                ],
2636                s::BuiltIn::PositionPerViewNV | s::BuiltIn::ViewportMaskPerViewNV => vec![
2637                    "SPV_NVX_multiview_per_view_attributes",
2638                    "SPV_NV_mesh_shader",
2639                ],
2640                s::BuiltIn::BaryCoordKHR | s::BuiltIn::BaryCoordNoPerspKHR => vec![
2641                    "SPV_NV_fragment_shader_barycentric",
2642                    "SPV_KHR_fragment_shader_barycentric",
2643                ],
2644                s::BuiltIn::TaskCountNV
2645                | s::BuiltIn::PrimitiveCountNV
2646                | s::BuiltIn::PrimitiveIndicesNV
2647                | s::BuiltIn::ClipDistancePerViewNV
2648                | s::BuiltIn::CullDistancePerViewNV
2649                | s::BuiltIn::LayerPerViewNV
2650                | s::BuiltIn::MeshViewCountNV
2651                | s::BuiltIn::MeshViewIndicesNV => vec!["SPV_NV_mesh_shader"],
2652                s::BuiltIn::HitTNV => vec!["SPV_NV_ray_tracing"],
2653                s::BuiltIn::LaunchIdNV
2654                | s::BuiltIn::LaunchSizeNV
2655                | s::BuiltIn::WorldRayOriginNV
2656                | s::BuiltIn::WorldRayDirectionNV
2657                | s::BuiltIn::ObjectRayOriginNV
2658                | s::BuiltIn::ObjectRayDirectionNV
2659                | s::BuiltIn::RayTminNV
2660                | s::BuiltIn::RayTmaxNV
2661                | s::BuiltIn::InstanceCustomIndexNV
2662                | s::BuiltIn::ObjectToWorldNV
2663                | s::BuiltIn::WorldToObjectNV
2664                | s::BuiltIn::HitKindNV
2665                | s::BuiltIn::IncomingRayFlagsNV => {
2666                    vec!["SPV_NV_ray_tracing", "SPV_KHR_ray_tracing"]
2667                }
2668                s::BuiltIn::CurrentRayTimeNV => vec!["SPV_NV_ray_tracing_motion_blur"],
2669                s::BuiltIn::WarpsPerSMNV
2670                | s::BuiltIn::SMCountNV
2671                | s::BuiltIn::WarpIDNV
2672                | s::BuiltIn::SMIDNV => vec!["SPV_NV_shader_sm_builtins"],
2673                s::BuiltIn::SecondaryPositionNV | s::BuiltIn::SecondaryViewportMaskNV => {
2674                    vec!["SPV_NV_stereo_view_rendering"]
2675                }
2676                s::BuiltIn::ViewportMaskNV => vec!["SPV_NV_viewport_array2", "SPV_NV_mesh_shader"],
2677            },
2678            Self::Scope(v) => match v {
2679                s::Scope::CrossDevice
2680                | s::Scope::Device
2681                | s::Scope::Workgroup
2682                | s::Scope::Subgroup
2683                | s::Scope::Invocation
2684                | s::Scope::QueueFamily
2685                | s::Scope::ShaderCallKHR => vec![],
2686            },
2687            Self::GroupOperation(v) => match v {
2688                s::GroupOperation::Reduce
2689                | s::GroupOperation::InclusiveScan
2690                | s::GroupOperation::ExclusiveScan
2691                | s::GroupOperation::ClusteredReduce => vec![],
2692                s::GroupOperation::PartitionedReduceNV
2693                | s::GroupOperation::PartitionedInclusiveScanNV
2694                | s::GroupOperation::PartitionedExclusiveScanNV => {
2695                    vec!["SPV_NV_shader_subgroup_partitioned"]
2696                }
2697            },
2698            Self::KernelEnqueueFlags(v) => match v {
2699                s::KernelEnqueueFlags::NoWait
2700                | s::KernelEnqueueFlags::WaitKernel
2701                | s::KernelEnqueueFlags::WaitWorkGroup => vec![],
2702            },
2703            Self::Capability(v) => match v {
2704                s::Capability::Matrix
2705                | s::Capability::Shader
2706                | s::Capability::Geometry
2707                | s::Capability::Tessellation
2708                | s::Capability::Addresses
2709                | s::Capability::Linkage
2710                | s::Capability::Kernel
2711                | s::Capability::Vector16
2712                | s::Capability::Float16Buffer
2713                | s::Capability::Float16
2714                | s::Capability::Float64
2715                | s::Capability::Int64
2716                | s::Capability::Int64Atomics
2717                | s::Capability::ImageBasic
2718                | s::Capability::ImageReadWrite
2719                | s::Capability::ImageMipmap
2720                | s::Capability::Pipes
2721                | s::Capability::DeviceEnqueue
2722                | s::Capability::LiteralSampler
2723                | s::Capability::AtomicStorage
2724                | s::Capability::Int16
2725                | s::Capability::TessellationPointSize
2726                | s::Capability::GeometryPointSize
2727                | s::Capability::ImageGatherExtended
2728                | s::Capability::StorageImageMultisample
2729                | s::Capability::UniformBufferArrayDynamicIndexing
2730                | s::Capability::SampledImageArrayDynamicIndexing
2731                | s::Capability::StorageBufferArrayDynamicIndexing
2732                | s::Capability::StorageImageArrayDynamicIndexing
2733                | s::Capability::ClipDistance
2734                | s::Capability::CullDistance
2735                | s::Capability::ImageCubeArray
2736                | s::Capability::SampleRateShading
2737                | s::Capability::ImageRect
2738                | s::Capability::SampledRect
2739                | s::Capability::GenericPointer
2740                | s::Capability::Int8
2741                | s::Capability::InputAttachment
2742                | s::Capability::SparseResidency
2743                | s::Capability::MinLod
2744                | s::Capability::Sampled1D
2745                | s::Capability::Image1D
2746                | s::Capability::SampledCubeArray
2747                | s::Capability::SampledBuffer
2748                | s::Capability::ImageBuffer
2749                | s::Capability::ImageMSArray
2750                | s::Capability::StorageImageExtendedFormats
2751                | s::Capability::ImageQuery
2752                | s::Capability::DerivativeControl
2753                | s::Capability::InterpolationFunction
2754                | s::Capability::TransformFeedback
2755                | s::Capability::GeometryStreams
2756                | s::Capability::StorageImageReadWithoutFormat
2757                | s::Capability::StorageImageWriteWithoutFormat
2758                | s::Capability::MultiViewport
2759                | s::Capability::SubgroupDispatch
2760                | s::Capability::NamedBarrier
2761                | s::Capability::PipeStorage
2762                | s::Capability::GroupNonUniform
2763                | s::Capability::GroupNonUniformVote
2764                | s::Capability::GroupNonUniformArithmetic
2765                | s::Capability::GroupNonUniformBallot
2766                | s::Capability::GroupNonUniformShuffle
2767                | s::Capability::GroupNonUniformShuffleRelative
2768                | s::Capability::GroupNonUniformClustered
2769                | s::Capability::GroupNonUniformQuad
2770                | s::Capability::ShaderLayer
2771                | s::Capability::ShaderViewportIndex
2772                | s::Capability::UniformDecoration
2773                | s::Capability::ShaderNonUniform
2774                | s::Capability::RuntimeDescriptorArray
2775                | s::Capability::InputAttachmentArrayDynamicIndexing
2776                | s::Capability::UniformTexelBufferArrayDynamicIndexing
2777                | s::Capability::StorageTexelBufferArrayDynamicIndexing
2778                | s::Capability::UniformBufferArrayNonUniformIndexing
2779                | s::Capability::SampledImageArrayNonUniformIndexing
2780                | s::Capability::StorageBufferArrayNonUniformIndexing
2781                | s::Capability::StorageImageArrayNonUniformIndexing
2782                | s::Capability::InputAttachmentArrayNonUniformIndexing
2783                | s::Capability::UniformTexelBufferArrayNonUniformIndexing
2784                | s::Capability::StorageTexelBufferArrayNonUniformIndexing
2785                | s::Capability::VulkanMemoryModel
2786                | s::Capability::VulkanMemoryModelDeviceScope
2787                | s::Capability::DemoteToHelperInvocation
2788                | s::Capability::DotProductInputAll
2789                | s::Capability::DotProductInput4x8Bit
2790                | s::Capability::DotProductInput4x8BitPacked
2791                | s::Capability::DotProduct => vec![],
2792                s::Capability::ShaderEnqueueAMDX => vec!["SPV_AMDX_shader_enqueue"],
2793                s::Capability::Float16ImageAMD => vec!["SPV_AMD_gpu_shader_half_float_fetch"],
2794                s::Capability::Groups => vec!["SPV_AMD_shader_ballot"],
2795                s::Capability::FragmentMaskAMD => vec!["SPV_AMD_shader_fragment_mask"],
2796                s::Capability::ImageReadWriteLodAMD => vec!["SPV_AMD_shader_image_load_store_lod"],
2797                s::Capability::ImageGatherBiasLodAMD => vec!["SPV_AMD_texture_gather_bias_lod"],
2798                s::Capability::CoreBuiltinsARM => vec!["SPV_ARM_core_builtins"],
2799                s::Capability::FragmentFullyCoveredEXT => vec!["SPV_EXT_fragment_fully_covered"],
2800                s::Capability::FragmentDensityEXT => {
2801                    vec!["SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate"]
2802                }
2803                s::Capability::FragmentShaderSampleInterlockEXT
2804                | s::Capability::FragmentShaderShadingRateInterlockEXT
2805                | s::Capability::FragmentShaderPixelInterlockEXT => {
2806                    vec!["SPV_EXT_fragment_shader_interlock"]
2807                }
2808                s::Capability::MeshShadingEXT => vec!["SPV_EXT_mesh_shader"],
2809                s::Capability::RayTracingOpacityMicromapEXT => vec!["SPV_EXT_opacity_micromap"],
2810                s::Capability::PhysicalStorageBufferAddresses => vec![
2811                    "SPV_EXT_physical_storage_buffer",
2812                    "SPV_KHR_physical_storage_buffer",
2813                ],
2814                s::Capability::AtomicFloat16AddEXT => vec!["SPV_EXT_shader_atomic_float16_add"],
2815                s::Capability::AtomicFloat32AddEXT | s::Capability::AtomicFloat64AddEXT => {
2816                    vec!["SPV_EXT_shader_atomic_float_add"]
2817                }
2818                s::Capability::AtomicFloat32MinMaxEXT
2819                | s::Capability::AtomicFloat64MinMaxEXT
2820                | s::Capability::AtomicFloat16MinMaxEXT => {
2821                    vec!["SPV_EXT_shader_atomic_float_min_max"]
2822                }
2823                s::Capability::Int64ImageEXT => vec!["SPV_EXT_shader_image_int64"],
2824                s::Capability::StencilExportEXT => vec!["SPV_EXT_shader_stencil_export"],
2825                s::Capability::TileImageColorReadAccessEXT
2826                | s::Capability::TileImageDepthReadAccessEXT
2827                | s::Capability::TileImageStencilReadAccessEXT => vec!["SPV_EXT_shader_tile_image"],
2828                s::Capability::ShaderViewportIndexLayerEXT => {
2829                    vec!["SPV_EXT_shader_viewport_index_layer"]
2830                }
2831                s::Capability::ArbitraryPrecisionFixedPointINTEL => {
2832                    vec!["SPV_INTEL_arbitrary_precision_fixed_point"]
2833                }
2834                s::Capability::ArbitraryPrecisionFloatingPointINTEL => {
2835                    vec!["SPV_INTEL_arbitrary_precision_floating_point"]
2836                }
2837                s::Capability::ArbitraryPrecisionIntegersINTEL => {
2838                    vec!["SPV_INTEL_arbitrary_precision_integers"]
2839                }
2840                s::Capability::BFloat16ConversionINTEL => vec!["SPV_INTEL_bfloat16_conversion"],
2841                s::Capability::BlockingPipesINTEL => vec!["SPV_INTEL_blocking_pipes"],
2842                s::Capability::CacheControlsINTEL => vec!["SPV_INTEL_cache_controls"],
2843                s::Capability::DebugInfoModuleINTEL => vec!["SPV_INTEL_debug_module"],
2844                s::Capability::SubgroupAvcMotionEstimationINTEL
2845                | s::Capability::SubgroupAvcMotionEstimationIntraINTEL
2846                | s::Capability::SubgroupAvcMotionEstimationChromaINTEL => {
2847                    vec!["SPV_INTEL_device_side_avc_motion_estimation"]
2848                }
2849                s::Capability::RoundToInfinityINTEL
2850                | s::Capability::FloatingPointModeINTEL
2851                | s::Capability::FunctionFloatControlINTEL => vec!["SPV_INTEL_float_controls2"],
2852                s::Capability::FPFastMathModeINTEL => vec!["SPV_INTEL_fp_fast_math_mode"],
2853                s::Capability::FPMaxErrorINTEL => vec!["SPV_INTEL_fp_max_error"],
2854                s::Capability::FPGAArgumentInterfacesINTEL => {
2855                    vec!["SPV_INTEL_fpga_argument_interfaces"]
2856                }
2857                s::Capability::FPGABufferLocationINTEL => vec!["SPV_INTEL_fpga_buffer_location"],
2858                s::Capability::FPGAClusterAttributesINTEL => {
2859                    vec!["SPV_INTEL_fpga_cluster_attributes"]
2860                }
2861                s::Capability::FPGADSPControlINTEL => vec!["SPV_INTEL_fpga_dsp_control"],
2862                s::Capability::FPGAInvocationPipeliningAttributesINTEL => {
2863                    vec!["SPV_INTEL_fpga_invocation_pipelining_attributes"]
2864                }
2865                s::Capability::FPGALatencyControlINTEL => vec!["SPV_INTEL_fpga_latency_control"],
2866                s::Capability::FPGALoopControlsINTEL => vec!["SPV_INTEL_fpga_loop_controls"],
2867                s::Capability::FPGAMemoryAccessesINTEL => vec!["SPV_INTEL_fpga_memory_accesses"],
2868                s::Capability::FPGAMemoryAttributesINTEL => {
2869                    vec!["SPV_INTEL_fpga_memory_attributes"]
2870                }
2871                s::Capability::FPGARegINTEL => vec!["SPV_INTEL_fpga_reg"],
2872                s::Capability::FunctionPointersINTEL | s::Capability::IndirectReferencesINTEL => {
2873                    vec!["SPV_INTEL_function_pointers"]
2874                }
2875                s::Capability::GlobalVariableFPGADecorationsINTEL => {
2876                    vec!["SPV_INTEL_global_variable_fpga_decorations"]
2877                }
2878                s::Capability::GlobalVariableHostAccessINTEL => {
2879                    vec!["SPV_INTEL_global_variable_host_access"]
2880                }
2881                s::Capability::AsmINTEL => vec!["SPV_INTEL_inline_assembly"],
2882                s::Capability::IOPipesINTEL => vec!["SPV_INTEL_io_pipes"],
2883                s::Capability::KernelAttributesINTEL
2884                | s::Capability::FPGAKernelAttributesINTEL
2885                | s::Capability::FPGAKernelAttributesv2INTEL => vec!["SPV_INTEL_kernel_attributes"],
2886                s::Capability::LongConstantCompositeINTEL => {
2887                    vec!["SPV_INTEL_long_constant_composite"]
2888                }
2889                s::Capability::LoopFuseINTEL => vec!["SPV_INTEL_loop_fuse"],
2890                s::Capability::SubgroupImageMediaBlockIOINTEL => vec!["SPV_INTEL_media_block_io"],
2891                s::Capability::MemoryAccessAliasingINTEL => {
2892                    vec!["SPV_INTEL_memory_access_aliasing"]
2893                }
2894                s::Capability::OptNoneINTEL => vec!["SPV_INTEL_optnone"],
2895                s::Capability::RuntimeAlignedAttributeINTEL => vec!["SPV_INTEL_runtime_aligned"],
2896                s::Capability::IntegerFunctions2INTEL => {
2897                    vec!["SPV_INTEL_shader_integer_functions2"]
2898                }
2899                s::Capability::SplitBarrierINTEL => vec!["SPV_INTEL_split_barrier"],
2900                s::Capability::SubgroupShuffleINTEL
2901                | s::Capability::SubgroupBufferBlockIOINTEL
2902                | s::Capability::SubgroupImageBlockIOINTEL => vec!["SPV_INTEL_subgroups"],
2903                s::Capability::UnstructuredLoopControlsINTEL => {
2904                    vec!["SPV_INTEL_unstructured_loop_controls"]
2905                }
2906                s::Capability::USMStorageClassesINTEL => vec!["SPV_INTEL_usm_storage_classes"],
2907                s::Capability::VariableLengthArrayINTEL => vec!["SPV_INTEL_variable_length_array"],
2908                s::Capability::VectorComputeINTEL | s::Capability::VectorAnyINTEL => {
2909                    vec!["SPV_INTEL_vector_compute"]
2910                }
2911                s::Capability::StorageBuffer16BitAccess
2912                | s::Capability::UniformAndStorageBuffer16BitAccess
2913                | s::Capability::StoragePushConstant16
2914                | s::Capability::StorageInputOutput16 => vec!["SPV_KHR_16bit_storage"],
2915                s::Capability::StorageBuffer8BitAccess
2916                | s::Capability::UniformAndStorageBuffer8BitAccess
2917                | s::Capability::StoragePushConstant8 => vec!["SPV_KHR_8bit_storage"],
2918                s::Capability::BitInstructions => vec!["SPV_KHR_bit_instructions"],
2919                s::Capability::CooperativeMatrixKHR => vec!["SPV_KHR_cooperative_matrix"],
2920                s::Capability::DeviceGroup => vec!["SPV_KHR_device_group"],
2921                s::Capability::ExpectAssumeKHR => vec!["SPV_KHR_expect_assume"],
2922                s::Capability::DenormPreserve
2923                | s::Capability::DenormFlushToZero
2924                | s::Capability::SignedZeroInfNanPreserve
2925                | s::Capability::RoundingModeRTE
2926                | s::Capability::RoundingModeRTZ => vec!["SPV_KHR_float_controls"],
2927                s::Capability::FragmentShadingRateKHR => vec!["SPV_KHR_fragment_shading_rate"],
2928                s::Capability::MultiView => vec!["SPV_KHR_multiview"],
2929                s::Capability::SampleMaskPostDepthCoverage => vec!["SPV_KHR_post_depth_coverage"],
2930                s::Capability::RayCullMaskKHR => vec!["SPV_KHR_ray_cull_mask"],
2931                s::Capability::RayQueryProvisionalKHR | s::Capability::RayQueryKHR => {
2932                    vec!["SPV_KHR_ray_query"]
2933                }
2934                s::Capability::RayTraversalPrimitiveCullingKHR => {
2935                    vec!["SPV_KHR_ray_query", "SPV_KHR_ray_tracing"]
2936                }
2937                s::Capability::RayTracingKHR | s::Capability::RayTracingProvisionalKHR => {
2938                    vec!["SPV_KHR_ray_tracing"]
2939                }
2940                s::Capability::RayTracingPositionFetchKHR
2941                | s::Capability::RayQueryPositionFetchKHR => {
2942                    vec!["SPV_KHR_ray_tracing_position_fetch"]
2943                }
2944                s::Capability::AtomicStorageOps => vec!["SPV_KHR_shader_atomic_counter_ops"],
2945                s::Capability::SubgroupBallotKHR => vec!["SPV_KHR_shader_ballot"],
2946                s::Capability::ShaderClockKHR => vec!["SPV_KHR_shader_clock"],
2947                s::Capability::DrawParameters => vec!["SPV_KHR_shader_draw_parameters"],
2948                s::Capability::GroupNonUniformRotateKHR => vec!["SPV_KHR_subgroup_rotate"],
2949                s::Capability::SubgroupVoteKHR => vec!["SPV_KHR_subgroup_vote"],
2950                s::Capability::GroupUniformArithmeticKHR => {
2951                    vec!["SPV_KHR_uniform_group_instructions"]
2952                }
2953                s::Capability::VariablePointersStorageBuffer | s::Capability::VariablePointers => {
2954                    vec!["SPV_KHR_variable_pointers"]
2955                }
2956                s::Capability::WorkgroupMemoryExplicitLayoutKHR
2957                | s::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR
2958                | s::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR => {
2959                    vec!["SPV_KHR_workgroup_memory_explicit_layout"]
2960                }
2961                s::Capability::PerViewAttributesNV => vec!["SPV_NVX_multiview_per_view_attributes"],
2962                s::Capability::BindlessTextureNV => vec!["SPV_NV_bindless_texture"],
2963                s::Capability::ComputeDerivativeGroupQuadsNV
2964                | s::Capability::ComputeDerivativeGroupLinearNV => {
2965                    vec!["SPV_NV_compute_shader_derivatives"]
2966                }
2967                s::Capability::CooperativeMatrixNV => vec!["SPV_NV_cooperative_matrix"],
2968                s::Capability::DisplacementMicromapNV
2969                | s::Capability::RayTracingDisplacementMicromapNV => {
2970                    vec!["SPV_NV_displacement_micromap"]
2971                }
2972                s::Capability::FragmentBarycentricKHR => vec![
2973                    "SPV_NV_fragment_shader_barycentric",
2974                    "SPV_KHR_fragment_shader_barycentric",
2975                ],
2976                s::Capability::GeometryShaderPassthroughNV => {
2977                    vec!["SPV_NV_geometry_shader_passthrough"]
2978                }
2979                s::Capability::MeshShadingNV => vec!["SPV_NV_mesh_shader"],
2980                s::Capability::RayTracingNV => vec!["SPV_NV_ray_tracing"],
2981                s::Capability::RayTracingMotionBlurNV => vec!["SPV_NV_ray_tracing_motion_blur"],
2982                s::Capability::SampleMaskOverrideCoverageNV => {
2983                    vec!["SPV_NV_sample_mask_override_coverage"]
2984                }
2985                s::Capability::ImageFootprintNV => vec!["SPV_NV_shader_image_footprint"],
2986                s::Capability::ShaderInvocationReorderNV => {
2987                    vec!["SPV_NV_shader_invocation_reorder"]
2988                }
2989                s::Capability::ShaderSMBuiltinsNV => vec!["SPV_NV_shader_sm_builtins"],
2990                s::Capability::GroupNonUniformPartitionedNV => {
2991                    vec!["SPV_NV_shader_subgroup_partitioned"]
2992                }
2993                s::Capability::ShaderStereoViewNV => vec!["SPV_NV_stereo_view_rendering"],
2994                s::Capability::ShaderViewportMaskNV => vec!["SPV_NV_viewport_array2"],
2995                s::Capability::TextureSampleWeightedQCOM
2996                | s::Capability::TextureBoxFilterQCOM
2997                | s::Capability::TextureBlockMatchQCOM => vec!["SPV_QCOM_image_processing"],
2998            },
2999            Self::RayQueryIntersection(v) => match v {
3000                s::RayQueryIntersection::RayQueryCandidateIntersectionKHR
3001                | s::RayQueryIntersection::RayQueryCommittedIntersectionKHR => vec![],
3002            },
3003            Self::RayQueryCommittedIntersectionType(v) => match v {
3004                s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR
3005                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR
3006                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR => {
3007                    vec![]
3008                }
3009            },
3010            Self::RayQueryCandidateIntersectionType(v) => match v {
3011                s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR
3012                | s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR => {
3013                    vec![]
3014                }
3015            },
3016            Self::PackedVectorFormat(v) => match v {
3017                s::PackedVectorFormat::PackedVectorFormat4x8Bit => vec![],
3018            },
3019            Self::CooperativeMatrixLayout(v) => match v {
3020                s::CooperativeMatrixLayout::RowMajorKHR
3021                | s::CooperativeMatrixLayout::ColumnMajorKHR => vec![],
3022            },
3023            Self::CooperativeMatrixUse(v) => match v {
3024                s::CooperativeMatrixUse::MatrixAKHR
3025                | s::CooperativeMatrixUse::MatrixBKHR
3026                | s::CooperativeMatrixUse::MatrixAccumulatorKHR => vec![],
3027            },
3028            Self::InitializationModeQualifier(v) => match v {
3029                s::InitializationModeQualifier::InitOnDeviceReprogramINTEL
3030                | s::InitializationModeQualifier::InitOnDeviceResetINTEL => vec![],
3031            },
3032            Self::LoadCacheControl(v) => match v {
3033                s::LoadCacheControl::UncachedINTEL
3034                | s::LoadCacheControl::CachedINTEL
3035                | s::LoadCacheControl::StreamingINTEL
3036                | s::LoadCacheControl::InvalidateAfterReadINTEL
3037                | s::LoadCacheControl::ConstCachedINTEL => vec![],
3038            },
3039            Self::StoreCacheControl(v) => match v {
3040                s::StoreCacheControl::UncachedINTEL
3041                | s::StoreCacheControl::WriteThroughINTEL
3042                | s::StoreCacheControl::WriteBackINTEL
3043                | s::StoreCacheControl::StreamingINTEL => vec![],
3044            },
3045            _ => vec![],
3046        }
3047    }
3048    pub fn additional_operands(&self) -> Vec<crate::grammar::LogicalOperand> {
3049        use spirv as s;
3050        match self {
3051            Self::ImageOperands(v) => {
3052                let mut result = vec![];
3053                result.extend(
3054                    [
3055                        s::ImageOperands::BIAS,
3056                        s::ImageOperands::LOD,
3057                        s::ImageOperands::CONST_OFFSET,
3058                        s::ImageOperands::OFFSET,
3059                        s::ImageOperands::CONST_OFFSETS,
3060                        s::ImageOperands::SAMPLE,
3061                        s::ImageOperands::MIN_LOD,
3062                        s::ImageOperands::OFFSETS,
3063                    ]
3064                    .iter()
3065                    .filter(|arg| v.contains(**arg))
3066                    .flat_map(|_| {
3067                        [crate::grammar::LogicalOperand {
3068                            kind: crate::grammar::OperandKind::IdRef,
3069                            quantifier: crate::grammar::OperandQuantifier::One,
3070                        }]
3071                        .iter()
3072                        .cloned()
3073                    }),
3074                );
3075                result.extend(
3076                    [s::ImageOperands::GRAD]
3077                        .iter()
3078                        .filter(|arg| v.contains(**arg))
3079                        .flat_map(|_| {
3080                            [
3081                                crate::grammar::LogicalOperand {
3082                                    kind: crate::grammar::OperandKind::IdRef,
3083                                    quantifier: crate::grammar::OperandQuantifier::One,
3084                                },
3085                                crate::grammar::LogicalOperand {
3086                                    kind: crate::grammar::OperandKind::IdRef,
3087                                    quantifier: crate::grammar::OperandQuantifier::One,
3088                                },
3089                            ]
3090                            .iter()
3091                            .cloned()
3092                        }),
3093                );
3094                result.extend(
3095                    [
3096                        s::ImageOperands::MAKE_TEXEL_AVAILABLE,
3097                        s::ImageOperands::MAKE_TEXEL_VISIBLE,
3098                    ]
3099                    .iter()
3100                    .filter(|arg| v.contains(**arg))
3101                    .flat_map(|_| {
3102                        [crate::grammar::LogicalOperand {
3103                            kind: crate::grammar::OperandKind::IdScope,
3104                            quantifier: crate::grammar::OperandQuantifier::One,
3105                        }]
3106                        .iter()
3107                        .cloned()
3108                    }),
3109                );
3110                result
3111            }
3112            Self::LoopControl(v) => {
3113                let mut result = vec![];
3114                result.extend(
3115                    [
3116                        s::LoopControl::DEPENDENCY_LENGTH,
3117                        s::LoopControl::MIN_ITERATIONS,
3118                        s::LoopControl::MAX_ITERATIONS,
3119                        s::LoopControl::ITERATION_MULTIPLE,
3120                        s::LoopControl::PEEL_COUNT,
3121                        s::LoopControl::PARTIAL_COUNT,
3122                        s::LoopControl::INITIATION_INTERVAL_INTEL,
3123                        s::LoopControl::MAX_CONCURRENCY_INTEL,
3124                        s::LoopControl::DEPENDENCY_ARRAY_INTEL,
3125                        s::LoopControl::PIPELINE_ENABLE_INTEL,
3126                        s::LoopControl::LOOP_COALESCE_INTEL,
3127                        s::LoopControl::MAX_INTERLEAVING_INTEL,
3128                        s::LoopControl::SPECULATED_ITERATIONS_INTEL,
3129                        s::LoopControl::LOOP_COUNT_INTEL,
3130                        s::LoopControl::MAX_REINVOCATION_DELAY_INTEL,
3131                    ]
3132                    .iter()
3133                    .filter(|arg| v.contains(**arg))
3134                    .flat_map(|_| {
3135                        [crate::grammar::LogicalOperand {
3136                            kind: crate::grammar::OperandKind::LiteralInteger,
3137                            quantifier: crate::grammar::OperandQuantifier::One,
3138                        }]
3139                        .iter()
3140                        .cloned()
3141                    }),
3142                );
3143                result
3144            }
3145            Self::MemoryAccess(v) => {
3146                let mut result = vec![];
3147                result.extend(
3148                    [
3149                        s::MemoryAccess::ALIAS_SCOPE_INTEL_MASK,
3150                        s::MemoryAccess::NO_ALIAS_INTEL_MASK,
3151                    ]
3152                    .iter()
3153                    .filter(|arg| v.contains(**arg))
3154                    .flat_map(|_| {
3155                        [crate::grammar::LogicalOperand {
3156                            kind: crate::grammar::OperandKind::IdRef,
3157                            quantifier: crate::grammar::OperandQuantifier::One,
3158                        }]
3159                        .iter()
3160                        .cloned()
3161                    }),
3162                );
3163                result.extend(
3164                    [
3165                        s::MemoryAccess::MAKE_POINTER_AVAILABLE,
3166                        s::MemoryAccess::MAKE_POINTER_VISIBLE,
3167                    ]
3168                    .iter()
3169                    .filter(|arg| v.contains(**arg))
3170                    .flat_map(|_| {
3171                        [crate::grammar::LogicalOperand {
3172                            kind: crate::grammar::OperandKind::IdScope,
3173                            quantifier: crate::grammar::OperandQuantifier::One,
3174                        }]
3175                        .iter()
3176                        .cloned()
3177                    }),
3178                );
3179                result.extend(
3180                    [s::MemoryAccess::ALIGNED]
3181                        .iter()
3182                        .filter(|arg| v.contains(**arg))
3183                        .flat_map(|_| {
3184                            [crate::grammar::LogicalOperand {
3185                                kind: crate::grammar::OperandKind::LiteralInteger,
3186                                quantifier: crate::grammar::OperandQuantifier::One,
3187                            }]
3188                            .iter()
3189                            .cloned()
3190                        }),
3191                );
3192                result
3193            }
3194            Self::ExecutionMode(v) => match v {
3195                s::ExecutionMode::MaxNodeRecursionAMDX => vec![crate::grammar::LogicalOperand {
3196                    kind: crate::grammar::OperandKind::IdRef,
3197                    quantifier: crate::grammar::OperandQuantifier::One,
3198                }],
3199                s::ExecutionMode::ShaderIndexAMDX => vec![crate::grammar::LogicalOperand {
3200                    kind: crate::grammar::OperandKind::IdRef,
3201                    quantifier: crate::grammar::OperandQuantifier::One,
3202                }],
3203                s::ExecutionMode::SubgroupsPerWorkgroupId => vec![crate::grammar::LogicalOperand {
3204                    kind: crate::grammar::OperandKind::IdRef,
3205                    quantifier: crate::grammar::OperandQuantifier::One,
3206                }],
3207                s::ExecutionMode::LocalSizeHintId => vec![
3208                    crate::grammar::LogicalOperand {
3209                        kind: crate::grammar::OperandKind::IdRef,
3210                        quantifier: crate::grammar::OperandQuantifier::One,
3211                    },
3212                    crate::grammar::LogicalOperand {
3213                        kind: crate::grammar::OperandKind::IdRef,
3214                        quantifier: crate::grammar::OperandQuantifier::One,
3215                    },
3216                    crate::grammar::LogicalOperand {
3217                        kind: crate::grammar::OperandKind::IdRef,
3218                        quantifier: crate::grammar::OperandQuantifier::One,
3219                    },
3220                ],
3221                s::ExecutionMode::LocalSizeId
3222                | s::ExecutionMode::StaticNumWorkgroupsAMDX
3223                | s::ExecutionMode::MaxNumWorkgroupsAMDX => vec![
3224                    crate::grammar::LogicalOperand {
3225                        kind: crate::grammar::OperandKind::IdRef,
3226                        quantifier: crate::grammar::OperandQuantifier::One,
3227                    },
3228                    crate::grammar::LogicalOperand {
3229                        kind: crate::grammar::OperandKind::IdRef,
3230                        quantifier: crate::grammar::OperandQuantifier::One,
3231                    },
3232                    crate::grammar::LogicalOperand {
3233                        kind: crate::grammar::OperandKind::IdRef,
3234                        quantifier: crate::grammar::OperandQuantifier::One,
3235                    },
3236                ],
3237                s::ExecutionMode::NamedBarrierCountINTEL => vec![crate::grammar::LogicalOperand {
3238                    kind: crate::grammar::OperandKind::LiteralInteger,
3239                    quantifier: crate::grammar::OperandQuantifier::One,
3240                }],
3241                s::ExecutionMode::Invocations => vec![crate::grammar::LogicalOperand {
3242                    kind: crate::grammar::OperandKind::LiteralInteger,
3243                    quantifier: crate::grammar::OperandQuantifier::One,
3244                }],
3245                s::ExecutionMode::OutputPrimitivesNV => vec![crate::grammar::LogicalOperand {
3246                    kind: crate::grammar::OperandKind::LiteralInteger,
3247                    quantifier: crate::grammar::OperandQuantifier::One,
3248                }],
3249                s::ExecutionMode::SharedLocalMemorySizeINTEL => {
3250                    vec![crate::grammar::LogicalOperand {
3251                        kind: crate::grammar::OperandKind::LiteralInteger,
3252                        quantifier: crate::grammar::OperandQuantifier::One,
3253                    }]
3254                }
3255                s::ExecutionMode::StreamingInterfaceINTEL => vec![crate::grammar::LogicalOperand {
3256                    kind: crate::grammar::OperandKind::LiteralInteger,
3257                    quantifier: crate::grammar::OperandQuantifier::One,
3258                }],
3259                s::ExecutionMode::SubgroupSize => vec![crate::grammar::LogicalOperand {
3260                    kind: crate::grammar::OperandKind::LiteralInteger,
3261                    quantifier: crate::grammar::OperandQuantifier::One,
3262                }],
3263                s::ExecutionMode::SubgroupsPerWorkgroup => vec![crate::grammar::LogicalOperand {
3264                    kind: crate::grammar::OperandKind::LiteralInteger,
3265                    quantifier: crate::grammar::OperandQuantifier::One,
3266                }],
3267                s::ExecutionMode::DenormPreserve
3268                | s::ExecutionMode::DenormFlushToZero
3269                | s::ExecutionMode::SignedZeroInfNanPreserve
3270                | s::ExecutionMode::RoundingModeRTE
3271                | s::ExecutionMode::RoundingModeRTZ
3272                | s::ExecutionMode::RoundingModeRTPINTEL
3273                | s::ExecutionMode::RoundingModeRTNINTEL
3274                | s::ExecutionMode::FloatingPointModeALTINTEL
3275                | s::ExecutionMode::FloatingPointModeIEEEINTEL => {
3276                    vec![crate::grammar::LogicalOperand {
3277                        kind: crate::grammar::OperandKind::LiteralInteger,
3278                        quantifier: crate::grammar::OperandQuantifier::One,
3279                    }]
3280                }
3281                s::ExecutionMode::VecTypeHint => vec![crate::grammar::LogicalOperand {
3282                    kind: crate::grammar::OperandKind::LiteralInteger,
3283                    quantifier: crate::grammar::OperandQuantifier::One,
3284                }],
3285                s::ExecutionMode::OutputVertices => vec![crate::grammar::LogicalOperand {
3286                    kind: crate::grammar::OperandKind::LiteralInteger,
3287                    quantifier: crate::grammar::OperandQuantifier::One,
3288                }],
3289                s::ExecutionMode::RegisterMapInterfaceINTEL => {
3290                    vec![crate::grammar::LogicalOperand {
3291                        kind: crate::grammar::OperandKind::LiteralInteger,
3292                        quantifier: crate::grammar::OperandQuantifier::One,
3293                    }]
3294                }
3295                s::ExecutionMode::MaxWorkDimINTEL => vec![crate::grammar::LogicalOperand {
3296                    kind: crate::grammar::OperandKind::LiteralInteger,
3297                    quantifier: crate::grammar::OperandQuantifier::One,
3298                }],
3299                s::ExecutionMode::MaxWorkgroupSizeINTEL => vec![
3300                    crate::grammar::LogicalOperand {
3301                        kind: crate::grammar::OperandKind::LiteralInteger,
3302                        quantifier: crate::grammar::OperandQuantifier::One,
3303                    },
3304                    crate::grammar::LogicalOperand {
3305                        kind: crate::grammar::OperandKind::LiteralInteger,
3306                        quantifier: crate::grammar::OperandQuantifier::One,
3307                    },
3308                    crate::grammar::LogicalOperand {
3309                        kind: crate::grammar::OperandKind::LiteralInteger,
3310                        quantifier: crate::grammar::OperandQuantifier::One,
3311                    },
3312                ],
3313                s::ExecutionMode::SchedulerTargetFmaxMhzINTEL => {
3314                    vec![crate::grammar::LogicalOperand {
3315                        kind: crate::grammar::OperandKind::LiteralInteger,
3316                        quantifier: crate::grammar::OperandQuantifier::One,
3317                    }]
3318                }
3319                s::ExecutionMode::NumSIMDWorkitemsINTEL => vec![crate::grammar::LogicalOperand {
3320                    kind: crate::grammar::OperandKind::LiteralInteger,
3321                    quantifier: crate::grammar::OperandQuantifier::One,
3322                }],
3323                s::ExecutionMode::LocalSize | s::ExecutionMode::LocalSizeHint => vec![
3324                    crate::grammar::LogicalOperand {
3325                        kind: crate::grammar::OperandKind::LiteralInteger,
3326                        quantifier: crate::grammar::OperandQuantifier::One,
3327                    },
3328                    crate::grammar::LogicalOperand {
3329                        kind: crate::grammar::OperandKind::LiteralInteger,
3330                        quantifier: crate::grammar::OperandQuantifier::One,
3331                    },
3332                    crate::grammar::LogicalOperand {
3333                        kind: crate::grammar::OperandKind::LiteralInteger,
3334                        quantifier: crate::grammar::OperandQuantifier::One,
3335                    },
3336                ],
3337                _ => vec![],
3338            },
3339            Self::Decoration(v) => match v {
3340                s::Decoration::MMHostInterfaceReadWriteModeINTEL => {
3341                    vec![crate::grammar::LogicalOperand {
3342                        kind: crate::grammar::OperandKind::AccessQualifier,
3343                        quantifier: crate::grammar::OperandQuantifier::One,
3344                    }]
3345                }
3346                s::Decoration::BuiltIn => vec![crate::grammar::LogicalOperand {
3347                    kind: crate::grammar::OperandKind::BuiltIn,
3348                    quantifier: crate::grammar::OperandQuantifier::One,
3349                }],
3350                s::Decoration::FPFastMathMode => vec![crate::grammar::LogicalOperand {
3351                    kind: crate::grammar::OperandKind::FPFastMathMode,
3352                    quantifier: crate::grammar::OperandQuantifier::One,
3353                }],
3354                s::Decoration::FPRoundingMode => vec![crate::grammar::LogicalOperand {
3355                    kind: crate::grammar::OperandKind::FPRoundingMode,
3356                    quantifier: crate::grammar::OperandQuantifier::One,
3357                }],
3358                s::Decoration::FuncParamAttr => vec![crate::grammar::LogicalOperand {
3359                    kind: crate::grammar::OperandKind::FunctionParameterAttribute,
3360                    quantifier: crate::grammar::OperandQuantifier::One,
3361                }],
3362                s::Decoration::HostAccessINTEL => vec![
3363                    crate::grammar::LogicalOperand {
3364                        kind: crate::grammar::OperandKind::HostAccessQualifier,
3365                        quantifier: crate::grammar::OperandQuantifier::One,
3366                    },
3367                    crate::grammar::LogicalOperand {
3368                        kind: crate::grammar::OperandKind::LiteralString,
3369                        quantifier: crate::grammar::OperandQuantifier::One,
3370                    },
3371                ],
3372                s::Decoration::AliasScopeINTEL | s::Decoration::NoAliasINTEL => {
3373                    vec![crate::grammar::LogicalOperand {
3374                        kind: crate::grammar::OperandKind::IdRef,
3375                        quantifier: crate::grammar::OperandQuantifier::One,
3376                    }]
3377                }
3378                s::Decoration::AlignmentId => vec![crate::grammar::LogicalOperand {
3379                    kind: crate::grammar::OperandKind::IdRef,
3380                    quantifier: crate::grammar::OperandQuantifier::One,
3381                }],
3382                s::Decoration::CounterBuffer => vec![crate::grammar::LogicalOperand {
3383                    kind: crate::grammar::OperandKind::IdRef,
3384                    quantifier: crate::grammar::OperandQuantifier::One,
3385                }],
3386                s::Decoration::MaxByteOffsetId => vec![crate::grammar::LogicalOperand {
3387                    kind: crate::grammar::OperandKind::IdRef,
3388                    quantifier: crate::grammar::OperandQuantifier::One,
3389                }],
3390                s::Decoration::NodeMaxPayloadsAMDX => vec![crate::grammar::LogicalOperand {
3391                    kind: crate::grammar::OperandKind::IdRef,
3392                    quantifier: crate::grammar::OperandQuantifier::One,
3393                }],
3394                s::Decoration::NodeSharesPayloadLimitsWithAMDX => {
3395                    vec![crate::grammar::LogicalOperand {
3396                        kind: crate::grammar::OperandKind::IdRef,
3397                        quantifier: crate::grammar::OperandQuantifier::One,
3398                    }]
3399                }
3400                s::Decoration::UniformId => vec![crate::grammar::LogicalOperand {
3401                    kind: crate::grammar::OperandKind::IdScope,
3402                    quantifier: crate::grammar::OperandQuantifier::One,
3403                }],
3404                s::Decoration::InitModeINTEL => vec![crate::grammar::LogicalOperand {
3405                    kind: crate::grammar::OperandKind::InitializationModeQualifier,
3406                    quantifier: crate::grammar::OperandQuantifier::One,
3407                }],
3408                s::Decoration::FPMaxErrorDecorationINTEL => vec![crate::grammar::LogicalOperand {
3409                    kind: crate::grammar::OperandKind::LiteralFloat,
3410                    quantifier: crate::grammar::OperandQuantifier::One,
3411                }],
3412                s::Decoration::MMHostInterfaceAddressWidthINTEL => {
3413                    vec![crate::grammar::LogicalOperand {
3414                        kind: crate::grammar::OperandKind::LiteralInteger,
3415                        quantifier: crate::grammar::OperandQuantifier::One,
3416                    }]
3417                }
3418                s::Decoration::Alignment => vec![crate::grammar::LogicalOperand {
3419                    kind: crate::grammar::OperandKind::LiteralInteger,
3420                    quantifier: crate::grammar::OperandQuantifier::One,
3421                }],
3422                s::Decoration::ArrayStride => vec![crate::grammar::LogicalOperand {
3423                    kind: crate::grammar::OperandKind::LiteralInteger,
3424                    quantifier: crate::grammar::OperandQuantifier::One,
3425                }],
3426                s::Decoration::InputAttachmentIndex => vec![crate::grammar::LogicalOperand {
3427                    kind: crate::grammar::OperandKind::LiteralInteger,
3428                    quantifier: crate::grammar::OperandQuantifier::One,
3429                }],
3430                s::Decoration::BankBitsINTEL => vec![crate::grammar::LogicalOperand {
3431                    kind: crate::grammar::OperandKind::LiteralInteger,
3432                    quantifier: crate::grammar::OperandQuantifier::ZeroOrMore,
3433                }],
3434                s::Decoration::BankwidthINTEL => vec![crate::grammar::LogicalOperand {
3435                    kind: crate::grammar::OperandKind::LiteralInteger,
3436                    quantifier: crate::grammar::OperandQuantifier::One,
3437                }],
3438                s::Decoration::NumbanksINTEL => vec![crate::grammar::LogicalOperand {
3439                    kind: crate::grammar::OperandKind::LiteralInteger,
3440                    quantifier: crate::grammar::OperandQuantifier::One,
3441                }],
3442                s::Decoration::Binding => vec![crate::grammar::LogicalOperand {
3443                    kind: crate::grammar::OperandKind::LiteralInteger,
3444                    quantifier: crate::grammar::OperandQuantifier::One,
3445                }],
3446                s::Decoration::BufferLocationINTEL => vec![crate::grammar::LogicalOperand {
3447                    kind: crate::grammar::OperandKind::LiteralInteger,
3448                    quantifier: crate::grammar::OperandQuantifier::One,
3449                }],
3450                s::Decoration::Offset => vec![crate::grammar::LogicalOperand {
3451                    kind: crate::grammar::OperandKind::LiteralInteger,
3452                    quantifier: crate::grammar::OperandQuantifier::One,
3453                }],
3454                s::Decoration::CacheControlLoadINTEL => vec![
3455                    crate::grammar::LogicalOperand {
3456                        kind: crate::grammar::OperandKind::LiteralInteger,
3457                        quantifier: crate::grammar::OperandQuantifier::One,
3458                    },
3459                    crate::grammar::LogicalOperand {
3460                        kind: crate::grammar::OperandKind::LoadCacheControl,
3461                        quantifier: crate::grammar::OperandQuantifier::One,
3462                    },
3463                ],
3464                s::Decoration::CacheControlStoreINTEL => vec![
3465                    crate::grammar::LogicalOperand {
3466                        kind: crate::grammar::OperandKind::LiteralInteger,
3467                        quantifier: crate::grammar::OperandQuantifier::One,
3468                    },
3469                    crate::grammar::LogicalOperand {
3470                        kind: crate::grammar::OperandKind::StoreCacheControl,
3471                        quantifier: crate::grammar::OperandQuantifier::One,
3472                    },
3473                ],
3474                s::Decoration::CacheSizeINTEL => vec![crate::grammar::LogicalOperand {
3475                    kind: crate::grammar::OperandKind::LiteralInteger,
3476                    quantifier: crate::grammar::OperandQuantifier::One,
3477                }],
3478                s::Decoration::Component => vec![crate::grammar::LogicalOperand {
3479                    kind: crate::grammar::OperandKind::LiteralInteger,
3480                    quantifier: crate::grammar::OperandQuantifier::One,
3481                }],
3482                s::Decoration::InitiationIntervalINTEL => vec![crate::grammar::LogicalOperand {
3483                    kind: crate::grammar::OperandKind::LiteralInteger,
3484                    quantifier: crate::grammar::OperandQuantifier::One,
3485                }],
3486                s::Decoration::MMHostInterfaceDataWidthINTEL => {
3487                    vec![crate::grammar::LogicalOperand {
3488                        kind: crate::grammar::OperandKind::LiteralInteger,
3489                        quantifier: crate::grammar::OperandQuantifier::One,
3490                    }]
3491                }
3492                s::Decoration::DescriptorSet => vec![crate::grammar::LogicalOperand {
3493                    kind: crate::grammar::OperandKind::LiteralInteger,
3494                    quantifier: crate::grammar::OperandQuantifier::One,
3495                }],
3496                s::Decoration::PipelineEnableINTEL => vec![crate::grammar::LogicalOperand {
3497                    kind: crate::grammar::OperandKind::LiteralInteger,
3498                    quantifier: crate::grammar::OperandQuantifier::One,
3499                }],
3500                s::Decoration::ForcePow2DepthINTEL => vec![crate::grammar::LogicalOperand {
3501                    kind: crate::grammar::OperandKind::LiteralInteger,
3502                    quantifier: crate::grammar::OperandQuantifier::One,
3503                }],
3504                s::Decoration::IOPipeStorageINTEL => vec![crate::grammar::LogicalOperand {
3505                    kind: crate::grammar::OperandKind::LiteralInteger,
3506                    quantifier: crate::grammar::OperandQuantifier::One,
3507                }],
3508                s::Decoration::Index => vec![crate::grammar::LogicalOperand {
3509                    kind: crate::grammar::OperandKind::LiteralInteger,
3510                    quantifier: crate::grammar::OperandQuantifier::One,
3511                }],
3512                s::Decoration::MaxConcurrencyINTEL => vec![crate::grammar::LogicalOperand {
3513                    kind: crate::grammar::OperandKind::LiteralInteger,
3514                    quantifier: crate::grammar::OperandQuantifier::One,
3515                }],
3516                s::Decoration::FuncParamIOKindINTEL => vec![crate::grammar::LogicalOperand {
3517                    kind: crate::grammar::OperandKind::LiteralInteger,
3518                    quantifier: crate::grammar::OperandQuantifier::One,
3519                }],
3520                s::Decoration::LatencyControlLabelINTEL => vec![crate::grammar::LogicalOperand {
3521                    kind: crate::grammar::OperandKind::LiteralInteger,
3522                    quantifier: crate::grammar::OperandQuantifier::One,
3523                }],
3524                s::Decoration::MMHostInterfaceLatencyINTEL => {
3525                    vec![crate::grammar::LogicalOperand {
3526                        kind: crate::grammar::OperandKind::LiteralInteger,
3527                        quantifier: crate::grammar::OperandQuantifier::One,
3528                    }]
3529                }
3530                s::Decoration::Location => vec![crate::grammar::LogicalOperand {
3531                    kind: crate::grammar::OperandKind::LiteralInteger,
3532                    quantifier: crate::grammar::OperandQuantifier::One,
3533                }],
3534                s::Decoration::MatrixStride => vec![crate::grammar::LogicalOperand {
3535                    kind: crate::grammar::OperandKind::LiteralInteger,
3536                    quantifier: crate::grammar::OperandQuantifier::One,
3537                }],
3538                s::Decoration::MaxByteOffset => vec![crate::grammar::LogicalOperand {
3539                    kind: crate::grammar::OperandKind::LiteralInteger,
3540                    quantifier: crate::grammar::OperandQuantifier::One,
3541                }],
3542                s::Decoration::MMHostInterfaceMaxBurstINTEL => {
3543                    vec![crate::grammar::LogicalOperand {
3544                        kind: crate::grammar::OperandKind::LiteralInteger,
3545                        quantifier: crate::grammar::OperandQuantifier::One,
3546                    }]
3547                }
3548                s::Decoration::MaxPrivateCopiesINTEL => vec![crate::grammar::LogicalOperand {
3549                    kind: crate::grammar::OperandKind::LiteralInteger,
3550                    quantifier: crate::grammar::OperandQuantifier::One,
3551                }],
3552                s::Decoration::MaxReplicatesINTEL => vec![crate::grammar::LogicalOperand {
3553                    kind: crate::grammar::OperandKind::LiteralInteger,
3554                    quantifier: crate::grammar::OperandQuantifier::One,
3555                }],
3556                s::Decoration::MathOpDSPModeINTEL => vec![
3557                    crate::grammar::LogicalOperand {
3558                        kind: crate::grammar::OperandKind::LiteralInteger,
3559                        quantifier: crate::grammar::OperandQuantifier::One,
3560                    },
3561                    crate::grammar::LogicalOperand {
3562                        kind: crate::grammar::OperandKind::LiteralInteger,
3563                        quantifier: crate::grammar::OperandQuantifier::One,
3564                    },
3565                ],
3566                s::Decoration::SIMTCallINTEL => vec![crate::grammar::LogicalOperand {
3567                    kind: crate::grammar::OperandKind::LiteralInteger,
3568                    quantifier: crate::grammar::OperandQuantifier::One,
3569                }],
3570                s::Decoration::SecondaryViewportRelativeNV
3571                | s::Decoration::GlobalVariableOffsetINTEL => {
3572                    vec![crate::grammar::LogicalOperand {
3573                        kind: crate::grammar::OperandKind::LiteralInteger,
3574                        quantifier: crate::grammar::OperandQuantifier::One,
3575                    }]
3576                }
3577                s::Decoration::PrefetchINTEL => vec![crate::grammar::LogicalOperand {
3578                    kind: crate::grammar::OperandKind::LiteralInteger,
3579                    quantifier: crate::grammar::OperandQuantifier::One,
3580                }],
3581                s::Decoration::LatencyControlConstraintINTEL => vec![
3582                    crate::grammar::LogicalOperand {
3583                        kind: crate::grammar::OperandKind::LiteralInteger,
3584                        quantifier: crate::grammar::OperandQuantifier::One,
3585                    },
3586                    crate::grammar::LogicalOperand {
3587                        kind: crate::grammar::OperandKind::LiteralInteger,
3588                        quantifier: crate::grammar::OperandQuantifier::One,
3589                    },
3590                    crate::grammar::LogicalOperand {
3591                        kind: crate::grammar::OperandKind::LiteralInteger,
3592                        quantifier: crate::grammar::OperandQuantifier::One,
3593                    },
3594                ],
3595                s::Decoration::SpecId => vec![crate::grammar::LogicalOperand {
3596                    kind: crate::grammar::OperandKind::LiteralInteger,
3597                    quantifier: crate::grammar::OperandQuantifier::One,
3598                }],
3599                s::Decoration::Stream => vec![crate::grammar::LogicalOperand {
3600                    kind: crate::grammar::OperandKind::LiteralInteger,
3601                    quantifier: crate::grammar::OperandQuantifier::One,
3602                }],
3603                s::Decoration::FunctionDenormModeINTEL => vec![
3604                    crate::grammar::LogicalOperand {
3605                        kind: crate::grammar::OperandKind::LiteralInteger,
3606                        quantifier: crate::grammar::OperandQuantifier::One,
3607                    },
3608                    crate::grammar::LogicalOperand {
3609                        kind: crate::grammar::OperandKind::FPDenormMode,
3610                        quantifier: crate::grammar::OperandQuantifier::One,
3611                    },
3612                ],
3613                s::Decoration::FunctionFloatingPointModeINTEL => vec![
3614                    crate::grammar::LogicalOperand {
3615                        kind: crate::grammar::OperandKind::LiteralInteger,
3616                        quantifier: crate::grammar::OperandQuantifier::One,
3617                    },
3618                    crate::grammar::LogicalOperand {
3619                        kind: crate::grammar::OperandKind::FPOperationMode,
3620                        quantifier: crate::grammar::OperandQuantifier::One,
3621                    },
3622                ],
3623                s::Decoration::FunctionRoundingModeINTEL => vec![
3624                    crate::grammar::LogicalOperand {
3625                        kind: crate::grammar::OperandKind::LiteralInteger,
3626                        quantifier: crate::grammar::OperandQuantifier::One,
3627                    },
3628                    crate::grammar::LogicalOperand {
3629                        kind: crate::grammar::OperandKind::FPRoundingMode,
3630                        quantifier: crate::grammar::OperandQuantifier::One,
3631                    },
3632                ],
3633                s::Decoration::MMHostInterfaceWaitRequestINTEL => {
3634                    vec![crate::grammar::LogicalOperand {
3635                        kind: crate::grammar::OperandKind::LiteralInteger,
3636                        quantifier: crate::grammar::OperandQuantifier::One,
3637                    }]
3638                }
3639                s::Decoration::XfbBuffer => vec![crate::grammar::LogicalOperand {
3640                    kind: crate::grammar::OperandKind::LiteralInteger,
3641                    quantifier: crate::grammar::OperandQuantifier::One,
3642                }],
3643                s::Decoration::XfbStride => vec![crate::grammar::LogicalOperand {
3644                    kind: crate::grammar::OperandKind::LiteralInteger,
3645                    quantifier: crate::grammar::OperandQuantifier::One,
3646                }],
3647                s::Decoration::ImplementInRegisterMapINTEL => {
3648                    vec![crate::grammar::LogicalOperand {
3649                        kind: crate::grammar::OperandKind::LiteralInteger,
3650                        quantifier: crate::grammar::OperandQuantifier::One,
3651                    }]
3652                }
3653                s::Decoration::MemoryINTEL => vec![crate::grammar::LogicalOperand {
3654                    kind: crate::grammar::OperandKind::LiteralString,
3655                    quantifier: crate::grammar::OperandQuantifier::One,
3656                }],
3657                s::Decoration::MergeINTEL => vec![
3658                    crate::grammar::LogicalOperand {
3659                        kind: crate::grammar::OperandKind::LiteralString,
3660                        quantifier: crate::grammar::OperandQuantifier::One,
3661                    },
3662                    crate::grammar::LogicalOperand {
3663                        kind: crate::grammar::OperandKind::LiteralString,
3664                        quantifier: crate::grammar::OperandQuantifier::One,
3665                    },
3666                ],
3667                s::Decoration::LinkageAttributes => vec![
3668                    crate::grammar::LogicalOperand {
3669                        kind: crate::grammar::OperandKind::LiteralString,
3670                        quantifier: crate::grammar::OperandQuantifier::One,
3671                    },
3672                    crate::grammar::LogicalOperand {
3673                        kind: crate::grammar::OperandKind::LinkageType,
3674                        quantifier: crate::grammar::OperandQuantifier::One,
3675                    },
3676                ],
3677                s::Decoration::PayloadNodeNameAMDX => vec![crate::grammar::LogicalOperand {
3678                    kind: crate::grammar::OperandKind::LiteralString,
3679                    quantifier: crate::grammar::OperandQuantifier::One,
3680                }],
3681                s::Decoration::ClobberINTEL => vec![crate::grammar::LogicalOperand {
3682                    kind: crate::grammar::OperandKind::LiteralString,
3683                    quantifier: crate::grammar::OperandQuantifier::One,
3684                }],
3685                s::Decoration::UserSemantic => vec![crate::grammar::LogicalOperand {
3686                    kind: crate::grammar::OperandKind::LiteralString,
3687                    quantifier: crate::grammar::OperandQuantifier::One,
3688                }],
3689                s::Decoration::UserTypeGOOGLE => vec![crate::grammar::LogicalOperand {
3690                    kind: crate::grammar::OperandKind::LiteralString,
3691                    quantifier: crate::grammar::OperandQuantifier::One,
3692                }],
3693                _ => vec![],
3694            },
3695            _ => vec![],
3696        }
3697    }
3698}