Skip to main content

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    RawAccessChainOperands(spirv::RawAccessChainOperands),
20    SourceLanguage(spirv::SourceLanguage),
21    ExecutionModel(spirv::ExecutionModel),
22    AddressingModel(spirv::AddressingModel),
23    MemoryModel(spirv::MemoryModel),
24    ExecutionMode(spirv::ExecutionMode),
25    StorageClass(spirv::StorageClass),
26    Dim(spirv::Dim),
27    SamplerAddressingMode(spirv::SamplerAddressingMode),
28    SamplerFilterMode(spirv::SamplerFilterMode),
29    ImageFormat(spirv::ImageFormat),
30    ImageChannelOrder(spirv::ImageChannelOrder),
31    ImageChannelDataType(spirv::ImageChannelDataType),
32    FPRoundingMode(spirv::FPRoundingMode),
33    FPDenormMode(spirv::FPDenormMode),
34    QuantizationModes(spirv::QuantizationModes),
35    FPOperationMode(spirv::FPOperationMode),
36    OverflowModes(spirv::OverflowModes),
37    LinkageType(spirv::LinkageType),
38    AccessQualifier(spirv::AccessQualifier),
39    HostAccessQualifier(spirv::HostAccessQualifier),
40    FunctionParameterAttribute(spirv::FunctionParameterAttribute),
41    Decoration(spirv::Decoration),
42    BuiltIn(spirv::BuiltIn),
43    Scope(spirv::Scope),
44    GroupOperation(spirv::GroupOperation),
45    KernelEnqueueFlags(spirv::KernelEnqueueFlags),
46    Capability(spirv::Capability),
47    RayQueryIntersection(spirv::RayQueryIntersection),
48    RayQueryCommittedIntersectionType(spirv::RayQueryCommittedIntersectionType),
49    RayQueryCandidateIntersectionType(spirv::RayQueryCandidateIntersectionType),
50    PackedVectorFormat(spirv::PackedVectorFormat),
51    CooperativeMatrixOperands(spirv::CooperativeMatrixOperands),
52    CooperativeMatrixLayout(spirv::CooperativeMatrixLayout),
53    CooperativeMatrixUse(spirv::CooperativeMatrixUse),
54    CooperativeMatrixReduce(spirv::CooperativeMatrixReduce),
55    TensorClampMode(spirv::TensorClampMode),
56    TensorAddressingOperands(spirv::TensorAddressingOperands),
57    InitializationModeQualifier(spirv::InitializationModeQualifier),
58    LoadCacheControl(spirv::LoadCacheControl),
59    StoreCacheControl(spirv::StoreCacheControl),
60    NamedMaximumNumberOfRegisters(spirv::NamedMaximumNumberOfRegisters),
61    MatrixMultiplyAccumulateOperands(spirv::MatrixMultiplyAccumulateOperands),
62    FPEncoding(spirv::FPEncoding),
63    CooperativeVectorMatrixLayout(spirv::CooperativeVectorMatrixLayout),
64    ComponentType(spirv::ComponentType),
65    TensorOperands(spirv::TensorOperands),
66    IdMemorySemantics(spirv::Word),
67    IdScope(spirv::Word),
68    IdRef(spirv::Word),
69    LiteralBit32(u32),
70    LiteralBit64(u64),
71    LiteralExtInstInteger(u32),
72    LiteralSpecConstantOpInteger(spirv::Op),
73    LiteralString(String),
74}
75impl From<spirv::ImageOperands> for Operand {
76    fn from(o: spirv::ImageOperands) -> Self {
77        Self::ImageOperands(o)
78    }
79}
80impl From<spirv::FPFastMathMode> for Operand {
81    fn from(o: spirv::FPFastMathMode) -> Self {
82        Self::FPFastMathMode(o)
83    }
84}
85impl From<spirv::SelectionControl> for Operand {
86    fn from(o: spirv::SelectionControl) -> Self {
87        Self::SelectionControl(o)
88    }
89}
90impl From<spirv::LoopControl> for Operand {
91    fn from(o: spirv::LoopControl) -> Self {
92        Self::LoopControl(o)
93    }
94}
95impl From<spirv::FunctionControl> for Operand {
96    fn from(o: spirv::FunctionControl) -> Self {
97        Self::FunctionControl(o)
98    }
99}
100impl From<spirv::MemorySemantics> for Operand {
101    fn from(o: spirv::MemorySemantics) -> Self {
102        Self::MemorySemantics(o)
103    }
104}
105impl From<spirv::MemoryAccess> for Operand {
106    fn from(o: spirv::MemoryAccess) -> Self {
107        Self::MemoryAccess(o)
108    }
109}
110impl From<spirv::KernelProfilingInfo> for Operand {
111    fn from(o: spirv::KernelProfilingInfo) -> Self {
112        Self::KernelProfilingInfo(o)
113    }
114}
115impl From<spirv::RayFlags> for Operand {
116    fn from(o: spirv::RayFlags) -> Self {
117        Self::RayFlags(o)
118    }
119}
120impl From<spirv::FragmentShadingRate> for Operand {
121    fn from(o: spirv::FragmentShadingRate) -> Self {
122        Self::FragmentShadingRate(o)
123    }
124}
125impl From<spirv::RawAccessChainOperands> for Operand {
126    fn from(o: spirv::RawAccessChainOperands) -> Self {
127        Self::RawAccessChainOperands(o)
128    }
129}
130impl From<spirv::SourceLanguage> for Operand {
131    fn from(o: spirv::SourceLanguage) -> Self {
132        Self::SourceLanguage(o)
133    }
134}
135impl From<spirv::ExecutionModel> for Operand {
136    fn from(o: spirv::ExecutionModel) -> Self {
137        Self::ExecutionModel(o)
138    }
139}
140impl From<spirv::AddressingModel> for Operand {
141    fn from(o: spirv::AddressingModel) -> Self {
142        Self::AddressingModel(o)
143    }
144}
145impl From<spirv::MemoryModel> for Operand {
146    fn from(o: spirv::MemoryModel) -> Self {
147        Self::MemoryModel(o)
148    }
149}
150impl From<spirv::ExecutionMode> for Operand {
151    fn from(o: spirv::ExecutionMode) -> Self {
152        Self::ExecutionMode(o)
153    }
154}
155impl From<spirv::StorageClass> for Operand {
156    fn from(o: spirv::StorageClass) -> Self {
157        Self::StorageClass(o)
158    }
159}
160impl From<spirv::Dim> for Operand {
161    fn from(o: spirv::Dim) -> Self {
162        Self::Dim(o)
163    }
164}
165impl From<spirv::SamplerAddressingMode> for Operand {
166    fn from(o: spirv::SamplerAddressingMode) -> Self {
167        Self::SamplerAddressingMode(o)
168    }
169}
170impl From<spirv::SamplerFilterMode> for Operand {
171    fn from(o: spirv::SamplerFilterMode) -> Self {
172        Self::SamplerFilterMode(o)
173    }
174}
175impl From<spirv::ImageFormat> for Operand {
176    fn from(o: spirv::ImageFormat) -> Self {
177        Self::ImageFormat(o)
178    }
179}
180impl From<spirv::ImageChannelOrder> for Operand {
181    fn from(o: spirv::ImageChannelOrder) -> Self {
182        Self::ImageChannelOrder(o)
183    }
184}
185impl From<spirv::ImageChannelDataType> for Operand {
186    fn from(o: spirv::ImageChannelDataType) -> Self {
187        Self::ImageChannelDataType(o)
188    }
189}
190impl From<spirv::FPRoundingMode> for Operand {
191    fn from(o: spirv::FPRoundingMode) -> Self {
192        Self::FPRoundingMode(o)
193    }
194}
195impl From<spirv::FPDenormMode> for Operand {
196    fn from(o: spirv::FPDenormMode) -> Self {
197        Self::FPDenormMode(o)
198    }
199}
200impl From<spirv::QuantizationModes> for Operand {
201    fn from(o: spirv::QuantizationModes) -> Self {
202        Self::QuantizationModes(o)
203    }
204}
205impl From<spirv::FPOperationMode> for Operand {
206    fn from(o: spirv::FPOperationMode) -> Self {
207        Self::FPOperationMode(o)
208    }
209}
210impl From<spirv::OverflowModes> for Operand {
211    fn from(o: spirv::OverflowModes) -> Self {
212        Self::OverflowModes(o)
213    }
214}
215impl From<spirv::LinkageType> for Operand {
216    fn from(o: spirv::LinkageType) -> Self {
217        Self::LinkageType(o)
218    }
219}
220impl From<spirv::AccessQualifier> for Operand {
221    fn from(o: spirv::AccessQualifier) -> Self {
222        Self::AccessQualifier(o)
223    }
224}
225impl From<spirv::HostAccessQualifier> for Operand {
226    fn from(o: spirv::HostAccessQualifier) -> Self {
227        Self::HostAccessQualifier(o)
228    }
229}
230impl From<spirv::FunctionParameterAttribute> for Operand {
231    fn from(o: spirv::FunctionParameterAttribute) -> Self {
232        Self::FunctionParameterAttribute(o)
233    }
234}
235impl From<spirv::Decoration> for Operand {
236    fn from(o: spirv::Decoration) -> Self {
237        Self::Decoration(o)
238    }
239}
240impl From<spirv::BuiltIn> for Operand {
241    fn from(o: spirv::BuiltIn) -> Self {
242        Self::BuiltIn(o)
243    }
244}
245impl From<spirv::Scope> for Operand {
246    fn from(o: spirv::Scope) -> Self {
247        Self::Scope(o)
248    }
249}
250impl From<spirv::GroupOperation> for Operand {
251    fn from(o: spirv::GroupOperation) -> Self {
252        Self::GroupOperation(o)
253    }
254}
255impl From<spirv::KernelEnqueueFlags> for Operand {
256    fn from(o: spirv::KernelEnqueueFlags) -> Self {
257        Self::KernelEnqueueFlags(o)
258    }
259}
260impl From<spirv::Capability> for Operand {
261    fn from(o: spirv::Capability) -> Self {
262        Self::Capability(o)
263    }
264}
265impl From<spirv::RayQueryIntersection> for Operand {
266    fn from(o: spirv::RayQueryIntersection) -> Self {
267        Self::RayQueryIntersection(o)
268    }
269}
270impl From<spirv::RayQueryCommittedIntersectionType> for Operand {
271    fn from(o: spirv::RayQueryCommittedIntersectionType) -> Self {
272        Self::RayQueryCommittedIntersectionType(o)
273    }
274}
275impl From<spirv::RayQueryCandidateIntersectionType> for Operand {
276    fn from(o: spirv::RayQueryCandidateIntersectionType) -> Self {
277        Self::RayQueryCandidateIntersectionType(o)
278    }
279}
280impl From<spirv::PackedVectorFormat> for Operand {
281    fn from(o: spirv::PackedVectorFormat) -> Self {
282        Self::PackedVectorFormat(o)
283    }
284}
285impl From<spirv::CooperativeMatrixOperands> for Operand {
286    fn from(o: spirv::CooperativeMatrixOperands) -> Self {
287        Self::CooperativeMatrixOperands(o)
288    }
289}
290impl From<spirv::CooperativeMatrixLayout> for Operand {
291    fn from(o: spirv::CooperativeMatrixLayout) -> Self {
292        Self::CooperativeMatrixLayout(o)
293    }
294}
295impl From<spirv::CooperativeMatrixUse> for Operand {
296    fn from(o: spirv::CooperativeMatrixUse) -> Self {
297        Self::CooperativeMatrixUse(o)
298    }
299}
300impl From<spirv::CooperativeMatrixReduce> for Operand {
301    fn from(o: spirv::CooperativeMatrixReduce) -> Self {
302        Self::CooperativeMatrixReduce(o)
303    }
304}
305impl From<spirv::TensorClampMode> for Operand {
306    fn from(o: spirv::TensorClampMode) -> Self {
307        Self::TensorClampMode(o)
308    }
309}
310impl From<spirv::TensorAddressingOperands> for Operand {
311    fn from(o: spirv::TensorAddressingOperands) -> Self {
312        Self::TensorAddressingOperands(o)
313    }
314}
315impl From<spirv::InitializationModeQualifier> for Operand {
316    fn from(o: spirv::InitializationModeQualifier) -> Self {
317        Self::InitializationModeQualifier(o)
318    }
319}
320impl From<spirv::LoadCacheControl> for Operand {
321    fn from(o: spirv::LoadCacheControl) -> Self {
322        Self::LoadCacheControl(o)
323    }
324}
325impl From<spirv::StoreCacheControl> for Operand {
326    fn from(o: spirv::StoreCacheControl) -> Self {
327        Self::StoreCacheControl(o)
328    }
329}
330impl From<spirv::NamedMaximumNumberOfRegisters> for Operand {
331    fn from(o: spirv::NamedMaximumNumberOfRegisters) -> Self {
332        Self::NamedMaximumNumberOfRegisters(o)
333    }
334}
335impl From<spirv::MatrixMultiplyAccumulateOperands> for Operand {
336    fn from(o: spirv::MatrixMultiplyAccumulateOperands) -> Self {
337        Self::MatrixMultiplyAccumulateOperands(o)
338    }
339}
340impl From<spirv::FPEncoding> for Operand {
341    fn from(o: spirv::FPEncoding) -> Self {
342        Self::FPEncoding(o)
343    }
344}
345impl From<spirv::CooperativeVectorMatrixLayout> for Operand {
346    fn from(o: spirv::CooperativeVectorMatrixLayout) -> Self {
347        Self::CooperativeVectorMatrixLayout(o)
348    }
349}
350impl From<spirv::ComponentType> for Operand {
351    fn from(o: spirv::ComponentType) -> Self {
352        Self::ComponentType(o)
353    }
354}
355impl From<spirv::TensorOperands> for Operand {
356    fn from(o: spirv::TensorOperands) -> Self {
357        Self::TensorOperands(o)
358    }
359}
360impl From<u32> for Operand {
361    fn from(o: u32) -> Self {
362        Self::LiteralBit32(o)
363    }
364}
365impl From<u64> for Operand {
366    fn from(o: u64) -> Self {
367        Self::LiteralBit64(o)
368    }
369}
370impl From<spirv::Op> for Operand {
371    fn from(o: spirv::Op) -> Self {
372        Self::LiteralSpecConstantOpInteger(o)
373    }
374}
375impl From<String> for Operand {
376    fn from(o: String) -> Self {
377        Self::LiteralString(o)
378    }
379}
380impl fmt::Display for Operand {
381    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
382        match *self {
383            Operand::ImageOperands(ref v) => write!(f, "{:?}", v),
384            Operand::FPFastMathMode(ref v) => write!(f, "{:?}", v),
385            Operand::SelectionControl(ref v) => write!(f, "{:?}", v),
386            Operand::LoopControl(ref v) => write!(f, "{:?}", v),
387            Operand::FunctionControl(ref v) => write!(f, "{:?}", v),
388            Operand::MemorySemantics(ref v) => write!(f, "{:?}", v),
389            Operand::MemoryAccess(ref v) => write!(f, "{:?}", v),
390            Operand::KernelProfilingInfo(ref v) => write!(f, "{:?}", v),
391            Operand::RayFlags(ref v) => write!(f, "{:?}", v),
392            Operand::FragmentShadingRate(ref v) => write!(f, "{:?}", v),
393            Operand::RawAccessChainOperands(ref v) => write!(f, "{:?}", v),
394            Operand::SourceLanguage(ref v) => write!(f, "{:?}", v),
395            Operand::ExecutionModel(ref v) => write!(f, "{:?}", v),
396            Operand::AddressingModel(ref v) => write!(f, "{:?}", v),
397            Operand::MemoryModel(ref v) => write!(f, "{:?}", v),
398            Operand::ExecutionMode(ref v) => write!(f, "{:?}", v),
399            Operand::StorageClass(ref v) => write!(f, "{:?}", v),
400            Operand::Dim(ref v) => write!(f, "{}", &format!("{:?}", v)[3..]),
401            Operand::SamplerAddressingMode(ref v) => write!(f, "{:?}", v),
402            Operand::SamplerFilterMode(ref v) => write!(f, "{:?}", v),
403            Operand::ImageFormat(ref v) => write!(f, "{:?}", v),
404            Operand::ImageChannelOrder(ref v) => write!(f, "{:?}", v),
405            Operand::ImageChannelDataType(ref v) => write!(f, "{:?}", v),
406            Operand::FPRoundingMode(ref v) => write!(f, "{:?}", v),
407            Operand::FPDenormMode(ref v) => write!(f, "{:?}", v),
408            Operand::QuantizationModes(ref v) => write!(f, "{:?}", v),
409            Operand::FPOperationMode(ref v) => write!(f, "{:?}", v),
410            Operand::OverflowModes(ref v) => write!(f, "{:?}", v),
411            Operand::LinkageType(ref v) => write!(f, "{:?}", v),
412            Operand::AccessQualifier(ref v) => write!(f, "{:?}", v),
413            Operand::HostAccessQualifier(ref v) => write!(f, "{:?}", v),
414            Operand::FunctionParameterAttribute(ref v) => write!(f, "{:?}", v),
415            Operand::Decoration(ref v) => write!(f, "{:?}", v),
416            Operand::BuiltIn(ref v) => write!(f, "{:?}", v),
417            Operand::Scope(ref v) => write!(f, "{:?}", v),
418            Operand::GroupOperation(ref v) => write!(f, "{:?}", v),
419            Operand::KernelEnqueueFlags(ref v) => write!(f, "{:?}", v),
420            Operand::Capability(ref v) => write!(f, "{:?}", v),
421            Operand::RayQueryIntersection(ref v) => write!(f, "{:?}", v),
422            Operand::RayQueryCommittedIntersectionType(ref v) => write!(f, "{:?}", v),
423            Operand::RayQueryCandidateIntersectionType(ref v) => write!(f, "{:?}", v),
424            Operand::PackedVectorFormat(ref v) => write!(f, "{:?}", v),
425            Operand::CooperativeMatrixOperands(ref v) => write!(f, "{:?}", v),
426            Operand::CooperativeMatrixLayout(ref v) => write!(f, "{:?}", v),
427            Operand::CooperativeMatrixUse(ref v) => write!(f, "{:?}", v),
428            Operand::CooperativeMatrixReduce(ref v) => write!(f, "{:?}", v),
429            Operand::TensorClampMode(ref v) => write!(f, "{:?}", v),
430            Operand::TensorAddressingOperands(ref v) => write!(f, "{:?}", v),
431            Operand::InitializationModeQualifier(ref v) => write!(f, "{:?}", v),
432            Operand::LoadCacheControl(ref v) => write!(f, "{:?}", v),
433            Operand::StoreCacheControl(ref v) => write!(f, "{:?}", v),
434            Operand::NamedMaximumNumberOfRegisters(ref v) => write!(f, "{:?}", v),
435            Operand::MatrixMultiplyAccumulateOperands(ref v) => write!(f, "{:?}", v),
436            Operand::FPEncoding(ref v) => write!(f, "{:?}", v),
437            Operand::CooperativeVectorMatrixLayout(ref v) => write!(f, "{:?}", v),
438            Operand::ComponentType(ref v) => write!(f, "{:?}", v),
439            Operand::IdMemorySemantics(ref v) => write!(f, "%{}", v),
440            Operand::IdScope(ref v) => write!(f, "%{}", v),
441            Operand::IdRef(ref v) => write!(f, "%{}", v),
442            Operand::LiteralString(ref v) => write!(f, "{:?}", v),
443            Operand::LiteralExtInstInteger(ref v) => write!(f, "{:?}", v),
444            Operand::LiteralSpecConstantOpInteger(ref v) => write!(f, "{:?}", v),
445            Operand::TensorOperands(ref v) => write!(f, "{:?}", v),
446            Operand::LiteralBit32(ref v) => write!(f, "{:?}", v),
447            Operand::LiteralBit64(ref v) => write!(f, "{:?}", v),
448        }
449    }
450}
451impl Operand {
452    pub fn unwrap_image_operands(&self) -> spirv::ImageOperands {
453        match *self {
454            Self::ImageOperands(v) => v,
455            ref other => panic!("Expected Operand::ImageOperands, got {} instead", other),
456        }
457    }
458    pub fn unwrap_fp_fast_math_mode(&self) -> spirv::FPFastMathMode {
459        match *self {
460            Self::FPFastMathMode(v) => v,
461            ref other => panic!("Expected Operand::FPFastMathMode, got {} instead", other),
462        }
463    }
464    pub fn unwrap_selection_control(&self) -> spirv::SelectionControl {
465        match *self {
466            Self::SelectionControl(v) => v,
467            ref other => panic!("Expected Operand::SelectionControl, got {} instead", other),
468        }
469    }
470    pub fn unwrap_loop_control(&self) -> spirv::LoopControl {
471        match *self {
472            Self::LoopControl(v) => v,
473            ref other => panic!("Expected Operand::LoopControl, got {} instead", other),
474        }
475    }
476    pub fn unwrap_function_control(&self) -> spirv::FunctionControl {
477        match *self {
478            Self::FunctionControl(v) => v,
479            ref other => panic!("Expected Operand::FunctionControl, got {} instead", other),
480        }
481    }
482    pub fn unwrap_memory_semantics(&self) -> spirv::MemorySemantics {
483        match *self {
484            Self::MemorySemantics(v) => v,
485            ref other => panic!("Expected Operand::MemorySemantics, got {} instead", other),
486        }
487    }
488    pub fn unwrap_memory_access(&self) -> spirv::MemoryAccess {
489        match *self {
490            Self::MemoryAccess(v) => v,
491            ref other => panic!("Expected Operand::MemoryAccess, got {} instead", other),
492        }
493    }
494    pub fn unwrap_kernel_profiling_info(&self) -> spirv::KernelProfilingInfo {
495        match *self {
496            Self::KernelProfilingInfo(v) => v,
497            ref other => panic!(
498                "Expected Operand::KernelProfilingInfo, got {} instead",
499                other
500            ),
501        }
502    }
503    pub fn unwrap_ray_flags(&self) -> spirv::RayFlags {
504        match *self {
505            Self::RayFlags(v) => v,
506            ref other => panic!("Expected Operand::RayFlags, got {} instead", other),
507        }
508    }
509    pub fn unwrap_fragment_shading_rate(&self) -> spirv::FragmentShadingRate {
510        match *self {
511            Self::FragmentShadingRate(v) => v,
512            ref other => panic!(
513                "Expected Operand::FragmentShadingRate, got {} instead",
514                other
515            ),
516        }
517    }
518    pub fn unwrap_raw_access_chain_operands(&self) -> spirv::RawAccessChainOperands {
519        match *self {
520            Self::RawAccessChainOperands(v) => v,
521            ref other => panic!(
522                "Expected Operand::RawAccessChainOperands, got {} instead",
523                other
524            ),
525        }
526    }
527    pub fn unwrap_source_language(&self) -> spirv::SourceLanguage {
528        match *self {
529            Self::SourceLanguage(v) => v,
530            ref other => panic!("Expected Operand::SourceLanguage, got {} instead", other),
531        }
532    }
533    pub fn unwrap_execution_model(&self) -> spirv::ExecutionModel {
534        match *self {
535            Self::ExecutionModel(v) => v,
536            ref other => panic!("Expected Operand::ExecutionModel, got {} instead", other),
537        }
538    }
539    pub fn unwrap_addressing_model(&self) -> spirv::AddressingModel {
540        match *self {
541            Self::AddressingModel(v) => v,
542            ref other => panic!("Expected Operand::AddressingModel, got {} instead", other),
543        }
544    }
545    pub fn unwrap_memory_model(&self) -> spirv::MemoryModel {
546        match *self {
547            Self::MemoryModel(v) => v,
548            ref other => panic!("Expected Operand::MemoryModel, got {} instead", other),
549        }
550    }
551    pub fn unwrap_execution_mode(&self) -> spirv::ExecutionMode {
552        match *self {
553            Self::ExecutionMode(v) => v,
554            ref other => panic!("Expected Operand::ExecutionMode, got {} instead", other),
555        }
556    }
557    pub fn unwrap_storage_class(&self) -> spirv::StorageClass {
558        match *self {
559            Self::StorageClass(v) => v,
560            ref other => panic!("Expected Operand::StorageClass, got {} instead", other),
561        }
562    }
563    pub fn unwrap_dim(&self) -> spirv::Dim {
564        match *self {
565            Self::Dim(v) => v,
566            ref other => panic!("Expected Operand::Dim, got {} instead", other),
567        }
568    }
569    pub fn unwrap_sampler_addressing_mode(&self) -> spirv::SamplerAddressingMode {
570        match *self {
571            Self::SamplerAddressingMode(v) => v,
572            ref other => panic!(
573                "Expected Operand::SamplerAddressingMode, got {} instead",
574                other
575            ),
576        }
577    }
578    pub fn unwrap_sampler_filter_mode(&self) -> spirv::SamplerFilterMode {
579        match *self {
580            Self::SamplerFilterMode(v) => v,
581            ref other => panic!("Expected Operand::SamplerFilterMode, got {} instead", other),
582        }
583    }
584    pub fn unwrap_image_format(&self) -> spirv::ImageFormat {
585        match *self {
586            Self::ImageFormat(v) => v,
587            ref other => panic!("Expected Operand::ImageFormat, got {} instead", other),
588        }
589    }
590    pub fn unwrap_image_channel_order(&self) -> spirv::ImageChannelOrder {
591        match *self {
592            Self::ImageChannelOrder(v) => v,
593            ref other => panic!("Expected Operand::ImageChannelOrder, got {} instead", other),
594        }
595    }
596    pub fn unwrap_image_channel_data_type(&self) -> spirv::ImageChannelDataType {
597        match *self {
598            Self::ImageChannelDataType(v) => v,
599            ref other => panic!(
600                "Expected Operand::ImageChannelDataType, got {} instead",
601                other
602            ),
603        }
604    }
605    pub fn unwrap_fp_rounding_mode(&self) -> spirv::FPRoundingMode {
606        match *self {
607            Self::FPRoundingMode(v) => v,
608            ref other => panic!("Expected Operand::FPRoundingMode, got {} instead", other),
609        }
610    }
611    pub fn unwrap_fp_denorm_mode(&self) -> spirv::FPDenormMode {
612        match *self {
613            Self::FPDenormMode(v) => v,
614            ref other => panic!("Expected Operand::FPDenormMode, got {} instead", other),
615        }
616    }
617    pub fn unwrap_quantization_modes(&self) -> spirv::QuantizationModes {
618        match *self {
619            Self::QuantizationModes(v) => v,
620            ref other => panic!("Expected Operand::QuantizationModes, got {} instead", other),
621        }
622    }
623    pub fn unwrap_fp_operation_mode(&self) -> spirv::FPOperationMode {
624        match *self {
625            Self::FPOperationMode(v) => v,
626            ref other => panic!("Expected Operand::FPOperationMode, got {} instead", other),
627        }
628    }
629    pub fn unwrap_overflow_modes(&self) -> spirv::OverflowModes {
630        match *self {
631            Self::OverflowModes(v) => v,
632            ref other => panic!("Expected Operand::OverflowModes, got {} instead", other),
633        }
634    }
635    pub fn unwrap_linkage_type(&self) -> spirv::LinkageType {
636        match *self {
637            Self::LinkageType(v) => v,
638            ref other => panic!("Expected Operand::LinkageType, got {} instead", other),
639        }
640    }
641    pub fn unwrap_access_qualifier(&self) -> spirv::AccessQualifier {
642        match *self {
643            Self::AccessQualifier(v) => v,
644            ref other => panic!("Expected Operand::AccessQualifier, got {} instead", other),
645        }
646    }
647    pub fn unwrap_host_access_qualifier(&self) -> spirv::HostAccessQualifier {
648        match *self {
649            Self::HostAccessQualifier(v) => v,
650            ref other => panic!(
651                "Expected Operand::HostAccessQualifier, got {} instead",
652                other
653            ),
654        }
655    }
656    pub fn unwrap_function_parameter_attribute(&self) -> spirv::FunctionParameterAttribute {
657        match *self {
658            Self::FunctionParameterAttribute(v) => v,
659            ref other => panic!(
660                "Expected Operand::FunctionParameterAttribute, got {} instead",
661                other
662            ),
663        }
664    }
665    pub fn unwrap_decoration(&self) -> spirv::Decoration {
666        match *self {
667            Self::Decoration(v) => v,
668            ref other => panic!("Expected Operand::Decoration, got {} instead", other),
669        }
670    }
671    pub fn unwrap_built_in(&self) -> spirv::BuiltIn {
672        match *self {
673            Self::BuiltIn(v) => v,
674            ref other => panic!("Expected Operand::BuiltIn, got {} instead", other),
675        }
676    }
677    pub fn unwrap_scope(&self) -> spirv::Scope {
678        match *self {
679            Self::Scope(v) => v,
680            ref other => panic!("Expected Operand::Scope, got {} instead", other),
681        }
682    }
683    pub fn unwrap_group_operation(&self) -> spirv::GroupOperation {
684        match *self {
685            Self::GroupOperation(v) => v,
686            ref other => panic!("Expected Operand::GroupOperation, got {} instead", other),
687        }
688    }
689    pub fn unwrap_kernel_enqueue_flags(&self) -> spirv::KernelEnqueueFlags {
690        match *self {
691            Self::KernelEnqueueFlags(v) => v,
692            ref other => panic!(
693                "Expected Operand::KernelEnqueueFlags, got {} instead",
694                other
695            ),
696        }
697    }
698    pub fn unwrap_capability(&self) -> spirv::Capability {
699        match *self {
700            Self::Capability(v) => v,
701            ref other => panic!("Expected Operand::Capability, got {} instead", other),
702        }
703    }
704    pub fn unwrap_ray_query_intersection(&self) -> spirv::RayQueryIntersection {
705        match *self {
706            Self::RayQueryIntersection(v) => v,
707            ref other => panic!(
708                "Expected Operand::RayQueryIntersection, got {} instead",
709                other
710            ),
711        }
712    }
713    pub fn unwrap_ray_query_committed_intersection_type(
714        &self,
715    ) -> spirv::RayQueryCommittedIntersectionType {
716        match *self {
717            Self::RayQueryCommittedIntersectionType(v) => v,
718            ref other => panic!(
719                "Expected Operand::RayQueryCommittedIntersectionType, got {} instead",
720                other
721            ),
722        }
723    }
724    pub fn unwrap_ray_query_candidate_intersection_type(
725        &self,
726    ) -> spirv::RayQueryCandidateIntersectionType {
727        match *self {
728            Self::RayQueryCandidateIntersectionType(v) => v,
729            ref other => panic!(
730                "Expected Operand::RayQueryCandidateIntersectionType, got {} instead",
731                other
732            ),
733        }
734    }
735    pub fn unwrap_packed_vector_format(&self) -> spirv::PackedVectorFormat {
736        match *self {
737            Self::PackedVectorFormat(v) => v,
738            ref other => panic!(
739                "Expected Operand::PackedVectorFormat, got {} instead",
740                other
741            ),
742        }
743    }
744    pub fn unwrap_cooperative_matrix_operands(&self) -> spirv::CooperativeMatrixOperands {
745        match *self {
746            Self::CooperativeMatrixOperands(v) => v,
747            ref other => panic!(
748                "Expected Operand::CooperativeMatrixOperands, got {} instead",
749                other
750            ),
751        }
752    }
753    pub fn unwrap_cooperative_matrix_layout(&self) -> spirv::CooperativeMatrixLayout {
754        match *self {
755            Self::CooperativeMatrixLayout(v) => v,
756            ref other => panic!(
757                "Expected Operand::CooperativeMatrixLayout, got {} instead",
758                other
759            ),
760        }
761    }
762    pub fn unwrap_cooperative_matrix_use(&self) -> spirv::CooperativeMatrixUse {
763        match *self {
764            Self::CooperativeMatrixUse(v) => v,
765            ref other => panic!(
766                "Expected Operand::CooperativeMatrixUse, got {} instead",
767                other
768            ),
769        }
770    }
771    pub fn unwrap_cooperative_matrix_reduce(&self) -> spirv::CooperativeMatrixReduce {
772        match *self {
773            Self::CooperativeMatrixReduce(v) => v,
774            ref other => panic!(
775                "Expected Operand::CooperativeMatrixReduce, got {} instead",
776                other
777            ),
778        }
779    }
780    pub fn unwrap_tensor_clamp_mode(&self) -> spirv::TensorClampMode {
781        match *self {
782            Self::TensorClampMode(v) => v,
783            ref other => panic!("Expected Operand::TensorClampMode, got {} instead", other),
784        }
785    }
786    pub fn unwrap_tensor_addressing_operands(&self) -> spirv::TensorAddressingOperands {
787        match *self {
788            Self::TensorAddressingOperands(v) => v,
789            ref other => panic!(
790                "Expected Operand::TensorAddressingOperands, got {} instead",
791                other
792            ),
793        }
794    }
795    pub fn unwrap_initialization_mode_qualifier(&self) -> spirv::InitializationModeQualifier {
796        match *self {
797            Self::InitializationModeQualifier(v) => v,
798            ref other => panic!(
799                "Expected Operand::InitializationModeQualifier, got {} instead",
800                other
801            ),
802        }
803    }
804    pub fn unwrap_load_cache_control(&self) -> spirv::LoadCacheControl {
805        match *self {
806            Self::LoadCacheControl(v) => v,
807            ref other => panic!("Expected Operand::LoadCacheControl, got {} instead", other),
808        }
809    }
810    pub fn unwrap_store_cache_control(&self) -> spirv::StoreCacheControl {
811        match *self {
812            Self::StoreCacheControl(v) => v,
813            ref other => panic!("Expected Operand::StoreCacheControl, got {} instead", other),
814        }
815    }
816    pub fn unwrap_named_maximum_number_of_registers(&self) -> spirv::NamedMaximumNumberOfRegisters {
817        match *self {
818            Self::NamedMaximumNumberOfRegisters(v) => v,
819            ref other => panic!(
820                "Expected Operand::NamedMaximumNumberOfRegisters, got {} instead",
821                other
822            ),
823        }
824    }
825    pub fn unwrap_matrix_multiply_accumulate_operands(
826        &self,
827    ) -> spirv::MatrixMultiplyAccumulateOperands {
828        match *self {
829            Self::MatrixMultiplyAccumulateOperands(v) => v,
830            ref other => panic!(
831                "Expected Operand::MatrixMultiplyAccumulateOperands, got {} instead",
832                other
833            ),
834        }
835    }
836    pub fn unwrap_fp_encoding(&self) -> spirv::FPEncoding {
837        match *self {
838            Self::FPEncoding(v) => v,
839            ref other => panic!("Expected Operand::FPEncoding, got {} instead", other),
840        }
841    }
842    pub fn unwrap_cooperative_vector_matrix_layout(&self) -> spirv::CooperativeVectorMatrixLayout {
843        match *self {
844            Self::CooperativeVectorMatrixLayout(v) => v,
845            ref other => panic!(
846                "Expected Operand::CooperativeVectorMatrixLayout, got {} instead",
847                other
848            ),
849        }
850    }
851    pub fn unwrap_component_type(&self) -> spirv::ComponentType {
852        match *self {
853            Self::ComponentType(v) => v,
854            ref other => panic!("Expected Operand::ComponentType, got {} instead", other),
855        }
856    }
857    pub fn unwrap_tensor_operands(&self) -> spirv::TensorOperands {
858        match *self {
859            Self::TensorOperands(v) => v,
860            ref other => panic!("Expected Operand::TensorOperands, got {} instead", other),
861        }
862    }
863    pub fn unwrap_id_memory_semantics(&self) -> spirv::Word {
864        match *self {
865            Self::IdMemorySemantics(v) => v,
866            ref other => panic!("Expected Operand::IdMemorySemantics, got {} instead", other),
867        }
868    }
869    pub fn unwrap_id_scope(&self) -> spirv::Word {
870        match *self {
871            Self::IdScope(v) => v,
872            ref other => panic!("Expected Operand::IdScope, got {} instead", other),
873        }
874    }
875    pub fn unwrap_id_ref(&self) -> spirv::Word {
876        match *self {
877            Self::IdRef(v) => v,
878            ref other => panic!("Expected Operand::IdRef, got {} instead", other),
879        }
880    }
881    pub fn unwrap_literal_bit32(&self) -> u32 {
882        match *self {
883            Self::LiteralBit32(v) => v,
884            ref other => panic!("Expected Operand::LiteralBit32, got {} instead", other),
885        }
886    }
887    pub fn unwrap_literal_bit64(&self) -> u64 {
888        match *self {
889            Self::LiteralBit64(v) => v,
890            ref other => panic!("Expected Operand::LiteralBit64, got {} instead", other),
891        }
892    }
893    pub fn unwrap_literal_ext_inst_integer(&self) -> u32 {
894        match *self {
895            Self::LiteralExtInstInteger(v) => v,
896            ref other => panic!(
897                "Expected Operand::LiteralExtInstInteger, got {} instead",
898                other
899            ),
900        }
901    }
902    pub fn unwrap_literal_spec_constant_op_integer(&self) -> spirv::Op {
903        match *self {
904            Self::LiteralSpecConstantOpInteger(v) => v,
905            ref other => panic!(
906                "Expected Operand::LiteralSpecConstantOpInteger, got {} instead",
907                other
908            ),
909        }
910    }
911    pub fn unwrap_literal_string(&self) -> &str {
912        match self {
913            Self::LiteralString(v) => v,
914            ref other => panic!("Expected Operand::LiteralString, got {} instead", other),
915        }
916    }
917    pub fn id_ref_any(&self) -> Option<spirv::Word> {
918        match *self {
919            Self::IdRef(v) | Self::IdScope(v) | Self::IdMemorySemantics(v) => Some(v),
920            _ => None,
921        }
922    }
923    pub fn id_ref_any_mut(&mut self) -> Option<&mut spirv::Word> {
924        match self {
925            Self::IdRef(v) | Self::IdScope(v) | Self::IdMemorySemantics(v) => Some(v),
926            _ => None,
927        }
928    }
929    pub fn required_capabilities(&self) -> Vec<spirv::Capability> {
930        use spirv as s;
931        match self {
932            Self::ImageOperands(v) => {
933                let mut result = vec![];
934                if v.intersects(s::ImageOperands::OFFSET | s::ImageOperands::CONST_OFFSETS) {
935                    result.extend_from_slice(&[spirv::Capability::ImageGatherExtended])
936                };
937                if v.intersects(s::ImageOperands::MIN_LOD) {
938                    result.extend_from_slice(&[spirv::Capability::MinLod])
939                };
940                if v.intersects(s::ImageOperands::BIAS) {
941                    result.extend_from_slice(&[spirv::Capability::Shader])
942                };
943                if v.intersects(
944                    s::ImageOperands::MAKE_TEXEL_AVAILABLE
945                        | s::ImageOperands::MAKE_TEXEL_VISIBLE
946                        | s::ImageOperands::NON_PRIVATE_TEXEL
947                        | s::ImageOperands::VOLATILE_TEXEL,
948                ) {
949                    result.extend_from_slice(&[spirv::Capability::VulkanMemoryModel])
950                };
951                result
952            }
953            Self::FPFastMathMode(v) => {
954                let mut result = vec![];
955                if v.intersects(s::FPFastMathMode::ALLOW_TRANSFORM) {
956                    result.extend_from_slice(&[spirv::Capability::FloatControls2])
957                };
958                if v.intersects(
959                    s::FPFastMathMode::ALLOW_CONTRACT | s::FPFastMathMode::ALLOW_REASSOC,
960                ) {
961                    result.extend_from_slice(&[
962                        spirv::Capability::FloatControls2,
963                        spirv::Capability::FPFastMathModeINTEL,
964                    ])
965                };
966                result
967            }
968            Self::LoopControl(v) => {
969                let mut result = vec![];
970                if v.intersects(
971                    s::LoopControl::INITIATION_INTERVAL_ALTERA
972                        | s::LoopControl::MAX_CONCURRENCY_ALTERA
973                        | s::LoopControl::DEPENDENCY_ARRAY_ALTERA
974                        | s::LoopControl::PIPELINE_ENABLE_ALTERA
975                        | s::LoopControl::LOOP_COALESCE_ALTERA
976                        | s::LoopControl::MAX_INTERLEAVING_ALTERA
977                        | s::LoopControl::SPECULATED_ITERATIONS_ALTERA
978                        | s::LoopControl::NO_FUSION_ALTERA
979                        | s::LoopControl::LOOP_COUNT_ALTERA
980                        | s::LoopControl::MAX_REINVOCATION_DELAY_ALTERA,
981                ) {
982                    result.extend_from_slice(&[spirv::Capability::FPGALoopControlsALTERA])
983                };
984                result
985            }
986            Self::FunctionControl(v) => {
987                let mut result = vec![];
988                if v.intersects(s::FunctionControl::OPT_NONE_EXT) {
989                    result.extend_from_slice(&[spirv::Capability::OptNoneEXT])
990                };
991                result
992            }
993            Self::MemorySemantics(v) => {
994                let mut result = vec![];
995                if v.intersects(s::MemorySemantics::ATOMIC_COUNTER_MEMORY) {
996                    result.extend_from_slice(&[spirv::Capability::AtomicStorage])
997                };
998                if v.intersects(s::MemorySemantics::UNIFORM_MEMORY) {
999                    result.extend_from_slice(&[spirv::Capability::Shader])
1000                };
1001                if v.intersects(
1002                    s::MemorySemantics::OUTPUT_MEMORY
1003                        | s::MemorySemantics::MAKE_AVAILABLE
1004                        | s::MemorySemantics::MAKE_VISIBLE
1005                        | s::MemorySemantics::VOLATILE,
1006                ) {
1007                    result.extend_from_slice(&[spirv::Capability::VulkanMemoryModel])
1008                };
1009                result
1010            }
1011            Self::MemoryAccess(v) => {
1012                let mut result = vec![];
1013                if v.intersects(
1014                    s::MemoryAccess::ALIAS_SCOPE_INTEL_MASK | s::MemoryAccess::NO_ALIAS_INTEL_MASK,
1015                ) {
1016                    result.extend_from_slice(&[spirv::Capability::MemoryAccessAliasingINTEL])
1017                };
1018                if v.intersects(
1019                    s::MemoryAccess::MAKE_POINTER_AVAILABLE
1020                        | s::MemoryAccess::MAKE_POINTER_VISIBLE
1021                        | s::MemoryAccess::NON_PRIVATE_POINTER,
1022                ) {
1023                    result.extend_from_slice(&[spirv::Capability::VulkanMemoryModel])
1024                };
1025                result
1026            }
1027            Self::KernelProfilingInfo(v) => {
1028                let mut result = vec![];
1029                if v.intersects(s::KernelProfilingInfo::CMD_EXEC_TIME) {
1030                    result.extend_from_slice(&[spirv::Capability::Kernel])
1031                };
1032                result
1033            }
1034            Self::RayFlags(v) => {
1035                let mut result = vec![];
1036                if v.intersects(
1037                    s::RayFlags::NONE_KHR
1038                        | s::RayFlags::OPAQUE_KHR
1039                        | s::RayFlags::NO_OPAQUE_KHR
1040                        | s::RayFlags::TERMINATE_ON_FIRST_HIT_KHR
1041                        | s::RayFlags::SKIP_CLOSEST_HIT_SHADER_KHR
1042                        | s::RayFlags::CULL_BACK_FACING_TRIANGLES_KHR
1043                        | s::RayFlags::CULL_FRONT_FACING_TRIANGLES_KHR
1044                        | s::RayFlags::CULL_OPAQUE_KHR
1045                        | s::RayFlags::CULL_NO_OPAQUE_KHR,
1046                ) {
1047                    result.extend_from_slice(&[
1048                        spirv::Capability::RayQueryKHR,
1049                        spirv::Capability::RayTracingKHR,
1050                    ])
1051                };
1052                if v.intersects(s::RayFlags::FORCE_OPACITY_MICROMAP2_STATE_EXT) {
1053                    result.extend_from_slice(&[spirv::Capability::RayTracingOpacityMicromapEXT])
1054                };
1055                if v.intersects(s::RayFlags::SKIP_TRIANGLES_KHR | s::RayFlags::SKIP_AAB_BS_KHR) {
1056                    result.extend_from_slice(&[spirv::Capability::RayTraversalPrimitiveCullingKHR])
1057                };
1058                result
1059            }
1060            Self::FragmentShadingRate(v) => {
1061                let mut result = vec![];
1062                if v.intersects(
1063                    s::FragmentShadingRate::VERTICAL2_PIXELS
1064                        | s::FragmentShadingRate::VERTICAL4_PIXELS
1065                        | s::FragmentShadingRate::HORIZONTAL2_PIXELS
1066                        | s::FragmentShadingRate::HORIZONTAL4_PIXELS,
1067                ) {
1068                    result.extend_from_slice(&[spirv::Capability::FragmentShadingRateKHR])
1069                };
1070                result
1071            }
1072            Self::RawAccessChainOperands(v) => {
1073                let mut result = vec![];
1074                if v.intersects(
1075                    s::RawAccessChainOperands::ROBUSTNESS_PER_COMPONENT_NV
1076                        | s::RawAccessChainOperands::ROBUSTNESS_PER_ELEMENT_NV,
1077                ) {
1078                    result.extend_from_slice(&[spirv::Capability::RawAccessChainsNV])
1079                };
1080                result
1081            }
1082            Self::SourceLanguage(v) => match v {
1083                s::SourceLanguage::Unknown
1084                | s::SourceLanguage::ESSL
1085                | s::SourceLanguage::GLSL
1086                | s::SourceLanguage::OpenCL_C
1087                | s::SourceLanguage::OpenCL_CPP
1088                | s::SourceLanguage::HLSL
1089                | s::SourceLanguage::CPP_for_OpenCL
1090                | s::SourceLanguage::SYCL
1091                | s::SourceLanguage::HERO_C
1092                | s::SourceLanguage::NZSL
1093                | s::SourceLanguage::WGSL
1094                | s::SourceLanguage::Slang
1095                | s::SourceLanguage::Zig
1096                | s::SourceLanguage::Rust => vec![],
1097            },
1098            Self::ExecutionModel(v) => match v {
1099                s::ExecutionModel::Geometry => vec![spirv::Capability::Geometry],
1100                s::ExecutionModel::Kernel => vec![spirv::Capability::Kernel],
1101                s::ExecutionModel::TaskEXT | s::ExecutionModel::MeshEXT => {
1102                    vec![spirv::Capability::MeshShadingEXT]
1103                }
1104                s::ExecutionModel::TaskNV | s::ExecutionModel::MeshNV => {
1105                    vec![spirv::Capability::MeshShadingNV]
1106                }
1107                s::ExecutionModel::RayGenerationKHR
1108                | s::ExecutionModel::IntersectionKHR
1109                | s::ExecutionModel::AnyHitKHR
1110                | s::ExecutionModel::ClosestHitKHR
1111                | s::ExecutionModel::MissKHR
1112                | s::ExecutionModel::CallableKHR => vec![
1113                    spirv::Capability::RayTracingNV,
1114                    spirv::Capability::RayTracingKHR,
1115                ],
1116                s::ExecutionModel::Vertex
1117                | s::ExecutionModel::Fragment
1118                | s::ExecutionModel::GLCompute => vec![spirv::Capability::Shader],
1119                s::ExecutionModel::TessellationControl
1120                | s::ExecutionModel::TessellationEvaluation => {
1121                    vec![spirv::Capability::Tessellation]
1122                }
1123            },
1124            Self::AddressingModel(v) => match v {
1125                s::AddressingModel::Logical => vec![],
1126                s::AddressingModel::Physical32 | s::AddressingModel::Physical64 => {
1127                    vec![spirv::Capability::Addresses]
1128                }
1129                s::AddressingModel::PhysicalStorageBuffer64 => {
1130                    vec![spirv::Capability::PhysicalStorageBufferAddresses]
1131                }
1132            },
1133            Self::MemoryModel(v) => match v {
1134                s::MemoryModel::OpenCL => vec![spirv::Capability::Kernel],
1135                s::MemoryModel::Simple | s::MemoryModel::GLSL450 => vec![spirv::Capability::Shader],
1136                s::MemoryModel::Vulkan => vec![spirv::Capability::VulkanMemoryModel],
1137            },
1138            Self::ExecutionMode(v) => match v {
1139                s::ExecutionMode::LocalSize | s::ExecutionMode::LocalSizeId => vec![],
1140                s::ExecutionMode::DerivativeGroupLinearKHR => {
1141                    vec![spirv::Capability::ComputeDerivativeGroupLinearKHR]
1142                }
1143                s::ExecutionMode::DerivativeGroupQuadsKHR => {
1144                    vec![spirv::Capability::ComputeDerivativeGroupQuadsKHR]
1145                }
1146                s::ExecutionMode::DenormFlushToZero => vec![spirv::Capability::DenormFlushToZero],
1147                s::ExecutionMode::DenormPreserve => vec![spirv::Capability::DenormPreserve],
1148                s::ExecutionMode::NumSIMDWorkitemsINTEL
1149                | s::ExecutionMode::SchedulerTargetFmaxMhzINTEL
1150                | s::ExecutionMode::StreamingInterfaceINTEL => {
1151                    vec![spirv::Capability::FPGAKernelAttributesINTEL]
1152                }
1153                s::ExecutionMode::RegisterMapInterfaceINTEL => {
1154                    vec![spirv::Capability::FPGAKernelAttributesv2INTEL]
1155                }
1156                s::ExecutionMode::FPFastMathDefault => vec![spirv::Capability::FloatControls2],
1157                s::ExecutionMode::PixelInterlockOrderedEXT
1158                | s::ExecutionMode::PixelInterlockUnorderedEXT => {
1159                    vec![spirv::Capability::FragmentShaderPixelInterlockEXT]
1160                }
1161                s::ExecutionMode::SampleInterlockOrderedEXT
1162                | s::ExecutionMode::SampleInterlockUnorderedEXT => {
1163                    vec![spirv::Capability::FragmentShaderSampleInterlockEXT]
1164                }
1165                s::ExecutionMode::ShadingRateInterlockOrderedEXT
1166                | s::ExecutionMode::ShadingRateInterlockUnorderedEXT => {
1167                    vec![spirv::Capability::FragmentShaderShadingRateInterlockEXT]
1168                }
1169                s::ExecutionMode::Invocations
1170                | s::ExecutionMode::InputPoints
1171                | s::ExecutionMode::InputLines
1172                | s::ExecutionMode::InputLinesAdjacency
1173                | s::ExecutionMode::InputTrianglesAdjacency
1174                | s::ExecutionMode::OutputLineStrip
1175                | s::ExecutionMode::OutputTriangleStrip => vec![spirv::Capability::Geometry],
1176                s::ExecutionMode::OutputPoints => vec![
1177                    spirv::Capability::Geometry,
1178                    spirv::Capability::MeshShadingNV,
1179                    spirv::Capability::MeshShadingEXT,
1180                ],
1181                s::ExecutionMode::Triangles => {
1182                    vec![spirv::Capability::Geometry, spirv::Capability::Tessellation]
1183                }
1184                s::ExecutionMode::OutputVertices => vec![
1185                    spirv::Capability::Geometry,
1186                    spirv::Capability::Tessellation,
1187                    spirv::Capability::MeshShadingNV,
1188                    spirv::Capability::MeshShadingEXT,
1189                ],
1190                s::ExecutionMode::LocalSizeHint
1191                | s::ExecutionMode::VecTypeHint
1192                | s::ExecutionMode::ContractionOff
1193                | s::ExecutionMode::Initializer
1194                | s::ExecutionMode::Finalizer
1195                | s::ExecutionMode::LocalSizeHintId => vec![spirv::Capability::Kernel],
1196                s::ExecutionMode::MaxWorkgroupSizeINTEL
1197                | s::ExecutionMode::MaxWorkDimINTEL
1198                | s::ExecutionMode::NoGlobalOffsetINTEL => {
1199                    vec![spirv::Capability::KernelAttributesINTEL]
1200                }
1201                s::ExecutionMode::OutputLinesEXT
1202                | s::ExecutionMode::OutputPrimitivesEXT
1203                | s::ExecutionMode::OutputTrianglesEXT => vec![
1204                    spirv::Capability::MeshShadingNV,
1205                    spirv::Capability::MeshShadingEXT,
1206                ],
1207                s::ExecutionMode::QuadDerivativesKHR | s::ExecutionMode::RequireFullQuadsKHR => {
1208                    vec![spirv::Capability::QuadControlKHR]
1209                }
1210                s::ExecutionMode::MaximumRegistersINTEL
1211                | s::ExecutionMode::MaximumRegistersIdINTEL
1212                | s::ExecutionMode::NamedMaximumRegistersINTEL => {
1213                    vec![spirv::Capability::RegisterLimitsINTEL]
1214                }
1215                s::ExecutionMode::RoundingModeRTPINTEL
1216                | s::ExecutionMode::RoundingModeRTNINTEL
1217                | s::ExecutionMode::FloatingPointModeALTINTEL
1218                | s::ExecutionMode::FloatingPointModeIEEEINTEL => {
1219                    vec![spirv::Capability::RoundToInfinityINTEL]
1220                }
1221                s::ExecutionMode::RoundingModeRTE => vec![spirv::Capability::RoundingModeRTE],
1222                s::ExecutionMode::RoundingModeRTZ => vec![spirv::Capability::RoundingModeRTZ],
1223                s::ExecutionMode::PostDepthCoverage => {
1224                    vec![spirv::Capability::SampleMaskPostDepthCoverage]
1225                }
1226                s::ExecutionMode::PixelCenterInteger
1227                | s::ExecutionMode::OriginUpperLeft
1228                | s::ExecutionMode::OriginLowerLeft
1229                | s::ExecutionMode::EarlyFragmentTests
1230                | s::ExecutionMode::DepthReplacing
1231                | s::ExecutionMode::DepthGreater
1232                | s::ExecutionMode::DepthLess
1233                | s::ExecutionMode::DepthUnchanged
1234                | s::ExecutionMode::SubgroupUniformControlFlowKHR
1235                | s::ExecutionMode::EarlyAndLateFragmentTestsAMD
1236                | s::ExecutionMode::MaximallyReconvergesKHR => vec![spirv::Capability::Shader],
1237                s::ExecutionMode::Shader64BitIndexingEXT => {
1238                    vec![spirv::Capability::Shader64BitIndexingEXT]
1239                }
1240                s::ExecutionMode::CoalescingAMDX
1241                | s::ExecutionMode::IsApiEntryAMDX
1242                | s::ExecutionMode::MaxNodeRecursionAMDX
1243                | s::ExecutionMode::StaticNumWorkgroupsAMDX
1244                | s::ExecutionMode::ShaderIndexAMDX
1245                | s::ExecutionMode::MaxNumWorkgroupsAMDX
1246                | s::ExecutionMode::SharesInputWithAMDX => {
1247                    vec![spirv::Capability::ShaderEnqueueAMDX]
1248                }
1249                s::ExecutionMode::SignedZeroInfNanPreserve => {
1250                    vec![spirv::Capability::SignedZeroInfNanPreserve]
1251                }
1252                s::ExecutionMode::StencilRefReplacingEXT
1253                | s::ExecutionMode::StencilRefUnchangedFrontAMD
1254                | s::ExecutionMode::StencilRefGreaterFrontAMD
1255                | s::ExecutionMode::StencilRefLessFrontAMD
1256                | s::ExecutionMode::StencilRefUnchangedBackAMD
1257                | s::ExecutionMode::StencilRefGreaterBackAMD
1258                | s::ExecutionMode::StencilRefLessBackAMD => {
1259                    vec![spirv::Capability::StencilExportEXT]
1260                }
1261                s::ExecutionMode::SubgroupSize
1262                | s::ExecutionMode::SubgroupsPerWorkgroup
1263                | s::ExecutionMode::SubgroupsPerWorkgroupId => {
1264                    vec![spirv::Capability::SubgroupDispatch]
1265                }
1266                s::ExecutionMode::SpacingEqual
1267                | s::ExecutionMode::SpacingFractionalEven
1268                | s::ExecutionMode::SpacingFractionalOdd
1269                | s::ExecutionMode::VertexOrderCw
1270                | s::ExecutionMode::VertexOrderCcw
1271                | s::ExecutionMode::PointMode
1272                | s::ExecutionMode::Quads
1273                | s::ExecutionMode::Isolines => vec![spirv::Capability::Tessellation],
1274                s::ExecutionMode::NonCoherentColorAttachmentReadEXT => {
1275                    vec![spirv::Capability::TileImageColorReadAccessEXT]
1276                }
1277                s::ExecutionMode::NonCoherentDepthAttachmentReadEXT => {
1278                    vec![spirv::Capability::TileImageDepthReadAccessEXT]
1279                }
1280                s::ExecutionMode::NonCoherentStencilAttachmentReadEXT => {
1281                    vec![spirv::Capability::TileImageStencilReadAccessEXT]
1282                }
1283                s::ExecutionMode::NonCoherentTileAttachmentReadQCOM
1284                | s::ExecutionMode::TileShadingRateQCOM => vec![spirv::Capability::TileShadingQCOM],
1285                s::ExecutionMode::Xfb => vec![spirv::Capability::TransformFeedback],
1286                s::ExecutionMode::SharedLocalMemorySizeINTEL
1287                | s::ExecutionMode::NamedBarrierCountINTEL => {
1288                    vec![spirv::Capability::VectorComputeINTEL]
1289                }
1290            },
1291            Self::StorageClass(v) => match v {
1292                s::StorageClass::UniformConstant
1293                | s::StorageClass::Input
1294                | s::StorageClass::Workgroup
1295                | s::StorageClass::CrossWorkgroup
1296                | s::StorageClass::Function
1297                | s::StorageClass::Image => vec![],
1298                s::StorageClass::AtomicCounter => vec![spirv::Capability::AtomicStorage],
1299                s::StorageClass::CodeSectionINTEL => vec![spirv::Capability::FunctionPointersINTEL],
1300                s::StorageClass::Generic => vec![spirv::Capability::GenericPointer],
1301                s::StorageClass::TaskPayloadWorkgroupEXT => vec![spirv::Capability::MeshShadingEXT],
1302                s::StorageClass::PhysicalStorageBuffer => {
1303                    vec![spirv::Capability::PhysicalStorageBufferAddresses]
1304                }
1305                s::StorageClass::CallableDataKHR
1306                | s::StorageClass::IncomingCallableDataKHR
1307                | s::StorageClass::RayPayloadKHR
1308                | s::StorageClass::HitAttributeKHR
1309                | s::StorageClass::IncomingRayPayloadKHR
1310                | s::StorageClass::ShaderRecordBufferKHR => vec![
1311                    spirv::Capability::RayTracingNV,
1312                    spirv::Capability::RayTracingKHR,
1313                ],
1314                s::StorageClass::Uniform
1315                | s::StorageClass::Output
1316                | s::StorageClass::PushConstant
1317                | s::StorageClass::StorageBuffer => vec![spirv::Capability::Shader],
1318                s::StorageClass::Private => vec![
1319                    spirv::Capability::Shader,
1320                    spirv::Capability::VectorComputeINTEL,
1321                ],
1322                s::StorageClass::NodePayloadAMDX => vec![spirv::Capability::ShaderEnqueueAMDX],
1323                s::StorageClass::HitObjectAttributeEXT => {
1324                    vec![spirv::Capability::ShaderInvocationReorderEXT]
1325                }
1326                s::StorageClass::HitObjectAttributeNV => {
1327                    vec![spirv::Capability::ShaderInvocationReorderNV]
1328                }
1329                s::StorageClass::TileImageEXT => {
1330                    vec![spirv::Capability::TileImageColorReadAccessEXT]
1331                }
1332                s::StorageClass::TileAttachmentQCOM => vec![spirv::Capability::TileShadingQCOM],
1333                s::StorageClass::DeviceOnlyALTERA | s::StorageClass::HostOnlyALTERA => {
1334                    vec![spirv::Capability::USMStorageClassesALTERA]
1335                }
1336            },
1337            Self::Dim(v) => match v {
1338                s::Dim::Dim2D | s::Dim::Dim3D => vec![],
1339                s::Dim::DimSubpassData => vec![spirv::Capability::InputAttachment],
1340                s::Dim::Dim1D => vec![spirv::Capability::Sampled1D],
1341                s::Dim::DimBuffer => vec![spirv::Capability::SampledBuffer],
1342                s::Dim::DimRect => vec![spirv::Capability::SampledRect],
1343                s::Dim::DimCube => vec![spirv::Capability::Shader],
1344                s::Dim::DimTileImageDataEXT => vec![spirv::Capability::TileImageColorReadAccessEXT],
1345            },
1346            Self::SamplerAddressingMode(v) => match v {
1347                s::SamplerAddressingMode::None
1348                | s::SamplerAddressingMode::ClampToEdge
1349                | s::SamplerAddressingMode::Clamp
1350                | s::SamplerAddressingMode::Repeat
1351                | s::SamplerAddressingMode::RepeatMirrored => vec![],
1352            },
1353            Self::SamplerFilterMode(v) => match v {
1354                s::SamplerFilterMode::Nearest | s::SamplerFilterMode::Linear => vec![],
1355            },
1356            Self::ImageFormat(v) => match v {
1357                s::ImageFormat::Unknown => vec![],
1358                s::ImageFormat::R64ui | s::ImageFormat::R64i => {
1359                    vec![spirv::Capability::Int64ImageEXT]
1360                }
1361                s::ImageFormat::Rgba32f
1362                | s::ImageFormat::Rgba16f
1363                | s::ImageFormat::R32f
1364                | s::ImageFormat::Rgba8
1365                | s::ImageFormat::Rgba8Snorm
1366                | s::ImageFormat::Rgba32i
1367                | s::ImageFormat::Rgba16i
1368                | s::ImageFormat::Rgba8i
1369                | s::ImageFormat::R32i
1370                | s::ImageFormat::Rgba32ui
1371                | s::ImageFormat::Rgba16ui
1372                | s::ImageFormat::Rgba8ui
1373                | s::ImageFormat::R32ui => vec![spirv::Capability::Shader],
1374                s::ImageFormat::Rg32f
1375                | s::ImageFormat::Rg16f
1376                | s::ImageFormat::R11fG11fB10f
1377                | s::ImageFormat::R16f
1378                | s::ImageFormat::Rgba16
1379                | s::ImageFormat::Rgb10A2
1380                | s::ImageFormat::Rg16
1381                | s::ImageFormat::Rg8
1382                | s::ImageFormat::R16
1383                | s::ImageFormat::R8
1384                | s::ImageFormat::Rgba16Snorm
1385                | s::ImageFormat::Rg16Snorm
1386                | s::ImageFormat::Rg8Snorm
1387                | s::ImageFormat::R16Snorm
1388                | s::ImageFormat::R8Snorm
1389                | s::ImageFormat::Rg32i
1390                | s::ImageFormat::Rg16i
1391                | s::ImageFormat::Rg8i
1392                | s::ImageFormat::R16i
1393                | s::ImageFormat::R8i
1394                | s::ImageFormat::Rgb10a2ui
1395                | s::ImageFormat::Rg32ui
1396                | s::ImageFormat::Rg16ui
1397                | s::ImageFormat::Rg8ui
1398                | s::ImageFormat::R16ui
1399                | s::ImageFormat::R8ui => vec![spirv::Capability::StorageImageExtendedFormats],
1400            },
1401            Self::ImageChannelOrder(v) => match v {
1402                s::ImageChannelOrder::R
1403                | s::ImageChannelOrder::A
1404                | s::ImageChannelOrder::RG
1405                | s::ImageChannelOrder::RA
1406                | s::ImageChannelOrder::RGB
1407                | s::ImageChannelOrder::RGBA
1408                | s::ImageChannelOrder::BGRA
1409                | s::ImageChannelOrder::ARGB
1410                | s::ImageChannelOrder::Intensity
1411                | s::ImageChannelOrder::Luminance
1412                | s::ImageChannelOrder::Rx
1413                | s::ImageChannelOrder::RGx
1414                | s::ImageChannelOrder::RGBx
1415                | s::ImageChannelOrder::Depth
1416                | s::ImageChannelOrder::DepthStencil
1417                | s::ImageChannelOrder::sRGB
1418                | s::ImageChannelOrder::sRGBx
1419                | s::ImageChannelOrder::sRGBA
1420                | s::ImageChannelOrder::sBGRA
1421                | s::ImageChannelOrder::ABGR => vec![],
1422            },
1423            Self::ImageChannelDataType(v) => match v {
1424                s::ImageChannelDataType::SnormInt8
1425                | s::ImageChannelDataType::SnormInt16
1426                | s::ImageChannelDataType::UnormInt8
1427                | s::ImageChannelDataType::UnormInt16
1428                | s::ImageChannelDataType::UnormShort565
1429                | s::ImageChannelDataType::UnormShort555
1430                | s::ImageChannelDataType::UnormInt101010
1431                | s::ImageChannelDataType::SignedInt8
1432                | s::ImageChannelDataType::SignedInt16
1433                | s::ImageChannelDataType::SignedInt32
1434                | s::ImageChannelDataType::UnsignedInt8
1435                | s::ImageChannelDataType::UnsignedInt16
1436                | s::ImageChannelDataType::UnsignedInt32
1437                | s::ImageChannelDataType::HalfFloat
1438                | s::ImageChannelDataType::Float
1439                | s::ImageChannelDataType::UnormInt24
1440                | s::ImageChannelDataType::UnormInt101010_2
1441                | s::ImageChannelDataType::UnormInt10X6EXT
1442                | s::ImageChannelDataType::UnsignedIntRaw10EXT
1443                | s::ImageChannelDataType::UnsignedIntRaw12EXT
1444                | s::ImageChannelDataType::UnormInt2_101010EXT
1445                | s::ImageChannelDataType::UnsignedInt10X6EXT
1446                | s::ImageChannelDataType::UnsignedInt12X4EXT
1447                | s::ImageChannelDataType::UnsignedInt14X2EXT
1448                | s::ImageChannelDataType::UnormInt12X4EXT
1449                | s::ImageChannelDataType::UnormInt14X2EXT => vec![],
1450            },
1451            Self::FPRoundingMode(v) => match v {
1452                s::FPRoundingMode::RTE
1453                | s::FPRoundingMode::RTZ
1454                | s::FPRoundingMode::RTP
1455                | s::FPRoundingMode::RTN => vec![],
1456            },
1457            Self::FPDenormMode(v) => match v {
1458                s::FPDenormMode::Preserve | s::FPDenormMode::FlushToZero => {
1459                    vec![spirv::Capability::FunctionFloatControlINTEL]
1460                }
1461            },
1462            Self::QuantizationModes(v) => match v {
1463                s::QuantizationModes::TRN
1464                | s::QuantizationModes::TRN_ZERO
1465                | s::QuantizationModes::RND
1466                | s::QuantizationModes::RND_ZERO
1467                | s::QuantizationModes::RND_INF
1468                | s::QuantizationModes::RND_MIN_INF
1469                | s::QuantizationModes::RND_CONV
1470                | s::QuantizationModes::RND_CONV_ODD => {
1471                    vec![spirv::Capability::ArbitraryPrecisionFixedPointALTERA]
1472                }
1473            },
1474            Self::FPOperationMode(v) => match v {
1475                s::FPOperationMode::IEEE | s::FPOperationMode::ALT => {
1476                    vec![spirv::Capability::FunctionFloatControlINTEL]
1477                }
1478            },
1479            Self::OverflowModes(v) => match v {
1480                s::OverflowModes::WRAP
1481                | s::OverflowModes::SAT
1482                | s::OverflowModes::SAT_ZERO
1483                | s::OverflowModes::SAT_SYM => {
1484                    vec![spirv::Capability::ArbitraryPrecisionFixedPointALTERA]
1485                }
1486            },
1487            Self::LinkageType(v) => match v {
1488                s::LinkageType::Export | s::LinkageType::Import | s::LinkageType::LinkOnceODR => {
1489                    vec![spirv::Capability::Linkage]
1490                }
1491            },
1492            Self::AccessQualifier(v) => match v {
1493                s::AccessQualifier::ReadOnly
1494                | s::AccessQualifier::WriteOnly
1495                | s::AccessQualifier::ReadWrite => vec![spirv::Capability::Kernel],
1496            },
1497            Self::HostAccessQualifier(v) => match v {
1498                s::HostAccessQualifier::NoneINTEL
1499                | s::HostAccessQualifier::ReadINTEL
1500                | s::HostAccessQualifier::WriteINTEL
1501                | s::HostAccessQualifier::ReadWriteINTEL => {
1502                    vec![spirv::Capability::GlobalVariableHostAccessINTEL]
1503                }
1504            },
1505            Self::FunctionParameterAttribute(v) => match v {
1506                s::FunctionParameterAttribute::Zext
1507                | s::FunctionParameterAttribute::Sext
1508                | s::FunctionParameterAttribute::ByVal
1509                | s::FunctionParameterAttribute::Sret
1510                | s::FunctionParameterAttribute::NoAlias
1511                | s::FunctionParameterAttribute::NoCapture
1512                | s::FunctionParameterAttribute::NoWrite
1513                | s::FunctionParameterAttribute::NoReadWrite => vec![spirv::Capability::Kernel],
1514                s::FunctionParameterAttribute::RuntimeAlignedALTERA => {
1515                    vec![spirv::Capability::RuntimeAlignedAttributeALTERA]
1516                }
1517            },
1518            Self::Decoration(v) => match v {
1519                s::Decoration::BuiltIn
1520                | s::Decoration::Restrict
1521                | s::Decoration::Aliased
1522                | s::Decoration::Volatile
1523                | s::Decoration::Coherent
1524                | s::Decoration::NonWritable
1525                | s::Decoration::NonReadable
1526                | s::Decoration::FPRoundingMode
1527                | s::Decoration::NoSignedWrap
1528                | s::Decoration::NoUnsignedWrap
1529                | s::Decoration::WeightTextureQCOM
1530                | s::Decoration::BlockMatchTextureQCOM
1531                | s::Decoration::BlockMatchSamplerQCOM
1532                | s::Decoration::ExplicitInterpAMD
1533                | s::Decoration::CounterBuffer
1534                | s::Decoration::UserSemantic
1535                | s::Decoration::UserTypeGOOGLE => vec![],
1536                s::Decoration::MaxByteOffset | s::Decoration::MaxByteOffsetId => {
1537                    vec![spirv::Capability::Addresses]
1538                }
1539                s::Decoration::ClobberINTEL | s::Decoration::SideEffectsINTEL => {
1540                    vec![spirv::Capability::AsmINTEL]
1541                }
1542                s::Decoration::BindlessSamplerNV
1543                | s::Decoration::BindlessImageNV
1544                | s::Decoration::BoundSamplerNV
1545                | s::Decoration::BoundImageNV => vec![spirv::Capability::BindlessTextureNV],
1546                s::Decoration::CacheControlLoadINTEL | s::Decoration::CacheControlStoreINTEL => {
1547                    vec![spirv::Capability::CacheControlsINTEL]
1548                }
1549                s::Decoration::ArrayStrideIdEXT | s::Decoration::OffsetIdEXT => {
1550                    vec![spirv::Capability::DescriptorHeapEXT]
1551                }
1552                s::Decoration::ConduitKernelArgumentALTERA
1553                | s::Decoration::RegisterMapKernelArgumentALTERA
1554                | s::Decoration::MMHostInterfaceAddressWidthALTERA
1555                | s::Decoration::MMHostInterfaceDataWidthALTERA
1556                | s::Decoration::MMHostInterfaceLatencyALTERA
1557                | s::Decoration::MMHostInterfaceReadWriteModeALTERA
1558                | s::Decoration::MMHostInterfaceMaxBurstALTERA
1559                | s::Decoration::MMHostInterfaceWaitRequestALTERA
1560                | s::Decoration::StableKernelArgumentALTERA => {
1561                    vec![spirv::Capability::FPGAArgumentInterfacesALTERA]
1562                }
1563                s::Decoration::BufferLocationALTERA => {
1564                    vec![spirv::Capability::FPGABufferLocationALTERA]
1565                }
1566                s::Decoration::StallEnableALTERA => {
1567                    vec![spirv::Capability::FPGAClusterAttributesALTERA]
1568                }
1569                s::Decoration::StallFreeALTERA => {
1570                    vec![spirv::Capability::FPGAClusterAttributesV2ALTERA]
1571                }
1572                s::Decoration::MathOpDSPModeALTERA => vec![spirv::Capability::FPGADSPControlALTERA],
1573                s::Decoration::InitiationIntervalALTERA
1574                | s::Decoration::MaxConcurrencyALTERA
1575                | s::Decoration::PipelineEnableALTERA => {
1576                    vec![spirv::Capability::FPGAInvocationPipeliningAttributesALTERA]
1577                }
1578                s::Decoration::LatencyControlLabelALTERA
1579                | s::Decoration::LatencyControlConstraintALTERA => {
1580                    vec![spirv::Capability::FPGALatencyControlALTERA]
1581                }
1582                s::Decoration::BurstCoalesceALTERA
1583                | s::Decoration::CacheSizeALTERA
1584                | s::Decoration::DontStaticallyCoalesceALTERA
1585                | s::Decoration::PrefetchALTERA => {
1586                    vec![spirv::Capability::FPGAMemoryAccessesALTERA]
1587                }
1588                s::Decoration::RegisterALTERA
1589                | s::Decoration::MemoryALTERA
1590                | s::Decoration::NumbanksALTERA
1591                | s::Decoration::BankwidthALTERA
1592                | s::Decoration::MaxPrivateCopiesALTERA
1593                | s::Decoration::SinglepumpALTERA
1594                | s::Decoration::DoublepumpALTERA
1595                | s::Decoration::MaxReplicatesALTERA
1596                | s::Decoration::SimpleDualPortALTERA
1597                | s::Decoration::MergeALTERA
1598                | s::Decoration::BankBitsALTERA
1599                | s::Decoration::ForcePow2DepthALTERA
1600                | s::Decoration::StridesizeALTERA
1601                | s::Decoration::WordsizeALTERA
1602                | s::Decoration::TrueDualPortALTERA => {
1603                    vec![spirv::Capability::FPGAMemoryAttributesALTERA]
1604                }
1605                s::Decoration::FPMaxErrorDecorationINTEL => {
1606                    vec![spirv::Capability::FPMaxErrorINTEL]
1607                }
1608                s::Decoration::SaturatedToLargestFloat8NormalConversionEXT => {
1609                    vec![spirv::Capability::Float8EXT]
1610                }
1611                s::Decoration::PerVertexKHR => vec![spirv::Capability::FragmentBarycentricKHR],
1612                s::Decoration::FunctionRoundingModeINTEL
1613                | s::Decoration::FunctionDenormModeINTEL
1614                | s::Decoration::FunctionFloatingPointModeINTEL => {
1615                    vec![spirv::Capability::FunctionFloatControlINTEL]
1616                }
1617                s::Decoration::PassthroughNV => {
1618                    vec![spirv::Capability::GeometryShaderPassthroughNV]
1619                }
1620                s::Decoration::Stream => vec![spirv::Capability::GeometryStreams],
1621                s::Decoration::InitModeALTERA | s::Decoration::ImplementInRegisterMapALTERA => {
1622                    vec![spirv::Capability::GlobalVariableFPGADecorationsALTERA]
1623                }
1624                s::Decoration::HostAccessINTEL => {
1625                    vec![spirv::Capability::GlobalVariableHostAccessINTEL]
1626                }
1627                s::Decoration::IOPipeStorageALTERA => vec![spirv::Capability::IOPipesALTERA],
1628                s::Decoration::ReferencedIndirectlyINTEL => {
1629                    vec![spirv::Capability::IndirectReferencesINTEL]
1630                }
1631                s::Decoration::InputAttachmentIndex => vec![spirv::Capability::InputAttachment],
1632                s::Decoration::CPacked
1633                | s::Decoration::Constant
1634                | s::Decoration::SaturatedConversion
1635                | s::Decoration::FuncParamAttr
1636                | s::Decoration::Alignment
1637                | s::Decoration::AlignmentId => vec![spirv::Capability::Kernel],
1638                s::Decoration::FPFastMathMode => {
1639                    vec![spirv::Capability::Kernel, spirv::Capability::FloatControls2]
1640                }
1641                s::Decoration::LinkageAttributes => vec![spirv::Capability::Linkage],
1642                s::Decoration::FuseLoopsInFunctionALTERA => vec![spirv::Capability::LoopFuseALTERA],
1643                s::Decoration::RowMajor | s::Decoration::ColMajor | s::Decoration::MatrixStride => {
1644                    vec![spirv::Capability::Matrix]
1645                }
1646                s::Decoration::AliasScopeINTEL | s::Decoration::NoAliasINTEL => {
1647                    vec![spirv::Capability::MemoryAccessAliasingINTEL]
1648                }
1649                s::Decoration::PerViewNV | s::Decoration::PerTaskNV => {
1650                    vec![spirv::Capability::MeshShadingNV]
1651                }
1652                s::Decoration::PerPrimitiveEXT => vec![
1653                    spirv::Capability::MeshShadingNV,
1654                    spirv::Capability::MeshShadingEXT,
1655                ],
1656                s::Decoration::RestrictPointer | s::Decoration::AliasedPointer => {
1657                    vec![spirv::Capability::PhysicalStorageBufferAddresses]
1658                }
1659                s::Decoration::MemberOffsetNV | s::Decoration::BankNV => {
1660                    vec![spirv::Capability::PushConstantBanksNV]
1661                }
1662                s::Decoration::OverrideCoverageNV => {
1663                    vec![spirv::Capability::SampleMaskOverrideCoverageNV]
1664                }
1665                s::Decoration::Sample => vec![spirv::Capability::SampleRateShading],
1666                s::Decoration::RelaxedPrecision
1667                | s::Decoration::Block
1668                | s::Decoration::BufferBlock
1669                | s::Decoration::ArrayStride
1670                | s::Decoration::GLSLShared
1671                | s::Decoration::GLSLPacked
1672                | s::Decoration::NoPerspective
1673                | s::Decoration::Flat
1674                | s::Decoration::Centroid
1675                | s::Decoration::Invariant
1676                | s::Decoration::Location
1677                | s::Decoration::Component
1678                | s::Decoration::Index
1679                | s::Decoration::Binding
1680                | s::Decoration::DescriptorSet
1681                | s::Decoration::Offset
1682                | s::Decoration::NoContraction => vec![spirv::Capability::Shader],
1683                s::Decoration::SpecId => vec![spirv::Capability::Shader, spirv::Capability::Kernel],
1684                s::Decoration::Uniform | s::Decoration::UniformId => vec![
1685                    spirv::Capability::Shader,
1686                    spirv::Capability::UniformDecoration,
1687                ],
1688                s::Decoration::NodeSharesPayloadLimitsWithAMDX
1689                | s::Decoration::NodeMaxPayloadsAMDX
1690                | s::Decoration::TrackFinishWritingAMDX
1691                | s::Decoration::PayloadNodeNameAMDX
1692                | s::Decoration::PayloadNodeBaseIndexAMDX
1693                | s::Decoration::PayloadNodeSparseArrayAMDX
1694                | s::Decoration::PayloadNodeArraySizeAMDX
1695                | s::Decoration::PayloadDispatchIndirectAMDX => {
1696                    vec![spirv::Capability::ShaderEnqueueAMDX]
1697                }
1698                s::Decoration::HitObjectShaderRecordBufferEXT => {
1699                    vec![spirv::Capability::ShaderInvocationReorderEXT]
1700                }
1701                s::Decoration::HitObjectShaderRecordBufferNV => {
1702                    vec![spirv::Capability::ShaderInvocationReorderNV]
1703                }
1704                s::Decoration::NonUniform => vec![spirv::Capability::ShaderNonUniform],
1705                s::Decoration::SecondaryViewportRelativeNV => {
1706                    vec![spirv::Capability::ShaderStereoViewNV]
1707                }
1708                s::Decoration::ViewportRelativeNV => vec![spirv::Capability::ShaderViewportMaskNV],
1709                s::Decoration::ConditionalINTEL => vec![spirv::Capability::SpecConditionalINTEL],
1710                s::Decoration::Patch => vec![spirv::Capability::Tessellation],
1711                s::Decoration::XfbBuffer | s::Decoration::XfbStride => {
1712                    vec![spirv::Capability::TransformFeedback]
1713                }
1714                s::Decoration::SIMTCallINTEL
1715                | s::Decoration::VectorComputeVariableINTEL
1716                | s::Decoration::FuncParamIOKindINTEL
1717                | s::Decoration::VectorComputeFunctionINTEL
1718                | s::Decoration::StackCallINTEL
1719                | s::Decoration::GlobalVariableOffsetINTEL
1720                | s::Decoration::SingleElementVectorINTEL
1721                | s::Decoration::VectorComputeCallableFunctionINTEL
1722                | s::Decoration::MediaBlockIOINTEL => vec![spirv::Capability::VectorComputeINTEL],
1723            },
1724            Self::BuiltIn(v) => match v {
1725                s::BuiltIn::NumWorkgroups
1726                | s::BuiltIn::WorkgroupSize
1727                | s::BuiltIn::WorkgroupId
1728                | s::BuiltIn::LocalInvocationId
1729                | s::BuiltIn::GlobalInvocationId
1730                | s::BuiltIn::LocalInvocationIndex
1731                | s::BuiltIn::BaryCoordNoPerspAMD
1732                | s::BuiltIn::BaryCoordNoPerspCentroidAMD
1733                | s::BuiltIn::BaryCoordNoPerspSampleAMD
1734                | s::BuiltIn::BaryCoordSmoothAMD
1735                | s::BuiltIn::BaryCoordSmoothCentroidAMD
1736                | s::BuiltIn::BaryCoordSmoothSampleAMD
1737                | s::BuiltIn::BaryCoordPullModelAMD => vec![],
1738                s::BuiltIn::ClipDistance => vec![spirv::Capability::ClipDistance],
1739                s::BuiltIn::CoreIDARM
1740                | s::BuiltIn::CoreCountARM
1741                | s::BuiltIn::CoreMaxIDARM
1742                | s::BuiltIn::WarpIDARM
1743                | s::BuiltIn::WarpMaxIDARM => vec![spirv::Capability::CoreBuiltinsARM],
1744                s::BuiltIn::CullDistance => vec![spirv::Capability::CullDistance],
1745                s::BuiltIn::SamplerHeapEXT | s::BuiltIn::ResourceHeapEXT => {
1746                    vec![spirv::Capability::DescriptorHeapEXT]
1747                }
1748                s::BuiltIn::DeviceIndex => vec![spirv::Capability::DeviceGroup],
1749                s::BuiltIn::BaseVertex | s::BuiltIn::BaseInstance => {
1750                    vec![spirv::Capability::DrawParameters]
1751                }
1752                s::BuiltIn::DrawIndex => vec![
1753                    spirv::Capability::DrawParameters,
1754                    spirv::Capability::MeshShadingNV,
1755                    spirv::Capability::MeshShadingEXT,
1756                ],
1757                s::BuiltIn::BaryCoordKHR | s::BuiltIn::BaryCoordNoPerspKHR => {
1758                    vec![spirv::Capability::FragmentBarycentricKHR]
1759                }
1760                s::BuiltIn::FragSizeEXT | s::BuiltIn::FragInvocationCountEXT => {
1761                    vec![spirv::Capability::FragmentDensityEXT]
1762                }
1763                s::BuiltIn::FullyCoveredEXT => vec![spirv::Capability::FragmentFullyCoveredEXT],
1764                s::BuiltIn::PrimitiveShadingRateKHR | s::BuiltIn::ShadingRateKHR => {
1765                    vec![spirv::Capability::FragmentShadingRateKHR]
1766                }
1767                s::BuiltIn::Layer => vec![
1768                    spirv::Capability::Geometry,
1769                    spirv::Capability::ShaderLayer,
1770                    spirv::Capability::ShaderViewportIndexLayerEXT,
1771                    spirv::Capability::MeshShadingNV,
1772                    spirv::Capability::MeshShadingEXT,
1773                ],
1774                s::BuiltIn::InvocationId => {
1775                    vec![spirv::Capability::Geometry, spirv::Capability::Tessellation]
1776                }
1777                s::BuiltIn::PrimitiveId => vec![
1778                    spirv::Capability::Geometry,
1779                    spirv::Capability::Tessellation,
1780                    spirv::Capability::RayTracingNV,
1781                    spirv::Capability::RayTracingKHR,
1782                    spirv::Capability::MeshShadingNV,
1783                    spirv::Capability::MeshShadingEXT,
1784                ],
1785                s::BuiltIn::WorkDim
1786                | s::BuiltIn::GlobalSize
1787                | s::BuiltIn::EnqueuedWorkgroupSize
1788                | s::BuiltIn::GlobalOffset
1789                | s::BuiltIn::GlobalLinearId
1790                | s::BuiltIn::SubgroupMaxSize
1791                | s::BuiltIn::NumEnqueuedSubgroups => vec![spirv::Capability::Kernel],
1792                s::BuiltIn::NumSubgroups | s::BuiltIn::SubgroupId => vec![
1793                    spirv::Capability::Kernel,
1794                    spirv::Capability::GroupNonUniform,
1795                ],
1796                s::BuiltIn::SubgroupSize | s::BuiltIn::SubgroupLocalInvocationId => vec![
1797                    spirv::Capability::Kernel,
1798                    spirv::Capability::GroupNonUniform,
1799                    spirv::Capability::SubgroupBallotKHR,
1800                ],
1801                s::BuiltIn::PrimitivePointIndicesEXT
1802                | s::BuiltIn::PrimitiveLineIndicesEXT
1803                | s::BuiltIn::PrimitiveTriangleIndicesEXT
1804                | s::BuiltIn::CullPrimitiveEXT => vec![spirv::Capability::MeshShadingEXT],
1805                s::BuiltIn::TaskCountNV
1806                | s::BuiltIn::PrimitiveCountNV
1807                | s::BuiltIn::PrimitiveIndicesNV
1808                | s::BuiltIn::ClipDistancePerViewNV
1809                | s::BuiltIn::CullDistancePerViewNV
1810                | s::BuiltIn::LayerPerViewNV
1811                | s::BuiltIn::MeshViewCountNV
1812                | s::BuiltIn::MeshViewIndicesNV => vec![spirv::Capability::MeshShadingNV],
1813                s::BuiltIn::ViewIndex => vec![spirv::Capability::MultiView],
1814                s::BuiltIn::ViewportIndex => vec![
1815                    spirv::Capability::MultiViewport,
1816                    spirv::Capability::ShaderViewportIndex,
1817                    spirv::Capability::ShaderViewportIndexLayerEXT,
1818                    spirv::Capability::MeshShadingNV,
1819                    spirv::Capability::MeshShadingEXT,
1820                ],
1821                s::BuiltIn::PositionPerViewNV | s::BuiltIn::ViewportMaskPerViewNV => vec![
1822                    spirv::Capability::PerViewAttributesNV,
1823                    spirv::Capability::MeshShadingNV,
1824                ],
1825                s::BuiltIn::CullMaskKHR => vec![spirv::Capability::RayCullMaskKHR],
1826                s::BuiltIn::ClusterIDNV => {
1827                    vec![spirv::Capability::RayTracingClusterAccelerationStructureNV]
1828                }
1829                s::BuiltIn::HitMicroTriangleVertexPositionsNV
1830                | s::BuiltIn::HitMicroTriangleVertexBarycentricsNV
1831                | s::BuiltIn::HitKindFrontFacingMicroTriangleNV
1832                | s::BuiltIn::HitKindBackFacingMicroTriangleNV => {
1833                    vec![spirv::Capability::RayTracingDisplacementMicromapNV]
1834                }
1835                s::BuiltIn::RayGeometryIndexKHR => vec![spirv::Capability::RayTracingKHR],
1836                s::BuiltIn::HitIsLSSNV
1837                | s::BuiltIn::HitLSSPositionsNV
1838                | s::BuiltIn::HitLSSRadiiNV => {
1839                    vec![spirv::Capability::RayTracingLinearSweptSpheresGeometryNV]
1840                }
1841                s::BuiltIn::CurrentRayTimeNV => vec![spirv::Capability::RayTracingMotionBlurNV],
1842                s::BuiltIn::HitTNV => vec![spirv::Capability::RayTracingNV],
1843                s::BuiltIn::LaunchIdKHR
1844                | s::BuiltIn::LaunchSizeKHR
1845                | s::BuiltIn::WorldRayOriginKHR
1846                | s::BuiltIn::WorldRayDirectionKHR
1847                | s::BuiltIn::ObjectRayOriginKHR
1848                | s::BuiltIn::ObjectRayDirectionKHR
1849                | s::BuiltIn::RayTminKHR
1850                | s::BuiltIn::RayTmaxKHR
1851                | s::BuiltIn::InstanceCustomIndexKHR
1852                | s::BuiltIn::ObjectToWorldKHR
1853                | s::BuiltIn::WorldToObjectKHR
1854                | s::BuiltIn::HitKindKHR
1855                | s::BuiltIn::IncomingRayFlagsKHR => vec![
1856                    spirv::Capability::RayTracingNV,
1857                    spirv::Capability::RayTracingKHR,
1858                ],
1859                s::BuiltIn::HitTriangleVertexPositionsKHR => {
1860                    vec![spirv::Capability::RayTracingPositionFetchKHR]
1861                }
1862                s::BuiltIn::HitIsSphereNV
1863                | s::BuiltIn::HitSpherePositionNV
1864                | s::BuiltIn::HitSphereRadiusNV => {
1865                    vec![spirv::Capability::RayTracingSpheresGeometryNV]
1866                }
1867                s::BuiltIn::SampleId | s::BuiltIn::SamplePosition => {
1868                    vec![spirv::Capability::SampleRateShading]
1869                }
1870                s::BuiltIn::Position
1871                | s::BuiltIn::PointSize
1872                | s::BuiltIn::VertexId
1873                | s::BuiltIn::InstanceId
1874                | s::BuiltIn::FragCoord
1875                | s::BuiltIn::PointCoord
1876                | s::BuiltIn::FrontFacing
1877                | s::BuiltIn::SampleMask
1878                | s::BuiltIn::FragDepth
1879                | s::BuiltIn::HelperInvocation
1880                | s::BuiltIn::VertexIndex
1881                | s::BuiltIn::InstanceIndex => vec![spirv::Capability::Shader],
1882                s::BuiltIn::RemainingRecursionLevelsAMDX | s::BuiltIn::ShaderIndexAMDX => {
1883                    vec![spirv::Capability::ShaderEnqueueAMDX]
1884                }
1885                s::BuiltIn::WarpsPerSMNV
1886                | s::BuiltIn::SMCountNV
1887                | s::BuiltIn::WarpIDNV
1888                | s::BuiltIn::SMIDNV => vec![spirv::Capability::ShaderSMBuiltinsNV],
1889                s::BuiltIn::SecondaryPositionNV | s::BuiltIn::SecondaryViewportMaskNV => {
1890                    vec![spirv::Capability::ShaderStereoViewNV]
1891                }
1892                s::BuiltIn::ViewportMaskNV => vec![
1893                    spirv::Capability::ShaderViewportMaskNV,
1894                    spirv::Capability::MeshShadingNV,
1895                ],
1896                s::BuiltIn::FragStencilRefEXT => vec![spirv::Capability::StencilExportEXT],
1897                s::BuiltIn::SubgroupEqMask
1898                | s::BuiltIn::SubgroupGeMask
1899                | s::BuiltIn::SubgroupGtMask
1900                | s::BuiltIn::SubgroupLeMask
1901                | s::BuiltIn::SubgroupLtMask => vec![
1902                    spirv::Capability::SubgroupBallotKHR,
1903                    spirv::Capability::GroupNonUniformBallot,
1904                ],
1905                s::BuiltIn::TessLevelOuter
1906                | s::BuiltIn::TessLevelInner
1907                | s::BuiltIn::TessCoord
1908                | s::BuiltIn::PatchVertices => vec![spirv::Capability::Tessellation],
1909                s::BuiltIn::TileOffsetQCOM
1910                | s::BuiltIn::TileDimensionQCOM
1911                | s::BuiltIn::TileApronSizeQCOM => vec![spirv::Capability::TileShadingQCOM],
1912            },
1913            Self::Scope(v) => match v {
1914                s::Scope::CrossDevice
1915                | s::Scope::Device
1916                | s::Scope::Workgroup
1917                | s::Scope::Subgroup
1918                | s::Scope::Invocation => vec![],
1919                s::Scope::ShaderCallKHR => vec![spirv::Capability::RayTracingKHR],
1920                s::Scope::QueueFamily => vec![spirv::Capability::VulkanMemoryModel],
1921            },
1922            Self::GroupOperation(v) => match v {
1923                s::GroupOperation::ClusteredReduce => {
1924                    vec![spirv::Capability::GroupNonUniformClustered]
1925                }
1926                s::GroupOperation::PartitionedReduceEXT
1927                | s::GroupOperation::PartitionedInclusiveScanEXT
1928                | s::GroupOperation::PartitionedExclusiveScanEXT => {
1929                    vec![spirv::Capability::GroupNonUniformPartitionedEXT]
1930                }
1931                s::GroupOperation::Reduce
1932                | s::GroupOperation::InclusiveScan
1933                | s::GroupOperation::ExclusiveScan => vec![
1934                    spirv::Capability::Kernel,
1935                    spirv::Capability::GroupNonUniformArithmetic,
1936                    spirv::Capability::GroupNonUniformBallot,
1937                ],
1938            },
1939            Self::KernelEnqueueFlags(v) => match v {
1940                s::KernelEnqueueFlags::NoWait
1941                | s::KernelEnqueueFlags::WaitKernel
1942                | s::KernelEnqueueFlags::WaitWorkGroup => vec![spirv::Capability::Kernel],
1943            },
1944            Self::Capability(v) => match v {
1945                s::Capability::Matrix
1946                | s::Capability::Addresses
1947                | s::Capability::Linkage
1948                | s::Capability::Kernel
1949                | s::Capability::Float16
1950                | s::Capability::Float64
1951                | s::Capability::Int64
1952                | s::Capability::Groups
1953                | s::Capability::Int16
1954                | s::Capability::Int8
1955                | s::Capability::Sampled1D
1956                | s::Capability::SampledBuffer
1957                | s::Capability::GroupNonUniform
1958                | s::Capability::ShaderLayer
1959                | s::Capability::ShaderViewportIndex
1960                | s::Capability::UniformDecoration
1961                | s::Capability::CoreBuiltinsARM
1962                | s::Capability::TileImageColorReadAccessEXT
1963                | s::Capability::TileImageDepthReadAccessEXT
1964                | s::Capability::TileImageStencilReadAccessEXT
1965                | s::Capability::TensorsARM
1966                | s::Capability::StorageTensorArrayDynamicIndexingARM
1967                | s::Capability::StorageTensorArrayNonUniformIndexingARM
1968                | s::Capability::GraphARM
1969                | s::Capability::CooperativeMatrixLayoutsARM
1970                | s::Capability::Float8EXT
1971                | s::Capability::SubgroupBallotKHR
1972                | s::Capability::SubgroupVoteKHR
1973                | s::Capability::StorageBuffer16BitAccess
1974                | s::Capability::StoragePushConstant16
1975                | s::Capability::StorageInputOutput16
1976                | s::Capability::DeviceGroup
1977                | s::Capability::SampleMaskPostDepthCoverage
1978                | s::Capability::StorageBuffer8BitAccess
1979                | s::Capability::StoragePushConstant8
1980                | s::Capability::DenormPreserve
1981                | s::Capability::DenormFlushToZero
1982                | s::Capability::SignedZeroInfNanPreserve
1983                | s::Capability::RoundingModeRTE
1984                | s::Capability::RoundingModeRTZ
1985                | s::Capability::UntypedPointersKHR
1986                | s::Capability::TextureSampleWeightedQCOM
1987                | s::Capability::TextureBoxFilterQCOM
1988                | s::Capability::TextureBlockMatchQCOM
1989                | s::Capability::TextureBlockMatch2QCOM
1990                | s::Capability::ShaderClockKHR
1991                | s::Capability::QuadControlKHR
1992                | s::Capability::Int4TypeINTEL
1993                | s::Capability::BFloat16TypeKHR
1994                | s::Capability::ImageFootprintNV
1995                | s::Capability::FragmentBarycentricKHR
1996                | s::Capability::GroupNonUniformPartitionedEXT
1997                | s::Capability::VulkanMemoryModel
1998                | s::Capability::VulkanMemoryModelDeviceScope
1999                | s::Capability::BindlessTextureNV
2000                | s::Capability::CooperativeVectorNV
2001                | s::Capability::AtomicFloat16VectorNV
2002                | s::Capability::RawAccessChainsNV
2003                | s::Capability::RayTracingSpheresGeometryNV
2004                | s::Capability::RayTracingLinearSweptSpheresGeometryNV
2005                | s::Capability::LongVectorEXT
2006                | s::Capability::Shader64BitIndexingEXT
2007                | s::Capability::CooperativeMatrixReductionsNV
2008                | s::Capability::CooperativeMatrixConversionsNV
2009                | s::Capability::CooperativeMatrixPerElementOperationsNV
2010                | s::Capability::CooperativeMatrixTensorAddressingNV
2011                | s::Capability::CooperativeMatrixBlockLoadsNV
2012                | s::Capability::CooperativeVectorTrainingNV
2013                | s::Capability::TensorAddressingNV
2014                | s::Capability::SubgroupShuffleINTEL
2015                | s::Capability::SubgroupBufferBlockIOINTEL
2016                | s::Capability::SubgroupImageBlockIOINTEL
2017                | s::Capability::SubgroupImageMediaBlockIOINTEL
2018                | s::Capability::RoundToInfinityINTEL
2019                | s::Capability::FloatingPointModeINTEL
2020                | s::Capability::IntegerFunctions2INTEL
2021                | s::Capability::FunctionPointersINTEL
2022                | s::Capability::IndirectReferencesINTEL
2023                | s::Capability::AsmINTEL
2024                | s::Capability::AtomicFloat32MinMaxEXT
2025                | s::Capability::AtomicFloat64MinMaxEXT
2026                | s::Capability::AtomicFloat16MinMaxEXT
2027                | s::Capability::VectorAnyINTEL
2028                | s::Capability::ExpectAssumeKHR
2029                | s::Capability::SubgroupAvcMotionEstimationINTEL
2030                | s::Capability::SubgroupAvcMotionEstimationIntraINTEL
2031                | s::Capability::SubgroupAvcMotionEstimationChromaINTEL
2032                | s::Capability::VariableLengthArrayINTEL
2033                | s::Capability::FunctionFloatControlINTEL
2034                | s::Capability::FPGAMemoryAttributesALTERA
2035                | s::Capability::ArbitraryPrecisionIntegersALTERA
2036                | s::Capability::ArbitraryPrecisionFloatingPointALTERA
2037                | s::Capability::UnstructuredLoopControlsINTEL
2038                | s::Capability::FPGALoopControlsALTERA
2039                | s::Capability::KernelAttributesINTEL
2040                | s::Capability::FPGAKernelAttributesINTEL
2041                | s::Capability::FPGAMemoryAccessesALTERA
2042                | s::Capability::FPGAClusterAttributesALTERA
2043                | s::Capability::LoopFuseALTERA
2044                | s::Capability::FPGADSPControlALTERA
2045                | s::Capability::MemoryAccessAliasingINTEL
2046                | s::Capability::FPGAInvocationPipeliningAttributesALTERA
2047                | s::Capability::FPGABufferLocationALTERA
2048                | s::Capability::ArbitraryPrecisionFixedPointALTERA
2049                | s::Capability::USMStorageClassesALTERA
2050                | s::Capability::RuntimeAlignedAttributeALTERA
2051                | s::Capability::IOPipesALTERA
2052                | s::Capability::BlockingPipesALTERA
2053                | s::Capability::FPGARegALTERA
2054                | s::Capability::DotProductInputAll
2055                | s::Capability::DotProductInput4x8BitPacked
2056                | s::Capability::DotProduct
2057                | s::Capability::RayCullMaskKHR
2058                | s::Capability::CooperativeMatrixKHR
2059                | s::Capability::ReplicatedCompositesEXT
2060                | s::Capability::BitInstructions
2061                | s::Capability::FloatControls2
2062                | s::Capability::FMAKHR
2063                | s::Capability::AtomicFloat32AddEXT
2064                | s::Capability::AtomicFloat64AddEXT
2065                | s::Capability::LongCompositesINTEL
2066                | s::Capability::OptNoneEXT
2067                | s::Capability::AtomicFloat16AddEXT
2068                | s::Capability::DebugInfoModuleINTEL
2069                | s::Capability::BFloat16ConversionINTEL
2070                | s::Capability::SplitBarrierINTEL
2071                | s::Capability::ArithmeticFenceEXT
2072                | s::Capability::TaskSequenceALTERA
2073                | s::Capability::FPMaxErrorINTEL
2074                | s::Capability::FPGALatencyControlALTERA
2075                | s::Capability::FPGAArgumentInterfacesALTERA
2076                | s::Capability::GlobalVariableHostAccessINTEL
2077                | s::Capability::GlobalVariableFPGADecorationsALTERA
2078                | s::Capability::SubgroupBufferPrefetchINTEL
2079                | s::Capability::Subgroup2DBlockIOINTEL
2080                | s::Capability::SubgroupMatrixMultiplyAccumulateINTEL
2081                | s::Capability::TernaryBitwiseFunctionINTEL
2082                | s::Capability::SpecConditionalINTEL
2083                | s::Capability::GroupUniformArithmeticKHR
2084                | s::Capability::TensorFloat32RoundingINTEL
2085                | s::Capability::MaskedGatherScatterINTEL
2086                | s::Capability::CacheControlsINTEL
2087                | s::Capability::RegisterLimitsINTEL
2088                | s::Capability::BindlessImagesINTEL => vec![],
2089                s::Capability::GenericPointer => vec![spirv::Capability::Addresses],
2090                s::Capability::AtomicStorageOps => vec![spirv::Capability::AtomicStorage],
2091                s::Capability::BFloat16DotProductKHR => vec![spirv::Capability::BFloat16TypeKHR],
2092                s::Capability::BFloat16CooperativeMatrixKHR => vec![
2093                    spirv::Capability::BFloat16TypeKHR,
2094                    spirv::Capability::CooperativeMatrixKHR,
2095                ],
2096                s::Capability::CooperativeMatrixConversionQCOM => {
2097                    vec![spirv::Capability::CooperativeMatrixKHR]
2098                }
2099                s::Capability::SubgroupDispatch => vec![spirv::Capability::DeviceEnqueue],
2100                s::Capability::FPGAClusterAttributesV2ALTERA => {
2101                    vec![spirv::Capability::FPGAClusterAttributesALTERA]
2102                }
2103                s::Capability::FPGAKernelAttributesv2INTEL => {
2104                    vec![spirv::Capability::FPGAKernelAttributesINTEL]
2105                }
2106                s::Capability::Float8CooperativeMatrixEXT => vec![
2107                    spirv::Capability::Float8EXT,
2108                    spirv::Capability::CooperativeMatrixKHR,
2109                ],
2110                s::Capability::GeometryPointSize
2111                | s::Capability::GeometryStreams
2112                | s::Capability::MultiViewport
2113                | s::Capability::GeometryShaderPassthroughNV => vec![spirv::Capability::Geometry],
2114                s::Capability::GroupNonUniformVote
2115                | s::Capability::GroupNonUniformArithmetic
2116                | s::Capability::GroupNonUniformBallot
2117                | s::Capability::GroupNonUniformShuffle
2118                | s::Capability::GroupNonUniformShuffleRelative
2119                | s::Capability::GroupNonUniformClustered
2120                | s::Capability::GroupNonUniformQuad
2121                | s::Capability::GroupNonUniformRotateKHR => {
2122                    vec![spirv::Capability::GroupNonUniform]
2123                }
2124                s::Capability::ImageReadWrite | s::Capability::ImageMipmap => {
2125                    vec![spirv::Capability::ImageBasic]
2126                }
2127                s::Capability::StorageTexelBufferArrayDynamicIndexing => {
2128                    vec![spirv::Capability::ImageBuffer]
2129                }
2130                s::Capability::StorageTexelBufferArrayNonUniformIndexing => vec![
2131                    spirv::Capability::ImageBuffer,
2132                    spirv::Capability::ShaderNonUniform,
2133                ],
2134                s::Capability::InputAttachmentArrayDynamicIndexing => {
2135                    vec![spirv::Capability::InputAttachment]
2136                }
2137                s::Capability::InputAttachmentArrayNonUniformIndexing => vec![
2138                    spirv::Capability::InputAttachment,
2139                    spirv::Capability::ShaderNonUniform,
2140                ],
2141                s::Capability::Int4CooperativeMatrixINTEL => vec![
2142                    spirv::Capability::Int4TypeINTEL,
2143                    spirv::Capability::CooperativeMatrixKHR,
2144                ],
2145                s::Capability::Int64Atomics => vec![spirv::Capability::Int64],
2146                s::Capability::DotProductInput4x8Bit => vec![spirv::Capability::Int8],
2147                s::Capability::Vector16
2148                | s::Capability::Float16Buffer
2149                | s::Capability::ImageBasic
2150                | s::Capability::Pipes
2151                | s::Capability::DeviceEnqueue
2152                | s::Capability::LiteralSampler
2153                | s::Capability::NamedBarrier
2154                | s::Capability::FPFastMathModeINTEL => vec![spirv::Capability::Kernel],
2155                s::Capability::Shader => vec![spirv::Capability::Matrix],
2156                s::Capability::PerViewAttributesNV => vec![spirv::Capability::MultiView],
2157                s::Capability::ShaderViewportIndexLayerEXT => {
2158                    vec![spirv::Capability::MultiViewport]
2159                }
2160                s::Capability::PipeStorage => vec![spirv::Capability::Pipes],
2161                s::Capability::RayTraversalPrimitiveCullingKHR => vec![
2162                    spirv::Capability::RayQueryKHR,
2163                    spirv::Capability::RayTracingKHR,
2164                ],
2165                s::Capability::ShaderInvocationReorderNV
2166                | s::Capability::ShaderInvocationReorderEXT
2167                | s::Capability::RayTracingDisplacementMicromapNV
2168                | s::Capability::RayTracingClusterAccelerationStructureNV => {
2169                    vec![spirv::Capability::RayTracingKHR]
2170                }
2171                s::Capability::SampleMaskOverrideCoverageNV => {
2172                    vec![spirv::Capability::SampleRateShading]
2173                }
2174                s::Capability::Image1D => vec![spirv::Capability::Sampled1D],
2175                s::Capability::ImageBuffer
2176                | s::Capability::UniformTexelBufferArrayDynamicIndexing => {
2177                    vec![spirv::Capability::SampledBuffer]
2178                }
2179                s::Capability::UniformTexelBufferArrayNonUniformIndexing => vec![
2180                    spirv::Capability::SampledBuffer,
2181                    spirv::Capability::ShaderNonUniform,
2182                ],
2183                s::Capability::ImageCubeArray => vec![spirv::Capability::SampledCubeArray],
2184                s::Capability::ImageRect => vec![spirv::Capability::SampledRect],
2185                s::Capability::Geometry
2186                | s::Capability::Tessellation
2187                | s::Capability::AtomicStorage
2188                | s::Capability::ImageGatherExtended
2189                | s::Capability::StorageImageMultisample
2190                | s::Capability::UniformBufferArrayDynamicIndexing
2191                | s::Capability::SampledImageArrayDynamicIndexing
2192                | s::Capability::StorageBufferArrayDynamicIndexing
2193                | s::Capability::StorageImageArrayDynamicIndexing
2194                | s::Capability::ClipDistance
2195                | s::Capability::CullDistance
2196                | s::Capability::SampleRateShading
2197                | s::Capability::SampledRect
2198                | s::Capability::InputAttachment
2199                | s::Capability::SparseResidency
2200                | s::Capability::MinLod
2201                | s::Capability::SampledCubeArray
2202                | s::Capability::ImageMSArray
2203                | s::Capability::StorageImageExtendedFormats
2204                | s::Capability::ImageQuery
2205                | s::Capability::DerivativeControl
2206                | s::Capability::InterpolationFunction
2207                | s::Capability::TransformFeedback
2208                | s::Capability::StorageImageReadWithoutFormat
2209                | s::Capability::StorageImageWriteWithoutFormat
2210                | s::Capability::FragmentShadingRateKHR
2211                | s::Capability::DrawParameters
2212                | s::Capability::WorkgroupMemoryExplicitLayoutKHR
2213                | s::Capability::MultiView
2214                | s::Capability::VariablePointersStorageBuffer
2215                | s::Capability::RayQueryProvisionalKHR
2216                | s::Capability::RayQueryKHR
2217                | s::Capability::RayTracingKHR
2218                | s::Capability::TileShadingQCOM
2219                | s::Capability::Float16ImageAMD
2220                | s::Capability::ImageGatherBiasLodAMD
2221                | s::Capability::FragmentMaskAMD
2222                | s::Capability::StencilExportEXT
2223                | s::Capability::ImageReadWriteLodAMD
2224                | s::Capability::Int64ImageEXT
2225                | s::Capability::ShaderEnqueueAMDX
2226                | s::Capability::FragmentFullyCoveredEXT
2227                | s::Capability::MeshShadingNV
2228                | s::Capability::MeshShadingEXT
2229                | s::Capability::ComputeDerivativeGroupQuadsKHR
2230                | s::Capability::FragmentDensityEXT
2231                | s::Capability::ShaderNonUniform
2232                | s::Capability::RuntimeDescriptorArray
2233                | s::Capability::RayTracingPositionFetchKHR
2234                | s::Capability::RayTracingNV
2235                | s::Capability::RayTracingMotionBlurNV
2236                | s::Capability::PhysicalStorageBufferAddresses
2237                | s::Capability::ComputeDerivativeGroupLinearKHR
2238                | s::Capability::RayTracingProvisionalKHR
2239                | s::Capability::CooperativeMatrixNV
2240                | s::Capability::FragmentShaderSampleInterlockEXT
2241                | s::Capability::FragmentShaderShadingRateInterlockEXT
2242                | s::Capability::ShaderSMBuiltinsNV
2243                | s::Capability::FragmentShaderPixelInterlockEXT
2244                | s::Capability::DemoteToHelperInvocation
2245                | s::Capability::DisplacementMicromapNV
2246                | s::Capability::RayTracingOpacityMicromapEXT
2247                | s::Capability::RayQueryPositionFetchKHR
2248                | s::Capability::PushConstantBanksNV => vec![spirv::Capability::Shader],
2249                s::Capability::UniformBufferArrayNonUniformIndexing
2250                | s::Capability::SampledImageArrayNonUniformIndexing
2251                | s::Capability::StorageBufferArrayNonUniformIndexing
2252                | s::Capability::StorageImageArrayNonUniformIndexing => {
2253                    vec![spirv::Capability::ShaderNonUniform]
2254                }
2255                s::Capability::ShaderViewportMaskNV => {
2256                    vec![spirv::Capability::ShaderViewportIndexLayerEXT]
2257                }
2258                s::Capability::ShaderStereoViewNV => vec![spirv::Capability::ShaderViewportMaskNV],
2259                s::Capability::FunctionVariantsINTEL => {
2260                    vec![spirv::Capability::SpecConditionalINTEL]
2261                }
2262                s::Capability::UniformAndStorageBuffer16BitAccess => {
2263                    vec![spirv::Capability::StorageBuffer16BitAccess]
2264                }
2265                s::Capability::UniformAndStorageBuffer8BitAccess => {
2266                    vec![spirv::Capability::StorageBuffer8BitAccess]
2267                }
2268                s::Capability::Subgroup2DBlockTransformINTEL
2269                | s::Capability::Subgroup2DBlockTransposeINTEL => {
2270                    vec![spirv::Capability::Subgroup2DBlockIOINTEL]
2271                }
2272                s::Capability::TessellationPointSize => vec![spirv::Capability::Tessellation],
2273                s::Capability::DescriptorHeapEXT => vec![spirv::Capability::UntypedPointersKHR],
2274                s::Capability::UntypedVariableLengthArrayINTEL => vec![
2275                    spirv::Capability::VariableLengthArrayINTEL,
2276                    spirv::Capability::UntypedPointersKHR,
2277                ],
2278                s::Capability::VariablePointers => {
2279                    vec![spirv::Capability::VariablePointersStorageBuffer]
2280                }
2281                s::Capability::VectorComputeINTEL => vec![spirv::Capability::VectorAnyINTEL],
2282                s::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR
2283                | s::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR => {
2284                    vec![spirv::Capability::WorkgroupMemoryExplicitLayoutKHR]
2285                }
2286            },
2287            Self::RayQueryIntersection(v) => match v {
2288                s::RayQueryIntersection::RayQueryCandidateIntersectionKHR
2289                | s::RayQueryIntersection::RayQueryCommittedIntersectionKHR => {
2290                    vec![spirv::Capability::RayQueryKHR]
2291                }
2292            },
2293            Self::RayQueryCommittedIntersectionType(v) => match v {
2294                s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR
2295                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR
2296                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR => {
2297                    vec![spirv::Capability::RayQueryKHR]
2298                }
2299            },
2300            Self::RayQueryCandidateIntersectionType(v) => match v {
2301                s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR
2302                | s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR => {
2303                    vec![spirv::Capability::RayQueryKHR]
2304                }
2305            },
2306            Self::PackedVectorFormat(v) => match v {
2307                s::PackedVectorFormat::PackedVectorFormat4x8Bit => vec![],
2308            },
2309            Self::CooperativeMatrixLayout(v) => match v {
2310                s::CooperativeMatrixLayout::RowMajorKHR
2311                | s::CooperativeMatrixLayout::ColumnMajorKHR => vec![],
2312                s::CooperativeMatrixLayout::RowBlockedInterleavedARM
2313                | s::CooperativeMatrixLayout::ColumnBlockedInterleavedARM => {
2314                    vec![spirv::Capability::CooperativeMatrixLayoutsARM]
2315                }
2316            },
2317            Self::CooperativeMatrixUse(v) => match v {
2318                s::CooperativeMatrixUse::MatrixAKHR
2319                | s::CooperativeMatrixUse::MatrixBKHR
2320                | s::CooperativeMatrixUse::MatrixAccumulatorKHR => vec![],
2321            },
2322            Self::TensorClampMode(v) => match v {
2323                s::TensorClampMode::Undefined
2324                | s::TensorClampMode::Constant
2325                | s::TensorClampMode::ClampToEdge
2326                | s::TensorClampMode::Repeat
2327                | s::TensorClampMode::RepeatMirrored => vec![],
2328            },
2329            Self::TensorAddressingOperands(v) => {
2330                let mut result = vec![];
2331                if v.intersects(s::TensorAddressingOperands::DECODE_FUNC) {
2332                    result.extend_from_slice(&[spirv::Capability::CooperativeMatrixBlockLoadsNV])
2333                };
2334                if v.intersects(s::TensorAddressingOperands::TENSOR_VIEW) {
2335                    result.extend_from_slice(&[
2336                        spirv::Capability::CooperativeMatrixTensorAddressingNV,
2337                    ])
2338                };
2339                result
2340            }
2341            Self::InitializationModeQualifier(v) => match v {
2342                s::InitializationModeQualifier::InitOnDeviceReprogramALTERA
2343                | s::InitializationModeQualifier::InitOnDeviceResetALTERA => {
2344                    vec![spirv::Capability::GlobalVariableFPGADecorationsALTERA]
2345                }
2346            },
2347            Self::LoadCacheControl(v) => match v {
2348                s::LoadCacheControl::UncachedINTEL
2349                | s::LoadCacheControl::CachedINTEL
2350                | s::LoadCacheControl::StreamingINTEL
2351                | s::LoadCacheControl::InvalidateAfterReadINTEL
2352                | s::LoadCacheControl::ConstCachedINTEL => {
2353                    vec![spirv::Capability::CacheControlsINTEL]
2354                }
2355            },
2356            Self::StoreCacheControl(v) => match v {
2357                s::StoreCacheControl::UncachedINTEL
2358                | s::StoreCacheControl::WriteThroughINTEL
2359                | s::StoreCacheControl::WriteBackINTEL
2360                | s::StoreCacheControl::StreamingINTEL => {
2361                    vec![spirv::Capability::CacheControlsINTEL]
2362                }
2363            },
2364            Self::NamedMaximumNumberOfRegisters(v) => match v {
2365                s::NamedMaximumNumberOfRegisters::AutoINTEL => {
2366                    vec![spirv::Capability::RegisterLimitsINTEL]
2367                }
2368            },
2369            Self::FPEncoding(v) => match v {
2370                s::FPEncoding::BFloat16KHR => vec![spirv::Capability::BFloat16TypeKHR],
2371                s::FPEncoding::Float8E4M3EXT | s::FPEncoding::Float8E5M2EXT => {
2372                    vec![spirv::Capability::Float8EXT]
2373                }
2374            },
2375            Self::CooperativeVectorMatrixLayout(v) => match v {
2376                s::CooperativeVectorMatrixLayout::RowMajorNV
2377                | s::CooperativeVectorMatrixLayout::ColumnMajorNV
2378                | s::CooperativeVectorMatrixLayout::InferencingOptimalNV
2379                | s::CooperativeVectorMatrixLayout::TrainingOptimalNV => vec![],
2380            },
2381            Self::ComponentType(v) => match v {
2382                s::ComponentType::Float16NV
2383                | s::ComponentType::Float32NV
2384                | s::ComponentType::Float64NV
2385                | s::ComponentType::SignedInt8NV
2386                | s::ComponentType::SignedInt16NV
2387                | s::ComponentType::SignedInt32NV
2388                | s::ComponentType::SignedInt64NV
2389                | s::ComponentType::UnsignedInt8NV
2390                | s::ComponentType::UnsignedInt16NV
2391                | s::ComponentType::UnsignedInt32NV
2392                | s::ComponentType::UnsignedInt64NV
2393                | s::ComponentType::SignedInt8PackedNV
2394                | s::ComponentType::UnsignedInt8PackedNV
2395                | s::ComponentType::FloatE4M3NV
2396                | s::ComponentType::FloatE5M2NV => vec![],
2397            },
2398            Self::TensorOperands(v) => {
2399                let mut result = vec![];
2400                if v.intersects(
2401                    s::TensorOperands::NONE_ARM
2402                        | s::TensorOperands::NONTEMPORAL_ARM
2403                        | s::TensorOperands::OUT_OF_BOUNDS_VALUE_ARM
2404                        | s::TensorOperands::MAKE_ELEMENT_AVAILABLE_ARM
2405                        | s::TensorOperands::MAKE_ELEMENT_VISIBLE_ARM
2406                        | s::TensorOperands::NON_PRIVATE_ELEMENT_ARM,
2407                ) {
2408                    result.extend_from_slice(&[spirv::Capability::TensorsARM])
2409                };
2410                result
2411            }
2412            _ => vec![],
2413        }
2414    }
2415    pub fn required_extensions(&self) -> Vec<&'static str> {
2416        use spirv as s;
2417        match self {
2418            Self::ImageOperands(v) => {
2419                let mut result = vec![];
2420                if v.intersects(
2421                    s::ImageOperands::MAKE_TEXEL_AVAILABLE
2422                        | s::ImageOperands::MAKE_TEXEL_VISIBLE
2423                        | s::ImageOperands::NON_PRIVATE_TEXEL
2424                        | s::ImageOperands::VOLATILE_TEXEL,
2425                ) {
2426                    result.extend_from_slice(&["SPV_KHR_vulkan_memory_model"])
2427                };
2428                result
2429            }
2430            Self::MemorySemantics(v) => {
2431                let mut result = vec![];
2432                if v.intersects(
2433                    s::MemorySemantics::OUTPUT_MEMORY
2434                        | s::MemorySemantics::MAKE_AVAILABLE
2435                        | s::MemorySemantics::MAKE_VISIBLE
2436                        | s::MemorySemantics::VOLATILE,
2437                ) {
2438                    result.extend_from_slice(&["SPV_KHR_vulkan_memory_model"])
2439                };
2440                result
2441            }
2442            Self::MemoryAccess(v) => {
2443                let mut result = vec![];
2444                if v.intersects(
2445                    s::MemoryAccess::ALIAS_SCOPE_INTEL_MASK | s::MemoryAccess::NO_ALIAS_INTEL_MASK,
2446                ) {
2447                    result.extend_from_slice(&["SPV_INTEL_memory_access_aliasing"])
2448                };
2449                if v.intersects(
2450                    s::MemoryAccess::MAKE_POINTER_AVAILABLE
2451                        | s::MemoryAccess::MAKE_POINTER_VISIBLE
2452                        | s::MemoryAccess::NON_PRIVATE_POINTER,
2453                ) {
2454                    result.extend_from_slice(&["SPV_KHR_vulkan_memory_model"])
2455                };
2456                result
2457            }
2458            Self::SourceLanguage(v) => match v {
2459                s::SourceLanguage::Unknown
2460                | s::SourceLanguage::ESSL
2461                | s::SourceLanguage::GLSL
2462                | s::SourceLanguage::OpenCL_C
2463                | s::SourceLanguage::OpenCL_CPP
2464                | s::SourceLanguage::HLSL
2465                | s::SourceLanguage::CPP_for_OpenCL
2466                | s::SourceLanguage::SYCL
2467                | s::SourceLanguage::HERO_C
2468                | s::SourceLanguage::NZSL
2469                | s::SourceLanguage::WGSL
2470                | s::SourceLanguage::Slang
2471                | s::SourceLanguage::Zig
2472                | s::SourceLanguage::Rust => vec![],
2473            },
2474            Self::ExecutionModel(v) => match v {
2475                s::ExecutionModel::Vertex
2476                | s::ExecutionModel::TessellationControl
2477                | s::ExecutionModel::TessellationEvaluation
2478                | s::ExecutionModel::Geometry
2479                | s::ExecutionModel::Fragment
2480                | s::ExecutionModel::GLCompute
2481                | s::ExecutionModel::Kernel
2482                | s::ExecutionModel::TaskNV
2483                | s::ExecutionModel::MeshNV
2484                | s::ExecutionModel::RayGenerationKHR
2485                | s::ExecutionModel::IntersectionKHR
2486                | s::ExecutionModel::AnyHitKHR
2487                | s::ExecutionModel::ClosestHitKHR
2488                | s::ExecutionModel::MissKHR
2489                | s::ExecutionModel::CallableKHR
2490                | s::ExecutionModel::TaskEXT
2491                | s::ExecutionModel::MeshEXT => vec![],
2492            },
2493            Self::AddressingModel(v) => match v {
2494                s::AddressingModel::Logical
2495                | s::AddressingModel::Physical32
2496                | s::AddressingModel::Physical64 => vec![],
2497                s::AddressingModel::PhysicalStorageBuffer64 => vec![
2498                    "SPV_EXT_physical_storage_buffer",
2499                    "SPV_KHR_physical_storage_buffer",
2500                ],
2501            },
2502            Self::MemoryModel(v) => match v {
2503                s::MemoryModel::Simple | s::MemoryModel::GLSL450 | s::MemoryModel::OpenCL => vec![],
2504                s::MemoryModel::Vulkan => vec!["SPV_KHR_vulkan_memory_model"],
2505            },
2506            Self::ExecutionMode(v) => match v {
2507                s::ExecutionMode::Invocations
2508                | s::ExecutionMode::SpacingEqual
2509                | s::ExecutionMode::SpacingFractionalEven
2510                | s::ExecutionMode::SpacingFractionalOdd
2511                | s::ExecutionMode::VertexOrderCw
2512                | s::ExecutionMode::VertexOrderCcw
2513                | s::ExecutionMode::PixelCenterInteger
2514                | s::ExecutionMode::OriginUpperLeft
2515                | s::ExecutionMode::OriginLowerLeft
2516                | s::ExecutionMode::EarlyFragmentTests
2517                | s::ExecutionMode::PointMode
2518                | s::ExecutionMode::Xfb
2519                | s::ExecutionMode::DepthReplacing
2520                | s::ExecutionMode::DepthGreater
2521                | s::ExecutionMode::DepthLess
2522                | s::ExecutionMode::DepthUnchanged
2523                | s::ExecutionMode::LocalSize
2524                | s::ExecutionMode::LocalSizeHint
2525                | s::ExecutionMode::InputPoints
2526                | s::ExecutionMode::InputLines
2527                | s::ExecutionMode::InputLinesAdjacency
2528                | s::ExecutionMode::Triangles
2529                | s::ExecutionMode::InputTrianglesAdjacency
2530                | s::ExecutionMode::Quads
2531                | s::ExecutionMode::Isolines
2532                | s::ExecutionMode::OutputVertices
2533                | s::ExecutionMode::OutputPoints
2534                | s::ExecutionMode::OutputLineStrip
2535                | s::ExecutionMode::OutputTriangleStrip
2536                | s::ExecutionMode::VecTypeHint
2537                | s::ExecutionMode::ContractionOff
2538                | s::ExecutionMode::Initializer
2539                | s::ExecutionMode::Finalizer
2540                | s::ExecutionMode::SubgroupSize
2541                | s::ExecutionMode::SubgroupsPerWorkgroup
2542                | s::ExecutionMode::SubgroupsPerWorkgroupId
2543                | s::ExecutionMode::LocalSizeId
2544                | s::ExecutionMode::LocalSizeHintId
2545                | s::ExecutionMode::NonCoherentColorAttachmentReadEXT
2546                | s::ExecutionMode::NonCoherentDepthAttachmentReadEXT
2547                | s::ExecutionMode::NonCoherentStencilAttachmentReadEXT
2548                | s::ExecutionMode::NonCoherentTileAttachmentReadQCOM
2549                | s::ExecutionMode::TileShadingRateQCOM
2550                | s::ExecutionMode::CoalescingAMDX
2551                | s::ExecutionMode::IsApiEntryAMDX
2552                | s::ExecutionMode::MaxNodeRecursionAMDX
2553                | s::ExecutionMode::StaticNumWorkgroupsAMDX
2554                | s::ExecutionMode::ShaderIndexAMDX
2555                | s::ExecutionMode::MaxNumWorkgroupsAMDX
2556                | s::ExecutionMode::QuadDerivativesKHR
2557                | s::ExecutionMode::RequireFullQuadsKHR
2558                | s::ExecutionMode::SharesInputWithAMDX
2559                | s::ExecutionMode::Shader64BitIndexingEXT
2560                | s::ExecutionMode::SharedLocalMemorySizeINTEL
2561                | s::ExecutionMode::RoundingModeRTPINTEL
2562                | s::ExecutionMode::RoundingModeRTNINTEL
2563                | s::ExecutionMode::FloatingPointModeALTINTEL
2564                | s::ExecutionMode::FloatingPointModeIEEEINTEL
2565                | s::ExecutionMode::SchedulerTargetFmaxMhzINTEL
2566                | s::ExecutionMode::FPFastMathDefault
2567                | s::ExecutionMode::StreamingInterfaceINTEL
2568                | s::ExecutionMode::RegisterMapInterfaceINTEL
2569                | s::ExecutionMode::NamedBarrierCountINTEL
2570                | s::ExecutionMode::MaximumRegistersINTEL
2571                | s::ExecutionMode::MaximumRegistersIdINTEL
2572                | s::ExecutionMode::NamedMaximumRegistersINTEL => vec![],
2573                s::ExecutionMode::EarlyAndLateFragmentTestsAMD => {
2574                    vec!["SPV_AMD_shader_early_and_late_fragment_tests"]
2575                }
2576                s::ExecutionMode::StencilRefUnchangedFrontAMD
2577                | s::ExecutionMode::StencilRefGreaterFrontAMD
2578                | s::ExecutionMode::StencilRefLessFrontAMD
2579                | s::ExecutionMode::StencilRefUnchangedBackAMD
2580                | s::ExecutionMode::StencilRefGreaterBackAMD
2581                | s::ExecutionMode::StencilRefLessBackAMD => vec![
2582                    "SPV_AMD_shader_early_and_late_fragment_tests",
2583                    "SPV_EXT_shader_stencil_export",
2584                ],
2585                s::ExecutionMode::PixelInterlockOrderedEXT
2586                | s::ExecutionMode::PixelInterlockUnorderedEXT
2587                | s::ExecutionMode::SampleInterlockOrderedEXT
2588                | s::ExecutionMode::SampleInterlockUnorderedEXT
2589                | s::ExecutionMode::ShadingRateInterlockOrderedEXT
2590                | s::ExecutionMode::ShadingRateInterlockUnorderedEXT => {
2591                    vec!["SPV_EXT_fragment_shader_interlock"]
2592                }
2593                s::ExecutionMode::StencilRefReplacingEXT => vec!["SPV_EXT_shader_stencil_export"],
2594                s::ExecutionMode::MaxWorkgroupSizeINTEL
2595                | s::ExecutionMode::MaxWorkDimINTEL
2596                | s::ExecutionMode::NoGlobalOffsetINTEL
2597                | s::ExecutionMode::NumSIMDWorkitemsINTEL => vec!["SPV_INTEL_kernel_attributes"],
2598                s::ExecutionMode::DenormPreserve
2599                | s::ExecutionMode::DenormFlushToZero
2600                | s::ExecutionMode::SignedZeroInfNanPreserve
2601                | s::ExecutionMode::RoundingModeRTE
2602                | s::ExecutionMode::RoundingModeRTZ => vec!["SPV_KHR_float_controls"],
2603                s::ExecutionMode::MaximallyReconvergesKHR => vec!["SPV_KHR_maximal_reconvergence"],
2604                s::ExecutionMode::PostDepthCoverage => vec!["SPV_KHR_post_depth_coverage"],
2605                s::ExecutionMode::SubgroupUniformControlFlowKHR => {
2606                    vec!["SPV_KHR_subgroup_uniform_control_flow"]
2607                }
2608                s::ExecutionMode::DerivativeGroupQuadsKHR
2609                | s::ExecutionMode::DerivativeGroupLinearKHR => vec![
2610                    "SPV_NV_compute_shader_derivatives",
2611                    "SPV_KHR_compute_shader_derivatives",
2612                ],
2613                s::ExecutionMode::OutputLinesEXT
2614                | s::ExecutionMode::OutputPrimitivesEXT
2615                | s::ExecutionMode::OutputTrianglesEXT => {
2616                    vec!["SPV_NV_mesh_shader", "SPV_EXT_mesh_shader"]
2617                }
2618            },
2619            Self::StorageClass(v) => match v {
2620                s::StorageClass::UniformConstant
2621                | s::StorageClass::Input
2622                | s::StorageClass::Uniform
2623                | s::StorageClass::Output
2624                | s::StorageClass::Workgroup
2625                | s::StorageClass::CrossWorkgroup
2626                | s::StorageClass::Private
2627                | s::StorageClass::Function
2628                | s::StorageClass::Generic
2629                | s::StorageClass::PushConstant
2630                | s::StorageClass::AtomicCounter
2631                | s::StorageClass::Image
2632                | s::StorageClass::TileImageEXT
2633                | s::StorageClass::TileAttachmentQCOM
2634                | s::StorageClass::NodePayloadAMDX
2635                | s::StorageClass::HitObjectAttributeNV
2636                | s::StorageClass::HitObjectAttributeEXT
2637                | s::StorageClass::DeviceOnlyALTERA
2638                | s::StorageClass::HostOnlyALTERA => vec![],
2639                s::StorageClass::TaskPayloadWorkgroupEXT => vec!["SPV_EXT_mesh_shader"],
2640                s::StorageClass::PhysicalStorageBuffer => vec![
2641                    "SPV_EXT_physical_storage_buffer",
2642                    "SPV_KHR_physical_storage_buffer",
2643                ],
2644                s::StorageClass::CodeSectionINTEL => vec!["SPV_INTEL_function_pointers"],
2645                s::StorageClass::StorageBuffer => vec![
2646                    "SPV_KHR_storage_buffer_storage_class",
2647                    "SPV_KHR_variable_pointers",
2648                ],
2649                s::StorageClass::CallableDataKHR
2650                | s::StorageClass::IncomingCallableDataKHR
2651                | s::StorageClass::RayPayloadKHR
2652                | s::StorageClass::HitAttributeKHR
2653                | s::StorageClass::IncomingRayPayloadKHR
2654                | s::StorageClass::ShaderRecordBufferKHR => {
2655                    vec!["SPV_NV_ray_tracing", "SPV_KHR_ray_tracing"]
2656                }
2657            },
2658            Self::Dim(v) => match v {
2659                s::Dim::Dim1D
2660                | s::Dim::Dim2D
2661                | s::Dim::Dim3D
2662                | s::Dim::DimCube
2663                | s::Dim::DimRect
2664                | s::Dim::DimBuffer
2665                | s::Dim::DimSubpassData
2666                | s::Dim::DimTileImageDataEXT => vec![],
2667            },
2668            Self::SamplerAddressingMode(v) => match v {
2669                s::SamplerAddressingMode::None
2670                | s::SamplerAddressingMode::ClampToEdge
2671                | s::SamplerAddressingMode::Clamp
2672                | s::SamplerAddressingMode::Repeat
2673                | s::SamplerAddressingMode::RepeatMirrored => vec![],
2674            },
2675            Self::SamplerFilterMode(v) => match v {
2676                s::SamplerFilterMode::Nearest | s::SamplerFilterMode::Linear => vec![],
2677            },
2678            Self::ImageFormat(v) => match v {
2679                s::ImageFormat::Unknown
2680                | s::ImageFormat::Rgba32f
2681                | s::ImageFormat::Rgba16f
2682                | s::ImageFormat::R32f
2683                | s::ImageFormat::Rgba8
2684                | s::ImageFormat::Rgba8Snorm
2685                | s::ImageFormat::Rg32f
2686                | s::ImageFormat::Rg16f
2687                | s::ImageFormat::R11fG11fB10f
2688                | s::ImageFormat::R16f
2689                | s::ImageFormat::Rgba16
2690                | s::ImageFormat::Rgb10A2
2691                | s::ImageFormat::Rg16
2692                | s::ImageFormat::Rg8
2693                | s::ImageFormat::R16
2694                | s::ImageFormat::R8
2695                | s::ImageFormat::Rgba16Snorm
2696                | s::ImageFormat::Rg16Snorm
2697                | s::ImageFormat::Rg8Snorm
2698                | s::ImageFormat::R16Snorm
2699                | s::ImageFormat::R8Snorm
2700                | s::ImageFormat::Rgba32i
2701                | s::ImageFormat::Rgba16i
2702                | s::ImageFormat::Rgba8i
2703                | s::ImageFormat::R32i
2704                | s::ImageFormat::Rg32i
2705                | s::ImageFormat::Rg16i
2706                | s::ImageFormat::Rg8i
2707                | s::ImageFormat::R16i
2708                | s::ImageFormat::R8i
2709                | s::ImageFormat::Rgba32ui
2710                | s::ImageFormat::Rgba16ui
2711                | s::ImageFormat::Rgba8ui
2712                | s::ImageFormat::R32ui
2713                | s::ImageFormat::Rgb10a2ui
2714                | s::ImageFormat::Rg32ui
2715                | s::ImageFormat::Rg16ui
2716                | s::ImageFormat::Rg8ui
2717                | s::ImageFormat::R16ui
2718                | s::ImageFormat::R8ui
2719                | s::ImageFormat::R64ui
2720                | s::ImageFormat::R64i => vec![],
2721            },
2722            Self::ImageChannelOrder(v) => match v {
2723                s::ImageChannelOrder::R
2724                | s::ImageChannelOrder::A
2725                | s::ImageChannelOrder::RG
2726                | s::ImageChannelOrder::RA
2727                | s::ImageChannelOrder::RGB
2728                | s::ImageChannelOrder::RGBA
2729                | s::ImageChannelOrder::BGRA
2730                | s::ImageChannelOrder::ARGB
2731                | s::ImageChannelOrder::Intensity
2732                | s::ImageChannelOrder::Luminance
2733                | s::ImageChannelOrder::Rx
2734                | s::ImageChannelOrder::RGx
2735                | s::ImageChannelOrder::RGBx
2736                | s::ImageChannelOrder::Depth
2737                | s::ImageChannelOrder::DepthStencil
2738                | s::ImageChannelOrder::sRGB
2739                | s::ImageChannelOrder::sRGBx
2740                | s::ImageChannelOrder::sRGBA
2741                | s::ImageChannelOrder::sBGRA
2742                | s::ImageChannelOrder::ABGR => vec![],
2743            },
2744            Self::ImageChannelDataType(v) => match v {
2745                s::ImageChannelDataType::SnormInt8
2746                | s::ImageChannelDataType::SnormInt16
2747                | s::ImageChannelDataType::UnormInt8
2748                | s::ImageChannelDataType::UnormInt16
2749                | s::ImageChannelDataType::UnormShort565
2750                | s::ImageChannelDataType::UnormShort555
2751                | s::ImageChannelDataType::UnormInt101010
2752                | s::ImageChannelDataType::SignedInt8
2753                | s::ImageChannelDataType::SignedInt16
2754                | s::ImageChannelDataType::SignedInt32
2755                | s::ImageChannelDataType::UnsignedInt8
2756                | s::ImageChannelDataType::UnsignedInt16
2757                | s::ImageChannelDataType::UnsignedInt32
2758                | s::ImageChannelDataType::HalfFloat
2759                | s::ImageChannelDataType::Float
2760                | s::ImageChannelDataType::UnormInt24
2761                | s::ImageChannelDataType::UnormInt101010_2
2762                | s::ImageChannelDataType::UnormInt10X6EXT
2763                | s::ImageChannelDataType::UnsignedIntRaw10EXT
2764                | s::ImageChannelDataType::UnsignedIntRaw12EXT
2765                | s::ImageChannelDataType::UnormInt2_101010EXT
2766                | s::ImageChannelDataType::UnsignedInt10X6EXT
2767                | s::ImageChannelDataType::UnsignedInt12X4EXT
2768                | s::ImageChannelDataType::UnsignedInt14X2EXT
2769                | s::ImageChannelDataType::UnormInt12X4EXT
2770                | s::ImageChannelDataType::UnormInt14X2EXT => vec![],
2771            },
2772            Self::FPRoundingMode(v) => match v {
2773                s::FPRoundingMode::RTE
2774                | s::FPRoundingMode::RTZ
2775                | s::FPRoundingMode::RTP
2776                | s::FPRoundingMode::RTN => vec![],
2777            },
2778            Self::FPDenormMode(v) => match v {
2779                s::FPDenormMode::Preserve | s::FPDenormMode::FlushToZero => vec![],
2780            },
2781            Self::QuantizationModes(v) => match v {
2782                s::QuantizationModes::TRN
2783                | s::QuantizationModes::TRN_ZERO
2784                | s::QuantizationModes::RND
2785                | s::QuantizationModes::RND_ZERO
2786                | s::QuantizationModes::RND_INF
2787                | s::QuantizationModes::RND_MIN_INF
2788                | s::QuantizationModes::RND_CONV
2789                | s::QuantizationModes::RND_CONV_ODD => vec![],
2790            },
2791            Self::FPOperationMode(v) => match v {
2792                s::FPOperationMode::IEEE | s::FPOperationMode::ALT => vec![],
2793            },
2794            Self::OverflowModes(v) => match v {
2795                s::OverflowModes::WRAP
2796                | s::OverflowModes::SAT
2797                | s::OverflowModes::SAT_ZERO
2798                | s::OverflowModes::SAT_SYM => vec![],
2799            },
2800            Self::LinkageType(v) => match v {
2801                s::LinkageType::Export | s::LinkageType::Import => vec![],
2802                s::LinkageType::LinkOnceODR => vec!["SPV_KHR_linkonce_odr"],
2803            },
2804            Self::AccessQualifier(v) => match v {
2805                s::AccessQualifier::ReadOnly
2806                | s::AccessQualifier::WriteOnly
2807                | s::AccessQualifier::ReadWrite => vec![],
2808            },
2809            Self::HostAccessQualifier(v) => match v {
2810                s::HostAccessQualifier::NoneINTEL
2811                | s::HostAccessQualifier::ReadINTEL
2812                | s::HostAccessQualifier::WriteINTEL
2813                | s::HostAccessQualifier::ReadWriteINTEL => vec![],
2814            },
2815            Self::FunctionParameterAttribute(v) => match v {
2816                s::FunctionParameterAttribute::Zext
2817                | s::FunctionParameterAttribute::Sext
2818                | s::FunctionParameterAttribute::ByVal
2819                | s::FunctionParameterAttribute::Sret
2820                | s::FunctionParameterAttribute::NoAlias
2821                | s::FunctionParameterAttribute::NoCapture
2822                | s::FunctionParameterAttribute::NoWrite
2823                | s::FunctionParameterAttribute::NoReadWrite
2824                | s::FunctionParameterAttribute::RuntimeAlignedALTERA => vec![],
2825            },
2826            Self::Decoration(v) => match v {
2827                s::Decoration::RelaxedPrecision
2828                | s::Decoration::SpecId
2829                | s::Decoration::Block
2830                | s::Decoration::BufferBlock
2831                | s::Decoration::RowMajor
2832                | s::Decoration::ColMajor
2833                | s::Decoration::ArrayStride
2834                | s::Decoration::MatrixStride
2835                | s::Decoration::GLSLShared
2836                | s::Decoration::GLSLPacked
2837                | s::Decoration::CPacked
2838                | s::Decoration::BuiltIn
2839                | s::Decoration::NoPerspective
2840                | s::Decoration::Flat
2841                | s::Decoration::Patch
2842                | s::Decoration::Centroid
2843                | s::Decoration::Sample
2844                | s::Decoration::Invariant
2845                | s::Decoration::Restrict
2846                | s::Decoration::Aliased
2847                | s::Decoration::Volatile
2848                | s::Decoration::Constant
2849                | s::Decoration::Coherent
2850                | s::Decoration::NonWritable
2851                | s::Decoration::NonReadable
2852                | s::Decoration::Uniform
2853                | s::Decoration::UniformId
2854                | s::Decoration::SaturatedConversion
2855                | s::Decoration::Stream
2856                | s::Decoration::Location
2857                | s::Decoration::Component
2858                | s::Decoration::Index
2859                | s::Decoration::Binding
2860                | s::Decoration::DescriptorSet
2861                | s::Decoration::Offset
2862                | s::Decoration::XfbBuffer
2863                | s::Decoration::XfbStride
2864                | s::Decoration::FuncParamAttr
2865                | s::Decoration::FPRoundingMode
2866                | s::Decoration::FPFastMathMode
2867                | s::Decoration::LinkageAttributes
2868                | s::Decoration::NoContraction
2869                | s::Decoration::InputAttachmentIndex
2870                | s::Decoration::Alignment
2871                | s::Decoration::MaxByteOffset
2872                | s::Decoration::AlignmentId
2873                | s::Decoration::MaxByteOffsetId
2874                | s::Decoration::SaturatedToLargestFloat8NormalConversionEXT
2875                | s::Decoration::NodeSharesPayloadLimitsWithAMDX
2876                | s::Decoration::NodeMaxPayloadsAMDX
2877                | s::Decoration::TrackFinishWritingAMDX
2878                | s::Decoration::PayloadNodeNameAMDX
2879                | s::Decoration::PayloadNodeBaseIndexAMDX
2880                | s::Decoration::PayloadNodeSparseArrayAMDX
2881                | s::Decoration::PayloadNodeArraySizeAMDX
2882                | s::Decoration::PayloadDispatchIndirectAMDX
2883                | s::Decoration::ArrayStrideIdEXT
2884                | s::Decoration::OffsetIdEXT
2885                | s::Decoration::ViewportRelativeNV
2886                | s::Decoration::MemberOffsetNV
2887                | s::Decoration::HitObjectShaderRecordBufferNV
2888                | s::Decoration::HitObjectShaderRecordBufferEXT
2889                | s::Decoration::BankNV
2890                | s::Decoration::BindlessSamplerNV
2891                | s::Decoration::BindlessImageNV
2892                | s::Decoration::BoundSamplerNV
2893                | s::Decoration::BoundImageNV
2894                | s::Decoration::SIMTCallINTEL
2895                | s::Decoration::ClobberINTEL
2896                | s::Decoration::SideEffectsINTEL
2897                | s::Decoration::VectorComputeVariableINTEL
2898                | s::Decoration::FuncParamIOKindINTEL
2899                | s::Decoration::VectorComputeFunctionINTEL
2900                | s::Decoration::StackCallINTEL
2901                | s::Decoration::GlobalVariableOffsetINTEL
2902                | s::Decoration::FunctionRoundingModeINTEL
2903                | s::Decoration::FunctionDenormModeINTEL
2904                | s::Decoration::RegisterALTERA
2905                | s::Decoration::MemoryALTERA
2906                | s::Decoration::NumbanksALTERA
2907                | s::Decoration::BankwidthALTERA
2908                | s::Decoration::MaxPrivateCopiesALTERA
2909                | s::Decoration::SinglepumpALTERA
2910                | s::Decoration::DoublepumpALTERA
2911                | s::Decoration::MaxReplicatesALTERA
2912                | s::Decoration::SimpleDualPortALTERA
2913                | s::Decoration::MergeALTERA
2914                | s::Decoration::BankBitsALTERA
2915                | s::Decoration::ForcePow2DepthALTERA
2916                | s::Decoration::StridesizeALTERA
2917                | s::Decoration::WordsizeALTERA
2918                | s::Decoration::TrueDualPortALTERA
2919                | s::Decoration::BurstCoalesceALTERA
2920                | s::Decoration::CacheSizeALTERA
2921                | s::Decoration::DontStaticallyCoalesceALTERA
2922                | s::Decoration::PrefetchALTERA
2923                | s::Decoration::StallEnableALTERA
2924                | s::Decoration::FuseLoopsInFunctionALTERA
2925                | s::Decoration::MathOpDSPModeALTERA
2926                | s::Decoration::AliasScopeINTEL
2927                | s::Decoration::NoAliasINTEL
2928                | s::Decoration::InitiationIntervalALTERA
2929                | s::Decoration::MaxConcurrencyALTERA
2930                | s::Decoration::PipelineEnableALTERA
2931                | s::Decoration::BufferLocationALTERA
2932                | s::Decoration::IOPipeStorageALTERA
2933                | s::Decoration::FunctionFloatingPointModeINTEL
2934                | s::Decoration::SingleElementVectorINTEL
2935                | s::Decoration::VectorComputeCallableFunctionINTEL
2936                | s::Decoration::MediaBlockIOINTEL
2937                | s::Decoration::StallFreeALTERA
2938                | s::Decoration::FPMaxErrorDecorationINTEL
2939                | s::Decoration::LatencyControlLabelALTERA
2940                | s::Decoration::LatencyControlConstraintALTERA
2941                | s::Decoration::ConduitKernelArgumentALTERA
2942                | s::Decoration::RegisterMapKernelArgumentALTERA
2943                | s::Decoration::MMHostInterfaceAddressWidthALTERA
2944                | s::Decoration::MMHostInterfaceDataWidthALTERA
2945                | s::Decoration::MMHostInterfaceLatencyALTERA
2946                | s::Decoration::MMHostInterfaceReadWriteModeALTERA
2947                | s::Decoration::MMHostInterfaceMaxBurstALTERA
2948                | s::Decoration::MMHostInterfaceWaitRequestALTERA
2949                | s::Decoration::StableKernelArgumentALTERA
2950                | s::Decoration::HostAccessINTEL
2951                | s::Decoration::InitModeALTERA
2952                | s::Decoration::ImplementInRegisterMapALTERA
2953                | s::Decoration::ConditionalINTEL
2954                | s::Decoration::CacheControlLoadINTEL
2955                | s::Decoration::CacheControlStoreINTEL => vec![],
2956                s::Decoration::ExplicitInterpAMD => {
2957                    vec!["SPV_AMD_shader_explicit_vertex_parameter"]
2958                }
2959                s::Decoration::NonUniform => vec!["SPV_EXT_descriptor_indexing"],
2960                s::Decoration::RestrictPointer | s::Decoration::AliasedPointer => vec![
2961                    "SPV_EXT_physical_storage_buffer",
2962                    "SPV_KHR_physical_storage_buffer",
2963                ],
2964                s::Decoration::CounterBuffer | s::Decoration::UserSemantic => {
2965                    vec!["SPV_GOOGLE_hlsl_functionality1"]
2966                }
2967                s::Decoration::UserTypeGOOGLE => vec!["SPV_GOOGLE_user_type"],
2968                s::Decoration::ReferencedIndirectlyINTEL => vec!["SPV_INTEL_function_pointers"],
2969                s::Decoration::NoSignedWrap | s::Decoration::NoUnsignedWrap => {
2970                    vec!["SPV_KHR_no_integer_wrap_decoration"]
2971                }
2972                s::Decoration::PerVertexKHR => vec![
2973                    "SPV_NV_fragment_shader_barycentric",
2974                    "SPV_KHR_fragment_shader_barycentric",
2975                ],
2976                s::Decoration::PassthroughNV => vec!["SPV_NV_geometry_shader_passthrough"],
2977                s::Decoration::PerViewNV | s::Decoration::PerTaskNV => vec!["SPV_NV_mesh_shader"],
2978                s::Decoration::PerPrimitiveEXT => vec!["SPV_NV_mesh_shader", "SPV_EXT_mesh_shader"],
2979                s::Decoration::OverrideCoverageNV => vec!["SPV_NV_sample_mask_override_coverage"],
2980                s::Decoration::SecondaryViewportRelativeNV => vec!["SPV_NV_stereo_view_rendering"],
2981                s::Decoration::WeightTextureQCOM | s::Decoration::BlockMatchTextureQCOM => {
2982                    vec!["SPV_QCOM_image_processing"]
2983                }
2984                s::Decoration::BlockMatchSamplerQCOM => vec!["SPV_QCOM_image_processing2"],
2985            },
2986            Self::BuiltIn(v) => match v {
2987                s::BuiltIn::Position
2988                | s::BuiltIn::PointSize
2989                | s::BuiltIn::ClipDistance
2990                | s::BuiltIn::CullDistance
2991                | s::BuiltIn::VertexId
2992                | s::BuiltIn::InstanceId
2993                | s::BuiltIn::PrimitiveId
2994                | s::BuiltIn::InvocationId
2995                | s::BuiltIn::Layer
2996                | s::BuiltIn::ViewportIndex
2997                | s::BuiltIn::TessLevelOuter
2998                | s::BuiltIn::TessLevelInner
2999                | s::BuiltIn::TessCoord
3000                | s::BuiltIn::PatchVertices
3001                | s::BuiltIn::FragCoord
3002                | s::BuiltIn::PointCoord
3003                | s::BuiltIn::FrontFacing
3004                | s::BuiltIn::SampleId
3005                | s::BuiltIn::SamplePosition
3006                | s::BuiltIn::SampleMask
3007                | s::BuiltIn::FragDepth
3008                | s::BuiltIn::HelperInvocation
3009                | s::BuiltIn::NumWorkgroups
3010                | s::BuiltIn::WorkgroupSize
3011                | s::BuiltIn::WorkgroupId
3012                | s::BuiltIn::LocalInvocationId
3013                | s::BuiltIn::GlobalInvocationId
3014                | s::BuiltIn::LocalInvocationIndex
3015                | s::BuiltIn::WorkDim
3016                | s::BuiltIn::GlobalSize
3017                | s::BuiltIn::EnqueuedWorkgroupSize
3018                | s::BuiltIn::GlobalOffset
3019                | s::BuiltIn::GlobalLinearId
3020                | s::BuiltIn::SubgroupSize
3021                | s::BuiltIn::SubgroupMaxSize
3022                | s::BuiltIn::NumSubgroups
3023                | s::BuiltIn::NumEnqueuedSubgroups
3024                | s::BuiltIn::SubgroupId
3025                | s::BuiltIn::SubgroupLocalInvocationId
3026                | s::BuiltIn::VertexIndex
3027                | s::BuiltIn::InstanceIndex
3028                | s::BuiltIn::CoreIDARM
3029                | s::BuiltIn::CoreCountARM
3030                | s::BuiltIn::CoreMaxIDARM
3031                | s::BuiltIn::WarpIDARM
3032                | s::BuiltIn::WarpMaxIDARM
3033                | s::BuiltIn::TileOffsetQCOM
3034                | s::BuiltIn::TileDimensionQCOM
3035                | s::BuiltIn::TileApronSizeQCOM
3036                | s::BuiltIn::RemainingRecursionLevelsAMDX
3037                | s::BuiltIn::ShaderIndexAMDX
3038                | s::BuiltIn::SamplerHeapEXT
3039                | s::BuiltIn::ResourceHeapEXT
3040                | s::BuiltIn::HitTriangleVertexPositionsKHR
3041                | s::BuiltIn::HitMicroTriangleVertexPositionsNV
3042                | s::BuiltIn::HitMicroTriangleVertexBarycentricsNV
3043                | s::BuiltIn::HitKindFrontFacingMicroTriangleNV
3044                | s::BuiltIn::HitKindBackFacingMicroTriangleNV => vec![],
3045                s::BuiltIn::BaryCoordNoPerspAMD
3046                | s::BuiltIn::BaryCoordNoPerspCentroidAMD
3047                | s::BuiltIn::BaryCoordNoPerspSampleAMD
3048                | s::BuiltIn::BaryCoordSmoothAMD
3049                | s::BuiltIn::BaryCoordSmoothCentroidAMD
3050                | s::BuiltIn::BaryCoordSmoothSampleAMD
3051                | s::BuiltIn::BaryCoordPullModelAMD => {
3052                    vec!["SPV_AMD_shader_explicit_vertex_parameter"]
3053                }
3054                s::BuiltIn::FullyCoveredEXT => vec!["SPV_EXT_fragment_fully_covered"],
3055                s::BuiltIn::FragSizeEXT | s::BuiltIn::FragInvocationCountEXT => {
3056                    vec!["SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate"]
3057                }
3058                s::BuiltIn::PrimitivePointIndicesEXT
3059                | s::BuiltIn::PrimitiveLineIndicesEXT
3060                | s::BuiltIn::PrimitiveTriangleIndicesEXT
3061                | s::BuiltIn::CullPrimitiveEXT => vec!["SPV_EXT_mesh_shader"],
3062                s::BuiltIn::FragStencilRefEXT => vec!["SPV_EXT_shader_stencil_export"],
3063                s::BuiltIn::DeviceIndex => vec!["SPV_KHR_device_group"],
3064                s::BuiltIn::PrimitiveShadingRateKHR | s::BuiltIn::ShadingRateKHR => {
3065                    vec!["SPV_KHR_fragment_shading_rate"]
3066                }
3067                s::BuiltIn::ViewIndex => vec!["SPV_KHR_multiview"],
3068                s::BuiltIn::CullMaskKHR => vec!["SPV_KHR_ray_cull_mask"],
3069                s::BuiltIn::RayGeometryIndexKHR => vec!["SPV_KHR_ray_tracing"],
3070                s::BuiltIn::SubgroupEqMask
3071                | s::BuiltIn::SubgroupGeMask
3072                | s::BuiltIn::SubgroupGtMask
3073                | s::BuiltIn::SubgroupLeMask
3074                | s::BuiltIn::SubgroupLtMask => vec!["SPV_KHR_shader_ballot"],
3075                s::BuiltIn::BaseVertex | s::BuiltIn::BaseInstance => {
3076                    vec!["SPV_KHR_shader_draw_parameters"]
3077                }
3078                s::BuiltIn::DrawIndex => vec![
3079                    "SPV_KHR_shader_draw_parameters",
3080                    "SPV_NV_mesh_shader",
3081                    "SPV_EXT_mesh_shader",
3082                ],
3083                s::BuiltIn::PositionPerViewNV | s::BuiltIn::ViewportMaskPerViewNV => vec![
3084                    "SPV_NVX_multiview_per_view_attributes",
3085                    "SPV_NV_mesh_shader",
3086                ],
3087                s::BuiltIn::ClusterIDNV => vec!["SPV_NV_cluster_acceleration_structure"],
3088                s::BuiltIn::BaryCoordKHR | s::BuiltIn::BaryCoordNoPerspKHR => vec![
3089                    "SPV_NV_fragment_shader_barycentric",
3090                    "SPV_KHR_fragment_shader_barycentric",
3091                ],
3092                s::BuiltIn::HitIsSphereNV
3093                | s::BuiltIn::HitIsLSSNV
3094                | s::BuiltIn::HitSpherePositionNV
3095                | s::BuiltIn::HitLSSPositionsNV
3096                | s::BuiltIn::HitSphereRadiusNV
3097                | s::BuiltIn::HitLSSRadiiNV => vec!["SPV_NV_linear_swept_spheres"],
3098                s::BuiltIn::TaskCountNV
3099                | s::BuiltIn::PrimitiveCountNV
3100                | s::BuiltIn::PrimitiveIndicesNV
3101                | s::BuiltIn::ClipDistancePerViewNV
3102                | s::BuiltIn::CullDistancePerViewNV
3103                | s::BuiltIn::LayerPerViewNV
3104                | s::BuiltIn::MeshViewCountNV
3105                | s::BuiltIn::MeshViewIndicesNV => vec!["SPV_NV_mesh_shader"],
3106                s::BuiltIn::HitTNV => vec!["SPV_NV_ray_tracing"],
3107                s::BuiltIn::LaunchIdKHR
3108                | s::BuiltIn::LaunchSizeKHR
3109                | s::BuiltIn::WorldRayOriginKHR
3110                | s::BuiltIn::WorldRayDirectionKHR
3111                | s::BuiltIn::ObjectRayOriginKHR
3112                | s::BuiltIn::ObjectRayDirectionKHR
3113                | s::BuiltIn::RayTminKHR
3114                | s::BuiltIn::RayTmaxKHR
3115                | s::BuiltIn::InstanceCustomIndexKHR
3116                | s::BuiltIn::ObjectToWorldKHR
3117                | s::BuiltIn::WorldToObjectKHR
3118                | s::BuiltIn::HitKindKHR
3119                | s::BuiltIn::IncomingRayFlagsKHR => {
3120                    vec!["SPV_NV_ray_tracing", "SPV_KHR_ray_tracing"]
3121                }
3122                s::BuiltIn::CurrentRayTimeNV => vec!["SPV_NV_ray_tracing_motion_blur"],
3123                s::BuiltIn::WarpsPerSMNV
3124                | s::BuiltIn::SMCountNV
3125                | s::BuiltIn::WarpIDNV
3126                | s::BuiltIn::SMIDNV => vec!["SPV_NV_shader_sm_builtins"],
3127                s::BuiltIn::SecondaryPositionNV | s::BuiltIn::SecondaryViewportMaskNV => {
3128                    vec!["SPV_NV_stereo_view_rendering"]
3129                }
3130                s::BuiltIn::ViewportMaskNV => vec!["SPV_NV_viewport_array2", "SPV_NV_mesh_shader"],
3131            },
3132            Self::Scope(v) => match v {
3133                s::Scope::CrossDevice
3134                | s::Scope::Device
3135                | s::Scope::Workgroup
3136                | s::Scope::Subgroup
3137                | s::Scope::Invocation
3138                | s::Scope::QueueFamily
3139                | s::Scope::ShaderCallKHR => vec![],
3140            },
3141            Self::GroupOperation(v) => match v {
3142                s::GroupOperation::Reduce
3143                | s::GroupOperation::InclusiveScan
3144                | s::GroupOperation::ExclusiveScan
3145                | s::GroupOperation::ClusteredReduce
3146                | s::GroupOperation::PartitionedReduceEXT
3147                | s::GroupOperation::PartitionedInclusiveScanEXT
3148                | s::GroupOperation::PartitionedExclusiveScanEXT => vec![],
3149            },
3150            Self::KernelEnqueueFlags(v) => match v {
3151                s::KernelEnqueueFlags::NoWait
3152                | s::KernelEnqueueFlags::WaitKernel
3153                | s::KernelEnqueueFlags::WaitWorkGroup => vec![],
3154            },
3155            Self::Capability(v) => match v {
3156                s::Capability::Matrix
3157                | s::Capability::Shader
3158                | s::Capability::Geometry
3159                | s::Capability::Tessellation
3160                | s::Capability::Addresses
3161                | s::Capability::Linkage
3162                | s::Capability::Kernel
3163                | s::Capability::Vector16
3164                | s::Capability::Float16Buffer
3165                | s::Capability::Float16
3166                | s::Capability::Float64
3167                | s::Capability::Int64
3168                | s::Capability::Int64Atomics
3169                | s::Capability::ImageBasic
3170                | s::Capability::ImageReadWrite
3171                | s::Capability::ImageMipmap
3172                | s::Capability::Pipes
3173                | s::Capability::DeviceEnqueue
3174                | s::Capability::LiteralSampler
3175                | s::Capability::AtomicStorage
3176                | s::Capability::Int16
3177                | s::Capability::TessellationPointSize
3178                | s::Capability::GeometryPointSize
3179                | s::Capability::ImageGatherExtended
3180                | s::Capability::StorageImageMultisample
3181                | s::Capability::UniformBufferArrayDynamicIndexing
3182                | s::Capability::SampledImageArrayDynamicIndexing
3183                | s::Capability::StorageBufferArrayDynamicIndexing
3184                | s::Capability::StorageImageArrayDynamicIndexing
3185                | s::Capability::ClipDistance
3186                | s::Capability::CullDistance
3187                | s::Capability::ImageCubeArray
3188                | s::Capability::SampleRateShading
3189                | s::Capability::ImageRect
3190                | s::Capability::SampledRect
3191                | s::Capability::GenericPointer
3192                | s::Capability::Int8
3193                | s::Capability::InputAttachment
3194                | s::Capability::SparseResidency
3195                | s::Capability::MinLod
3196                | s::Capability::Sampled1D
3197                | s::Capability::Image1D
3198                | s::Capability::SampledCubeArray
3199                | s::Capability::SampledBuffer
3200                | s::Capability::ImageBuffer
3201                | s::Capability::ImageMSArray
3202                | s::Capability::StorageImageExtendedFormats
3203                | s::Capability::ImageQuery
3204                | s::Capability::DerivativeControl
3205                | s::Capability::InterpolationFunction
3206                | s::Capability::TransformFeedback
3207                | s::Capability::GeometryStreams
3208                | s::Capability::StorageImageReadWithoutFormat
3209                | s::Capability::StorageImageWriteWithoutFormat
3210                | s::Capability::MultiViewport
3211                | s::Capability::SubgroupDispatch
3212                | s::Capability::NamedBarrier
3213                | s::Capability::PipeStorage
3214                | s::Capability::GroupNonUniform
3215                | s::Capability::GroupNonUniformVote
3216                | s::Capability::GroupNonUniformArithmetic
3217                | s::Capability::GroupNonUniformBallot
3218                | s::Capability::GroupNonUniformShuffle
3219                | s::Capability::GroupNonUniformShuffleRelative
3220                | s::Capability::GroupNonUniformClustered
3221                | s::Capability::GroupNonUniformQuad
3222                | s::Capability::ShaderLayer
3223                | s::Capability::ShaderViewportIndex
3224                | s::Capability::UniformDecoration => vec![],
3225                s::Capability::ArbitraryPrecisionFixedPointALTERA => vec![
3226                    "SPV_ALTERA_arbitrary_precision_fixed_point",
3227                    "SPV_INTEL_arbitrary_precision_fixed_point",
3228                ],
3229                s::Capability::ArbitraryPrecisionFloatingPointALTERA => vec![
3230                    "SPV_ALTERA_arbitrary_precision_floating_point",
3231                    "SPV_INTEL_arbitrary_precision_floating_point",
3232                ],
3233                s::Capability::ArbitraryPrecisionIntegersALTERA => vec![
3234                    "SPV_ALTERA_arbitrary_precision_integers",
3235                    "SPV_INTEL_arbitrary_precision_integers",
3236                ],
3237                s::Capability::BlockingPipesALTERA => {
3238                    vec!["SPV_ALTERA_blocking_pipes", "SPV_INTEL_blocking_pipes"]
3239                }
3240                s::Capability::FPGAArgumentInterfacesALTERA => vec![
3241                    "SPV_ALTERA_fpga_argument_interfaces",
3242                    "SPV_INTEL_fpga_argument_interfaces",
3243                ],
3244                s::Capability::FPGABufferLocationALTERA => vec![
3245                    "SPV_ALTERA_fpga_buffer_location",
3246                    "SPV_INTEL_fpga_buffer_location",
3247                ],
3248                s::Capability::FPGAClusterAttributesALTERA
3249                | s::Capability::FPGAClusterAttributesV2ALTERA => vec![
3250                    "SPV_ALTERA_fpga_cluster_attributes",
3251                    "SPV_INTEL_fpga_cluster_attributes",
3252                ],
3253                s::Capability::FPGADSPControlALTERA => {
3254                    vec!["SPV_ALTERA_fpga_dsp_control", "SPV_INTEL_fpga_dsp_control"]
3255                }
3256                s::Capability::FPGAInvocationPipeliningAttributesALTERA => vec![
3257                    "SPV_ALTERA_fpga_invocation_pipelining_attributes",
3258                    "SPV_INTEL_fpga_invocation_pipelining_attributes",
3259                ],
3260                s::Capability::FPGALatencyControlALTERA => vec![
3261                    "SPV_ALTERA_fpga_latency_control",
3262                    "SPV_INTEL_fpga_latency_control",
3263                ],
3264                s::Capability::FPGALoopControlsALTERA => vec![
3265                    "SPV_ALTERA_fpga_loop_controls",
3266                    "SPV_INTEL_fpga_loop_controls",
3267                ],
3268                s::Capability::FPGAMemoryAccessesALTERA => vec![
3269                    "SPV_ALTERA_fpga_memory_accesses",
3270                    "SPV_INTEL_fpga_memory_accesses",
3271                ],
3272                s::Capability::FPGAMemoryAttributesALTERA => vec![
3273                    "SPV_ALTERA_fpga_memory_attributes",
3274                    "SPV_INTEL_fpga_memory_attributes",
3275                ],
3276                s::Capability::FPGARegALTERA => vec!["SPV_ALTERA_fpga_reg", "SPV_INTEL_fpga_reg"],
3277                s::Capability::GlobalVariableFPGADecorationsALTERA => vec![
3278                    "SPV_ALTERA_global_variable_fpga_decorations",
3279                    "SPV_INTEL_global_variable_fpga_decorations",
3280                ],
3281                s::Capability::IOPipesALTERA => vec!["SPV_ALTERA_io_pipes", "SPV_INTEL_io_pipes"],
3282                s::Capability::LoopFuseALTERA => {
3283                    vec!["SPV_ALTERA_loop_fuse", "SPV_INTEL_loop_fuse"]
3284                }
3285                s::Capability::RuntimeAlignedAttributeALTERA => {
3286                    vec!["SPV_ALTERA_runtime_aligned", "SPV_INTEL_runtime_aligned"]
3287                }
3288                s::Capability::TaskSequenceALTERA => {
3289                    vec!["SPV_ALTERA_task_sequence", "SPV_INTEL_task_sequence"]
3290                }
3291                s::Capability::USMStorageClassesALTERA => vec![
3292                    "SPV_ALTERA_usm_storage_classes",
3293                    "SPV_INTEL_usm_storage_classes",
3294                ],
3295                s::Capability::ShaderEnqueueAMDX => vec!["SPV_AMDX_shader_enqueue"],
3296                s::Capability::Float16ImageAMD => vec!["SPV_AMD_gpu_shader_half_float_fetch"],
3297                s::Capability::Groups => vec!["SPV_AMD_shader_ballot"],
3298                s::Capability::FragmentMaskAMD => vec!["SPV_AMD_shader_fragment_mask"],
3299                s::Capability::ImageReadWriteLodAMD => vec!["SPV_AMD_shader_image_load_store_lod"],
3300                s::Capability::ImageGatherBiasLodAMD => vec!["SPV_AMD_texture_gather_bias_lod"],
3301                s::Capability::CooperativeMatrixLayoutsARM => {
3302                    vec!["SPV_ARM_cooperative_matrix_layouts"]
3303                }
3304                s::Capability::CoreBuiltinsARM => vec!["SPV_ARM_core_builtins"],
3305                s::Capability::GraphARM => vec!["SPV_ARM_graph"],
3306                s::Capability::TensorsARM
3307                | s::Capability::StorageTensorArrayDynamicIndexingARM
3308                | s::Capability::StorageTensorArrayNonUniformIndexingARM => vec!["SPV_ARM_tensors"],
3309                s::Capability::ArithmeticFenceEXT => vec!["SPV_EXT_arithmetic_fence"],
3310                s::Capability::DemoteToHelperInvocation => {
3311                    vec!["SPV_EXT_demote_to_helper_invocation"]
3312                }
3313                s::Capability::DescriptorHeapEXT => vec!["SPV_EXT_descriptor_heap"],
3314                s::Capability::ShaderNonUniform
3315                | s::Capability::RuntimeDescriptorArray
3316                | s::Capability::InputAttachmentArrayDynamicIndexing
3317                | s::Capability::UniformTexelBufferArrayDynamicIndexing
3318                | s::Capability::StorageTexelBufferArrayDynamicIndexing
3319                | s::Capability::UniformBufferArrayNonUniformIndexing
3320                | s::Capability::SampledImageArrayNonUniformIndexing
3321                | s::Capability::StorageBufferArrayNonUniformIndexing
3322                | s::Capability::StorageImageArrayNonUniformIndexing
3323                | s::Capability::InputAttachmentArrayNonUniformIndexing
3324                | s::Capability::UniformTexelBufferArrayNonUniformIndexing
3325                | s::Capability::StorageTexelBufferArrayNonUniformIndexing => {
3326                    vec!["SPV_EXT_descriptor_indexing"]
3327                }
3328                s::Capability::Float8EXT | s::Capability::Float8CooperativeMatrixEXT => {
3329                    vec!["SPV_EXT_float8"]
3330                }
3331                s::Capability::FragmentFullyCoveredEXT => vec!["SPV_EXT_fragment_fully_covered"],
3332                s::Capability::FragmentDensityEXT => {
3333                    vec!["SPV_EXT_fragment_invocation_density", "SPV_NV_shading_rate"]
3334                }
3335                s::Capability::FragmentShaderSampleInterlockEXT
3336                | s::Capability::FragmentShaderShadingRateInterlockEXT
3337                | s::Capability::FragmentShaderPixelInterlockEXT => {
3338                    vec!["SPV_EXT_fragment_shader_interlock"]
3339                }
3340                s::Capability::LongVectorEXT => vec!["SPV_EXT_long_vector"],
3341                s::Capability::MeshShadingEXT => vec!["SPV_EXT_mesh_shader"],
3342                s::Capability::RayTracingOpacityMicromapEXT => vec!["SPV_EXT_opacity_micromap"],
3343                s::Capability::OptNoneEXT => vec!["SPV_EXT_optnone", "SPV_INTEL_optnone"],
3344                s::Capability::PhysicalStorageBufferAddresses => vec![
3345                    "SPV_EXT_physical_storage_buffer",
3346                    "SPV_KHR_physical_storage_buffer",
3347                ],
3348                s::Capability::ReplicatedCompositesEXT => vec!["SPV_EXT_replicated_composites"],
3349                s::Capability::Shader64BitIndexingEXT => vec!["SPV_EXT_shader_64bit_indexing"],
3350                s::Capability::AtomicFloat16AddEXT => vec!["SPV_EXT_shader_atomic_float16_add"],
3351                s::Capability::AtomicFloat32AddEXT | s::Capability::AtomicFloat64AddEXT => {
3352                    vec!["SPV_EXT_shader_atomic_float_add"]
3353                }
3354                s::Capability::AtomicFloat32MinMaxEXT
3355                | s::Capability::AtomicFloat64MinMaxEXT
3356                | s::Capability::AtomicFloat16MinMaxEXT => {
3357                    vec!["SPV_EXT_shader_atomic_float_min_max"]
3358                }
3359                s::Capability::Int64ImageEXT => vec!["SPV_EXT_shader_image_int64"],
3360                s::Capability::ShaderInvocationReorderEXT => {
3361                    vec!["SPV_EXT_shader_invocation_reorder"]
3362                }
3363                s::Capability::StencilExportEXT => vec!["SPV_EXT_shader_stencil_export"],
3364                s::Capability::TileImageColorReadAccessEXT
3365                | s::Capability::TileImageDepthReadAccessEXT
3366                | s::Capability::TileImageStencilReadAccessEXT => vec!["SPV_EXT_shader_tile_image"],
3367                s::Capability::ShaderViewportIndexLayerEXT => vec![
3368                    "SPV_EXT_shader_viewport_index_layer",
3369                    "SPV_NV_viewport_array2",
3370                ],
3371                s::Capability::Subgroup2DBlockIOINTEL
3372                | s::Capability::Subgroup2DBlockTransformINTEL
3373                | s::Capability::Subgroup2DBlockTransposeINTEL => vec!["SPV_INTEL_2d_block_io"],
3374                s::Capability::BFloat16ConversionINTEL => vec!["SPV_INTEL_bfloat16_conversion"],
3375                s::Capability::BindlessImagesINTEL => vec!["SPV_INTEL_bindless_images"],
3376                s::Capability::CacheControlsINTEL => vec!["SPV_INTEL_cache_controls"],
3377                s::Capability::DebugInfoModuleINTEL => vec!["SPV_INTEL_debug_module"],
3378                s::Capability::SubgroupAvcMotionEstimationINTEL
3379                | s::Capability::SubgroupAvcMotionEstimationIntraINTEL
3380                | s::Capability::SubgroupAvcMotionEstimationChromaINTEL => {
3381                    vec!["SPV_INTEL_device_side_avc_motion_estimation"]
3382                }
3383                s::Capability::RoundToInfinityINTEL
3384                | s::Capability::FloatingPointModeINTEL
3385                | s::Capability::FunctionFloatControlINTEL => vec!["SPV_INTEL_float_controls2"],
3386                s::Capability::FPFastMathModeINTEL => vec!["SPV_INTEL_fp_fast_math_mode"],
3387                s::Capability::FPMaxErrorINTEL => vec!["SPV_INTEL_fp_max_error"],
3388                s::Capability::FunctionPointersINTEL | s::Capability::IndirectReferencesINTEL => {
3389                    vec!["SPV_INTEL_function_pointers"]
3390                }
3391                s::Capability::SpecConditionalINTEL | s::Capability::FunctionVariantsINTEL => {
3392                    vec!["SPV_INTEL_function_variants"]
3393                }
3394                s::Capability::GlobalVariableHostAccessINTEL => {
3395                    vec!["SPV_INTEL_global_variable_host_access"]
3396                }
3397                s::Capability::AsmINTEL => vec!["SPV_INTEL_inline_assembly"],
3398                s::Capability::Int4TypeINTEL | s::Capability::Int4CooperativeMatrixINTEL => {
3399                    vec!["SPV_INTEL_int4"]
3400                }
3401                s::Capability::KernelAttributesINTEL
3402                | s::Capability::FPGAKernelAttributesINTEL
3403                | s::Capability::FPGAKernelAttributesv2INTEL => vec!["SPV_INTEL_kernel_attributes"],
3404                s::Capability::LongCompositesINTEL => vec!["SPV_INTEL_long_composites"],
3405                s::Capability::MaskedGatherScatterINTEL => vec!["SPV_INTEL_masked_gather_scatter"],
3406                s::Capability::RegisterLimitsINTEL => vec!["SPV_INTEL_maximum_registers"],
3407                s::Capability::SubgroupImageMediaBlockIOINTEL => vec!["SPV_INTEL_media_block_io"],
3408                s::Capability::MemoryAccessAliasingINTEL => {
3409                    vec!["SPV_INTEL_memory_access_aliasing"]
3410                }
3411                s::Capability::IntegerFunctions2INTEL => {
3412                    vec!["SPV_INTEL_shader_integer_functions2"]
3413                }
3414                s::Capability::SplitBarrierINTEL => vec!["SPV_INTEL_split_barrier"],
3415                s::Capability::SubgroupBufferPrefetchINTEL => {
3416                    vec!["SPV_INTEL_subgroup_buffer_prefetch"]
3417                }
3418                s::Capability::SubgroupMatrixMultiplyAccumulateINTEL => {
3419                    vec!["SPV_INTEL_subgroup_matrix_multiply_accumulate"]
3420                }
3421                s::Capability::SubgroupShuffleINTEL
3422                | s::Capability::SubgroupBufferBlockIOINTEL
3423                | s::Capability::SubgroupImageBlockIOINTEL => vec!["SPV_INTEL_subgroups"],
3424                s::Capability::TensorFloat32RoundingINTEL => {
3425                    vec!["SPV_INTEL_tensor_float32_conversion"]
3426                }
3427                s::Capability::TernaryBitwiseFunctionINTEL => {
3428                    vec!["SPV_INTEL_ternary_bitwise_function"]
3429                }
3430                s::Capability::UnstructuredLoopControlsINTEL => {
3431                    vec!["SPV_INTEL_unstructured_loop_controls"]
3432                }
3433                s::Capability::VariableLengthArrayINTEL
3434                | s::Capability::UntypedVariableLengthArrayINTEL => {
3435                    vec!["SPV_INTEL_variable_length_array"]
3436                }
3437                s::Capability::VectorComputeINTEL | s::Capability::VectorAnyINTEL => {
3438                    vec!["SPV_INTEL_vector_compute"]
3439                }
3440                s::Capability::StorageBuffer16BitAccess
3441                | s::Capability::UniformAndStorageBuffer16BitAccess
3442                | s::Capability::StoragePushConstant16
3443                | s::Capability::StorageInputOutput16 => vec!["SPV_KHR_16bit_storage"],
3444                s::Capability::StorageBuffer8BitAccess
3445                | s::Capability::UniformAndStorageBuffer8BitAccess
3446                | s::Capability::StoragePushConstant8 => vec!["SPV_KHR_8bit_storage"],
3447                s::Capability::BFloat16TypeKHR
3448                | s::Capability::BFloat16DotProductKHR
3449                | s::Capability::BFloat16CooperativeMatrixKHR => vec!["SPV_KHR_bfloat16"],
3450                s::Capability::BitInstructions => vec!["SPV_KHR_bit_instructions"],
3451                s::Capability::CooperativeMatrixKHR => vec!["SPV_KHR_cooperative_matrix"],
3452                s::Capability::DeviceGroup => vec!["SPV_KHR_device_group"],
3453                s::Capability::ExpectAssumeKHR => vec!["SPV_KHR_expect_assume"],
3454                s::Capability::DenormPreserve
3455                | s::Capability::DenormFlushToZero
3456                | s::Capability::SignedZeroInfNanPreserve
3457                | s::Capability::RoundingModeRTE
3458                | s::Capability::RoundingModeRTZ => vec!["SPV_KHR_float_controls"],
3459                s::Capability::FloatControls2 => vec!["SPV_KHR_float_controls2"],
3460                s::Capability::FMAKHR => vec!["SPV_KHR_fma"],
3461                s::Capability::FragmentShadingRateKHR => vec!["SPV_KHR_fragment_shading_rate"],
3462                s::Capability::DotProductInputAll
3463                | s::Capability::DotProductInput4x8Bit
3464                | s::Capability::DotProductInput4x8BitPacked
3465                | s::Capability::DotProduct => vec!["SPV_KHR_integer_dot_product"],
3466                s::Capability::MultiView => vec!["SPV_KHR_multiview"],
3467                s::Capability::SampleMaskPostDepthCoverage => vec!["SPV_KHR_post_depth_coverage"],
3468                s::Capability::QuadControlKHR => vec!["SPV_KHR_quad_control"],
3469                s::Capability::RayCullMaskKHR => vec!["SPV_KHR_ray_cull_mask"],
3470                s::Capability::RayQueryProvisionalKHR | s::Capability::RayQueryKHR => {
3471                    vec!["SPV_KHR_ray_query"]
3472                }
3473                s::Capability::RayTraversalPrimitiveCullingKHR => {
3474                    vec!["SPV_KHR_ray_query", "SPV_KHR_ray_tracing"]
3475                }
3476                s::Capability::RayTracingKHR | s::Capability::RayTracingProvisionalKHR => {
3477                    vec!["SPV_KHR_ray_tracing"]
3478                }
3479                s::Capability::RayTracingPositionFetchKHR
3480                | s::Capability::RayQueryPositionFetchKHR => {
3481                    vec!["SPV_KHR_ray_tracing_position_fetch"]
3482                }
3483                s::Capability::AtomicStorageOps => vec!["SPV_KHR_shader_atomic_counter_ops"],
3484                s::Capability::SubgroupBallotKHR => vec!["SPV_KHR_shader_ballot"],
3485                s::Capability::ShaderClockKHR => vec!["SPV_KHR_shader_clock"],
3486                s::Capability::DrawParameters => vec!["SPV_KHR_shader_draw_parameters"],
3487                s::Capability::GroupNonUniformRotateKHR => vec!["SPV_KHR_subgroup_rotate"],
3488                s::Capability::SubgroupVoteKHR => vec!["SPV_KHR_subgroup_vote"],
3489                s::Capability::GroupUniformArithmeticKHR => {
3490                    vec!["SPV_KHR_uniform_group_instructions"]
3491                }
3492                s::Capability::UntypedPointersKHR => vec!["SPV_KHR_untyped_pointers"],
3493                s::Capability::VariablePointersStorageBuffer | s::Capability::VariablePointers => {
3494                    vec!["SPV_KHR_variable_pointers"]
3495                }
3496                s::Capability::VulkanMemoryModel | s::Capability::VulkanMemoryModelDeviceScope => {
3497                    vec!["SPV_KHR_vulkan_memory_model"]
3498                }
3499                s::Capability::WorkgroupMemoryExplicitLayoutKHR
3500                | s::Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR
3501                | s::Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR => {
3502                    vec!["SPV_KHR_workgroup_memory_explicit_layout"]
3503                }
3504                s::Capability::PerViewAttributesNV => vec!["SPV_NVX_multiview_per_view_attributes"],
3505                s::Capability::BindlessTextureNV => vec!["SPV_NV_bindless_texture"],
3506                s::Capability::RayTracingClusterAccelerationStructureNV => {
3507                    vec!["SPV_NV_cluster_acceleration_structure"]
3508                }
3509                s::Capability::ComputeDerivativeGroupQuadsKHR
3510                | s::Capability::ComputeDerivativeGroupLinearKHR => vec![
3511                    "SPV_NV_compute_shader_derivatives",
3512                    "SPV_KHR_compute_shader_derivatives",
3513                ],
3514                s::Capability::CooperativeMatrixNV => vec!["SPV_NV_cooperative_matrix"],
3515                s::Capability::CooperativeMatrixReductionsNV
3516                | s::Capability::CooperativeMatrixConversionsNV
3517                | s::Capability::CooperativeMatrixPerElementOperationsNV
3518                | s::Capability::CooperativeMatrixTensorAddressingNV
3519                | s::Capability::CooperativeMatrixBlockLoadsNV => {
3520                    vec!["SPV_NV_cooperative_matrix2"]
3521                }
3522                s::Capability::CooperativeVectorNV | s::Capability::CooperativeVectorTrainingNV => {
3523                    vec!["SPV_NV_cooperative_vector"]
3524                }
3525                s::Capability::DisplacementMicromapNV
3526                | s::Capability::RayTracingDisplacementMicromapNV => {
3527                    vec!["SPV_NV_displacement_micromap"]
3528                }
3529                s::Capability::FragmentBarycentricKHR => vec![
3530                    "SPV_NV_fragment_shader_barycentric",
3531                    "SPV_KHR_fragment_shader_barycentric",
3532                ],
3533                s::Capability::GeometryShaderPassthroughNV => {
3534                    vec!["SPV_NV_geometry_shader_passthrough"]
3535                }
3536                s::Capability::RayTracingSpheresGeometryNV
3537                | s::Capability::RayTracingLinearSweptSpheresGeometryNV => {
3538                    vec!["SPV_NV_linear_swept_spheres"]
3539                }
3540                s::Capability::MeshShadingNV => vec!["SPV_NV_mesh_shader"],
3541                s::Capability::PushConstantBanksNV => vec!["SPV_NV_push_constant_bank"],
3542                s::Capability::RawAccessChainsNV => vec!["SPV_NV_raw_access_chains"],
3543                s::Capability::RayTracingNV => vec!["SPV_NV_ray_tracing"],
3544                s::Capability::RayTracingMotionBlurNV => vec!["SPV_NV_ray_tracing_motion_blur"],
3545                s::Capability::SampleMaskOverrideCoverageNV => {
3546                    vec!["SPV_NV_sample_mask_override_coverage"]
3547                }
3548                s::Capability::AtomicFloat16VectorNV => vec!["SPV_NV_shader_atomic_fp16_vector"],
3549                s::Capability::ImageFootprintNV => vec!["SPV_NV_shader_image_footprint"],
3550                s::Capability::ShaderInvocationReorderNV => {
3551                    vec!["SPV_NV_shader_invocation_reorder"]
3552                }
3553                s::Capability::ShaderSMBuiltinsNV => vec!["SPV_NV_shader_sm_builtins"],
3554                s::Capability::GroupNonUniformPartitionedEXT => vec![
3555                    "SPV_NV_shader_subgroup_partitioned",
3556                    "SPV_EXT_shader_subgroup_partitioned",
3557                ],
3558                s::Capability::ShaderStereoViewNV => vec!["SPV_NV_stereo_view_rendering"],
3559                s::Capability::TensorAddressingNV => vec!["SPV_NV_tensor_addressing"],
3560                s::Capability::ShaderViewportMaskNV => vec!["SPV_NV_viewport_array2"],
3561                s::Capability::CooperativeMatrixConversionQCOM => {
3562                    vec!["SPV_QCOM_cooperative_matrix_conversion"]
3563                }
3564                s::Capability::TextureSampleWeightedQCOM
3565                | s::Capability::TextureBoxFilterQCOM
3566                | s::Capability::TextureBlockMatchQCOM => vec!["SPV_QCOM_image_processing"],
3567                s::Capability::TextureBlockMatch2QCOM => vec!["SPV_QCOM_image_processing2"],
3568                s::Capability::TileShadingQCOM => vec!["SPV_QCOM_tile_shading"],
3569            },
3570            Self::RayQueryIntersection(v) => match v {
3571                s::RayQueryIntersection::RayQueryCandidateIntersectionKHR
3572                | s::RayQueryIntersection::RayQueryCommittedIntersectionKHR => vec![],
3573            },
3574            Self::RayQueryCommittedIntersectionType(v) => match v {
3575                s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionNoneKHR
3576                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionTriangleKHR
3577                | s::RayQueryCommittedIntersectionType::RayQueryCommittedIntersectionGeneratedKHR => {
3578                    vec![]
3579                }
3580            },
3581            Self::RayQueryCandidateIntersectionType(v) => match v {
3582                s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionTriangleKHR
3583                | s::RayQueryCandidateIntersectionType::RayQueryCandidateIntersectionAABBKHR => {
3584                    vec![]
3585                }
3586            },
3587            Self::PackedVectorFormat(v) => match v {
3588                s::PackedVectorFormat::PackedVectorFormat4x8Bit => {
3589                    vec!["SPV_KHR_integer_dot_product"]
3590                }
3591            },
3592            Self::CooperativeMatrixLayout(v) => match v {
3593                s::CooperativeMatrixLayout::RowMajorKHR
3594                | s::CooperativeMatrixLayout::ColumnMajorKHR
3595                | s::CooperativeMatrixLayout::RowBlockedInterleavedARM
3596                | s::CooperativeMatrixLayout::ColumnBlockedInterleavedARM => vec![],
3597            },
3598            Self::CooperativeMatrixUse(v) => match v {
3599                s::CooperativeMatrixUse::MatrixAKHR
3600                | s::CooperativeMatrixUse::MatrixBKHR
3601                | s::CooperativeMatrixUse::MatrixAccumulatorKHR => vec![],
3602            },
3603            Self::TensorClampMode(v) => match v {
3604                s::TensorClampMode::Undefined
3605                | s::TensorClampMode::Constant
3606                | s::TensorClampMode::ClampToEdge
3607                | s::TensorClampMode::Repeat
3608                | s::TensorClampMode::RepeatMirrored => vec![],
3609            },
3610            Self::InitializationModeQualifier(v) => match v {
3611                s::InitializationModeQualifier::InitOnDeviceReprogramALTERA
3612                | s::InitializationModeQualifier::InitOnDeviceResetALTERA => vec![],
3613            },
3614            Self::LoadCacheControl(v) => match v {
3615                s::LoadCacheControl::UncachedINTEL
3616                | s::LoadCacheControl::CachedINTEL
3617                | s::LoadCacheControl::StreamingINTEL
3618                | s::LoadCacheControl::InvalidateAfterReadINTEL
3619                | s::LoadCacheControl::ConstCachedINTEL => vec![],
3620            },
3621            Self::StoreCacheControl(v) => match v {
3622                s::StoreCacheControl::UncachedINTEL
3623                | s::StoreCacheControl::WriteThroughINTEL
3624                | s::StoreCacheControl::WriteBackINTEL
3625                | s::StoreCacheControl::StreamingINTEL => vec![],
3626            },
3627            Self::NamedMaximumNumberOfRegisters(v) => match v {
3628                s::NamedMaximumNumberOfRegisters::AutoINTEL => vec![],
3629            },
3630            Self::FPEncoding(v) => match v {
3631                s::FPEncoding::BFloat16KHR
3632                | s::FPEncoding::Float8E4M3EXT
3633                | s::FPEncoding::Float8E5M2EXT => vec![],
3634            },
3635            Self::CooperativeVectorMatrixLayout(v) => match v {
3636                s::CooperativeVectorMatrixLayout::RowMajorNV
3637                | s::CooperativeVectorMatrixLayout::ColumnMajorNV
3638                | s::CooperativeVectorMatrixLayout::InferencingOptimalNV
3639                | s::CooperativeVectorMatrixLayout::TrainingOptimalNV => vec![],
3640            },
3641            Self::ComponentType(v) => match v {
3642                s::ComponentType::Float16NV
3643                | s::ComponentType::Float32NV
3644                | s::ComponentType::Float64NV
3645                | s::ComponentType::SignedInt8NV
3646                | s::ComponentType::SignedInt16NV
3647                | s::ComponentType::SignedInt32NV
3648                | s::ComponentType::SignedInt64NV
3649                | s::ComponentType::UnsignedInt8NV
3650                | s::ComponentType::UnsignedInt16NV
3651                | s::ComponentType::UnsignedInt32NV
3652                | s::ComponentType::UnsignedInt64NV
3653                | s::ComponentType::SignedInt8PackedNV
3654                | s::ComponentType::UnsignedInt8PackedNV
3655                | s::ComponentType::FloatE4M3NV
3656                | s::ComponentType::FloatE5M2NV => vec![],
3657            },
3658            _ => vec![],
3659        }
3660    }
3661    pub fn additional_operands(&self) -> Vec<crate::grammar::LogicalOperand> {
3662        use spirv as s;
3663        match self {
3664            Self::ImageOperands(v) => {
3665                let mut result = vec![];
3666                result.extend(
3667                    [
3668                        s::ImageOperands::BIAS,
3669                        s::ImageOperands::LOD,
3670                        s::ImageOperands::CONST_OFFSET,
3671                        s::ImageOperands::OFFSET,
3672                        s::ImageOperands::CONST_OFFSETS,
3673                        s::ImageOperands::SAMPLE,
3674                        s::ImageOperands::MIN_LOD,
3675                        s::ImageOperands::OFFSETS,
3676                    ]
3677                    .iter()
3678                    .filter(|arg| v.contains(**arg))
3679                    .flat_map(|_| {
3680                        [crate::grammar::LogicalOperand {
3681                            kind: crate::grammar::OperandKind::IdRef,
3682                            quantifier: crate::grammar::OperandQuantifier::One,
3683                        }]
3684                        .iter()
3685                        .cloned()
3686                    }),
3687                );
3688                result.extend(
3689                    [s::ImageOperands::GRAD]
3690                        .iter()
3691                        .filter(|arg| v.contains(**arg))
3692                        .flat_map(|_| {
3693                            [
3694                                crate::grammar::LogicalOperand {
3695                                    kind: crate::grammar::OperandKind::IdRef,
3696                                    quantifier: crate::grammar::OperandQuantifier::One,
3697                                },
3698                                crate::grammar::LogicalOperand {
3699                                    kind: crate::grammar::OperandKind::IdRef,
3700                                    quantifier: crate::grammar::OperandQuantifier::One,
3701                                },
3702                            ]
3703                            .iter()
3704                            .cloned()
3705                        }),
3706                );
3707                result.extend(
3708                    [
3709                        s::ImageOperands::MAKE_TEXEL_AVAILABLE,
3710                        s::ImageOperands::MAKE_TEXEL_VISIBLE,
3711                    ]
3712                    .iter()
3713                    .filter(|arg| v.contains(**arg))
3714                    .flat_map(|_| {
3715                        [crate::grammar::LogicalOperand {
3716                            kind: crate::grammar::OperandKind::IdScope,
3717                            quantifier: crate::grammar::OperandQuantifier::One,
3718                        }]
3719                        .iter()
3720                        .cloned()
3721                    }),
3722                );
3723                result
3724            }
3725            Self::LoopControl(v) => {
3726                let mut result = vec![];
3727                result.extend(
3728                    [
3729                        s::LoopControl::DEPENDENCY_LENGTH,
3730                        s::LoopControl::MIN_ITERATIONS,
3731                        s::LoopControl::MAX_ITERATIONS,
3732                        s::LoopControl::ITERATION_MULTIPLE,
3733                        s::LoopControl::PEEL_COUNT,
3734                        s::LoopControl::PARTIAL_COUNT,
3735                        s::LoopControl::INITIATION_INTERVAL_ALTERA,
3736                        s::LoopControl::MAX_CONCURRENCY_ALTERA,
3737                        s::LoopControl::DEPENDENCY_ARRAY_ALTERA,
3738                        s::LoopControl::PIPELINE_ENABLE_ALTERA,
3739                        s::LoopControl::LOOP_COALESCE_ALTERA,
3740                        s::LoopControl::MAX_INTERLEAVING_ALTERA,
3741                        s::LoopControl::SPECULATED_ITERATIONS_ALTERA,
3742                        s::LoopControl::LOOP_COUNT_ALTERA,
3743                        s::LoopControl::MAX_REINVOCATION_DELAY_ALTERA,
3744                    ]
3745                    .iter()
3746                    .filter(|arg| v.contains(**arg))
3747                    .flat_map(|_| {
3748                        [crate::grammar::LogicalOperand {
3749                            kind: crate::grammar::OperandKind::LiteralInteger,
3750                            quantifier: crate::grammar::OperandQuantifier::One,
3751                        }]
3752                        .iter()
3753                        .cloned()
3754                    }),
3755                );
3756                result
3757            }
3758            Self::MemoryAccess(v) => {
3759                let mut result = vec![];
3760                result.extend(
3761                    [
3762                        s::MemoryAccess::ALIAS_SCOPE_INTEL_MASK,
3763                        s::MemoryAccess::NO_ALIAS_INTEL_MASK,
3764                    ]
3765                    .iter()
3766                    .filter(|arg| v.contains(**arg))
3767                    .flat_map(|_| {
3768                        [crate::grammar::LogicalOperand {
3769                            kind: crate::grammar::OperandKind::IdRef,
3770                            quantifier: crate::grammar::OperandQuantifier::One,
3771                        }]
3772                        .iter()
3773                        .cloned()
3774                    }),
3775                );
3776                result.extend(
3777                    [
3778                        s::MemoryAccess::MAKE_POINTER_AVAILABLE,
3779                        s::MemoryAccess::MAKE_POINTER_VISIBLE,
3780                    ]
3781                    .iter()
3782                    .filter(|arg| v.contains(**arg))
3783                    .flat_map(|_| {
3784                        [crate::grammar::LogicalOperand {
3785                            kind: crate::grammar::OperandKind::IdScope,
3786                            quantifier: crate::grammar::OperandQuantifier::One,
3787                        }]
3788                        .iter()
3789                        .cloned()
3790                    }),
3791                );
3792                result.extend(
3793                    [s::MemoryAccess::ALIGNED]
3794                        .iter()
3795                        .filter(|arg| v.contains(**arg))
3796                        .flat_map(|_| {
3797                            [crate::grammar::LogicalOperand {
3798                                kind: crate::grammar::OperandKind::LiteralInteger,
3799                                quantifier: crate::grammar::OperandQuantifier::One,
3800                            }]
3801                            .iter()
3802                            .cloned()
3803                        }),
3804                );
3805                result
3806            }
3807            Self::ExecutionMode(v) => match v {
3808                s::ExecutionMode::IsApiEntryAMDX => vec![crate::grammar::LogicalOperand {
3809                    kind: crate::grammar::OperandKind::IdRef,
3810                    quantifier: crate::grammar::OperandQuantifier::One,
3811                }],
3812                s::ExecutionMode::SharesInputWithAMDX => vec![
3813                    crate::grammar::LogicalOperand {
3814                        kind: crate::grammar::OperandKind::IdRef,
3815                        quantifier: crate::grammar::OperandQuantifier::One,
3816                    },
3817                    crate::grammar::LogicalOperand {
3818                        kind: crate::grammar::OperandKind::IdRef,
3819                        quantifier: crate::grammar::OperandQuantifier::One,
3820                    },
3821                ],
3822                s::ExecutionMode::MaximumRegistersIdINTEL => vec![crate::grammar::LogicalOperand {
3823                    kind: crate::grammar::OperandKind::IdRef,
3824                    quantifier: crate::grammar::OperandQuantifier::One,
3825                }],
3826                s::ExecutionMode::MaxNodeRecursionAMDX => vec![crate::grammar::LogicalOperand {
3827                    kind: crate::grammar::OperandKind::IdRef,
3828                    quantifier: crate::grammar::OperandQuantifier::One,
3829                }],
3830                s::ExecutionMode::ShaderIndexAMDX => vec![crate::grammar::LogicalOperand {
3831                    kind: crate::grammar::OperandKind::IdRef,
3832                    quantifier: crate::grammar::OperandQuantifier::One,
3833                }],
3834                s::ExecutionMode::SubgroupsPerWorkgroupId => vec![crate::grammar::LogicalOperand {
3835                    kind: crate::grammar::OperandKind::IdRef,
3836                    quantifier: crate::grammar::OperandQuantifier::One,
3837                }],
3838                s::ExecutionMode::FPFastMathDefault => vec![
3839                    crate::grammar::LogicalOperand {
3840                        kind: crate::grammar::OperandKind::IdRef,
3841                        quantifier: crate::grammar::OperandQuantifier::One,
3842                    },
3843                    crate::grammar::LogicalOperand {
3844                        kind: crate::grammar::OperandKind::IdRef,
3845                        quantifier: crate::grammar::OperandQuantifier::One,
3846                    },
3847                ],
3848                s::ExecutionMode::LocalSizeId
3849                | s::ExecutionMode::StaticNumWorkgroupsAMDX
3850                | s::ExecutionMode::MaxNumWorkgroupsAMDX => vec![
3851                    crate::grammar::LogicalOperand {
3852                        kind: crate::grammar::OperandKind::IdRef,
3853                        quantifier: crate::grammar::OperandQuantifier::One,
3854                    },
3855                    crate::grammar::LogicalOperand {
3856                        kind: crate::grammar::OperandKind::IdRef,
3857                        quantifier: crate::grammar::OperandQuantifier::One,
3858                    },
3859                    crate::grammar::LogicalOperand {
3860                        kind: crate::grammar::OperandKind::IdRef,
3861                        quantifier: crate::grammar::OperandQuantifier::One,
3862                    },
3863                ],
3864                s::ExecutionMode::LocalSizeHintId => vec![
3865                    crate::grammar::LogicalOperand {
3866                        kind: crate::grammar::OperandKind::IdRef,
3867                        quantifier: crate::grammar::OperandQuantifier::One,
3868                    },
3869                    crate::grammar::LogicalOperand {
3870                        kind: crate::grammar::OperandKind::IdRef,
3871                        quantifier: crate::grammar::OperandQuantifier::One,
3872                    },
3873                    crate::grammar::LogicalOperand {
3874                        kind: crate::grammar::OperandKind::IdRef,
3875                        quantifier: crate::grammar::OperandQuantifier::One,
3876                    },
3877                ],
3878                s::ExecutionMode::NamedBarrierCountINTEL => vec![crate::grammar::LogicalOperand {
3879                    kind: crate::grammar::OperandKind::LiteralInteger,
3880                    quantifier: crate::grammar::OperandQuantifier::One,
3881                }],
3882                s::ExecutionMode::Invocations => vec![crate::grammar::LogicalOperand {
3883                    kind: crate::grammar::OperandKind::LiteralInteger,
3884                    quantifier: crate::grammar::OperandQuantifier::One,
3885                }],
3886                s::ExecutionMode::MaximumRegistersINTEL => vec![crate::grammar::LogicalOperand {
3887                    kind: crate::grammar::OperandKind::LiteralInteger,
3888                    quantifier: crate::grammar::OperandQuantifier::One,
3889                }],
3890                s::ExecutionMode::OutputPrimitivesEXT => vec![crate::grammar::LogicalOperand {
3891                    kind: crate::grammar::OperandKind::LiteralInteger,
3892                    quantifier: crate::grammar::OperandQuantifier::One,
3893                }],
3894                s::ExecutionMode::SharedLocalMemorySizeINTEL => {
3895                    vec![crate::grammar::LogicalOperand {
3896                        kind: crate::grammar::OperandKind::LiteralInteger,
3897                        quantifier: crate::grammar::OperandQuantifier::One,
3898                    }]
3899                }
3900                s::ExecutionMode::StreamingInterfaceINTEL => vec![crate::grammar::LogicalOperand {
3901                    kind: crate::grammar::OperandKind::LiteralInteger,
3902                    quantifier: crate::grammar::OperandQuantifier::One,
3903                }],
3904                s::ExecutionMode::SubgroupSize => vec![crate::grammar::LogicalOperand {
3905                    kind: crate::grammar::OperandKind::LiteralInteger,
3906                    quantifier: crate::grammar::OperandQuantifier::One,
3907                }],
3908                s::ExecutionMode::SubgroupsPerWorkgroup => vec![crate::grammar::LogicalOperand {
3909                    kind: crate::grammar::OperandKind::LiteralInteger,
3910                    quantifier: crate::grammar::OperandQuantifier::One,
3911                }],
3912                s::ExecutionMode::DenormPreserve
3913                | s::ExecutionMode::DenormFlushToZero
3914                | s::ExecutionMode::SignedZeroInfNanPreserve
3915                | s::ExecutionMode::RoundingModeRTE
3916                | s::ExecutionMode::RoundingModeRTZ
3917                | s::ExecutionMode::RoundingModeRTPINTEL
3918                | s::ExecutionMode::RoundingModeRTNINTEL
3919                | s::ExecutionMode::FloatingPointModeALTINTEL
3920                | s::ExecutionMode::FloatingPointModeIEEEINTEL => {
3921                    vec![crate::grammar::LogicalOperand {
3922                        kind: crate::grammar::OperandKind::LiteralInteger,
3923                        quantifier: crate::grammar::OperandQuantifier::One,
3924                    }]
3925                }
3926                s::ExecutionMode::VecTypeHint => vec![crate::grammar::LogicalOperand {
3927                    kind: crate::grammar::OperandKind::LiteralInteger,
3928                    quantifier: crate::grammar::OperandQuantifier::One,
3929                }],
3930                s::ExecutionMode::OutputVertices => vec![crate::grammar::LogicalOperand {
3931                    kind: crate::grammar::OperandKind::LiteralInteger,
3932                    quantifier: crate::grammar::OperandQuantifier::One,
3933                }],
3934                s::ExecutionMode::RegisterMapInterfaceINTEL => {
3935                    vec![crate::grammar::LogicalOperand {
3936                        kind: crate::grammar::OperandKind::LiteralInteger,
3937                        quantifier: crate::grammar::OperandQuantifier::One,
3938                    }]
3939                }
3940                s::ExecutionMode::MaxWorkDimINTEL => vec![crate::grammar::LogicalOperand {
3941                    kind: crate::grammar::OperandKind::LiteralInteger,
3942                    quantifier: crate::grammar::OperandQuantifier::One,
3943                }],
3944                s::ExecutionMode::MaxWorkgroupSizeINTEL => vec![
3945                    crate::grammar::LogicalOperand {
3946                        kind: crate::grammar::OperandKind::LiteralInteger,
3947                        quantifier: crate::grammar::OperandQuantifier::One,
3948                    },
3949                    crate::grammar::LogicalOperand {
3950                        kind: crate::grammar::OperandKind::LiteralInteger,
3951                        quantifier: crate::grammar::OperandQuantifier::One,
3952                    },
3953                    crate::grammar::LogicalOperand {
3954                        kind: crate::grammar::OperandKind::LiteralInteger,
3955                        quantifier: crate::grammar::OperandQuantifier::One,
3956                    },
3957                ],
3958                s::ExecutionMode::SchedulerTargetFmaxMhzINTEL => {
3959                    vec![crate::grammar::LogicalOperand {
3960                        kind: crate::grammar::OperandKind::LiteralInteger,
3961                        quantifier: crate::grammar::OperandQuantifier::One,
3962                    }]
3963                }
3964                s::ExecutionMode::NumSIMDWorkitemsINTEL => vec![crate::grammar::LogicalOperand {
3965                    kind: crate::grammar::OperandKind::LiteralInteger,
3966                    quantifier: crate::grammar::OperandQuantifier::One,
3967                }],
3968                s::ExecutionMode::TileShadingRateQCOM => vec![
3969                    crate::grammar::LogicalOperand {
3970                        kind: crate::grammar::OperandKind::LiteralInteger,
3971                        quantifier: crate::grammar::OperandQuantifier::One,
3972                    },
3973                    crate::grammar::LogicalOperand {
3974                        kind: crate::grammar::OperandKind::LiteralInteger,
3975                        quantifier: crate::grammar::OperandQuantifier::One,
3976                    },
3977                    crate::grammar::LogicalOperand {
3978                        kind: crate::grammar::OperandKind::LiteralInteger,
3979                        quantifier: crate::grammar::OperandQuantifier::One,
3980                    },
3981                ],
3982                s::ExecutionMode::LocalSize | s::ExecutionMode::LocalSizeHint => vec![
3983                    crate::grammar::LogicalOperand {
3984                        kind: crate::grammar::OperandKind::LiteralInteger,
3985                        quantifier: crate::grammar::OperandQuantifier::One,
3986                    },
3987                    crate::grammar::LogicalOperand {
3988                        kind: crate::grammar::OperandKind::LiteralInteger,
3989                        quantifier: crate::grammar::OperandQuantifier::One,
3990                    },
3991                    crate::grammar::LogicalOperand {
3992                        kind: crate::grammar::OperandKind::LiteralInteger,
3993                        quantifier: crate::grammar::OperandQuantifier::One,
3994                    },
3995                ],
3996                s::ExecutionMode::NamedMaximumRegistersINTEL => {
3997                    vec![crate::grammar::LogicalOperand {
3998                        kind: crate::grammar::OperandKind::NamedMaximumNumberOfRegisters,
3999                        quantifier: crate::grammar::OperandQuantifier::One,
4000                    }]
4001                }
4002                _ => vec![],
4003            },
4004            Self::Decoration(v) => match v {
4005                s::Decoration::MMHostInterfaceReadWriteModeALTERA => {
4006                    vec![crate::grammar::LogicalOperand {
4007                        kind: crate::grammar::OperandKind::AccessQualifier,
4008                        quantifier: crate::grammar::OperandQuantifier::One,
4009                    }]
4010                }
4011                s::Decoration::BuiltIn => vec![crate::grammar::LogicalOperand {
4012                    kind: crate::grammar::OperandKind::BuiltIn,
4013                    quantifier: crate::grammar::OperandQuantifier::One,
4014                }],
4015                s::Decoration::FPFastMathMode => vec![crate::grammar::LogicalOperand {
4016                    kind: crate::grammar::OperandKind::FPFastMathMode,
4017                    quantifier: crate::grammar::OperandQuantifier::One,
4018                }],
4019                s::Decoration::FPRoundingMode => vec![crate::grammar::LogicalOperand {
4020                    kind: crate::grammar::OperandKind::FPRoundingMode,
4021                    quantifier: crate::grammar::OperandQuantifier::One,
4022                }],
4023                s::Decoration::FuncParamAttr => vec![crate::grammar::LogicalOperand {
4024                    kind: crate::grammar::OperandKind::FunctionParameterAttribute,
4025                    quantifier: crate::grammar::OperandQuantifier::One,
4026                }],
4027                s::Decoration::HostAccessINTEL => vec![
4028                    crate::grammar::LogicalOperand {
4029                        kind: crate::grammar::OperandKind::HostAccessQualifier,
4030                        quantifier: crate::grammar::OperandQuantifier::One,
4031                    },
4032                    crate::grammar::LogicalOperand {
4033                        kind: crate::grammar::OperandKind::LiteralString,
4034                        quantifier: crate::grammar::OperandQuantifier::One,
4035                    },
4036                ],
4037                s::Decoration::AliasScopeINTEL | s::Decoration::NoAliasINTEL => {
4038                    vec![crate::grammar::LogicalOperand {
4039                        kind: crate::grammar::OperandKind::IdRef,
4040                        quantifier: crate::grammar::OperandQuantifier::One,
4041                    }]
4042                }
4043                s::Decoration::AlignmentId => vec![crate::grammar::LogicalOperand {
4044                    kind: crate::grammar::OperandKind::IdRef,
4045                    quantifier: crate::grammar::OperandQuantifier::One,
4046                }],
4047                s::Decoration::PayloadNodeArraySizeAMDX => vec![crate::grammar::LogicalOperand {
4048                    kind: crate::grammar::OperandKind::IdRef,
4049                    quantifier: crate::grammar::OperandQuantifier::One,
4050                }],
4051                s::Decoration::ArrayStrideIdEXT => vec![crate::grammar::LogicalOperand {
4052                    kind: crate::grammar::OperandKind::IdRef,
4053                    quantifier: crate::grammar::OperandQuantifier::One,
4054                }],
4055                s::Decoration::PayloadNodeBaseIndexAMDX => vec![crate::grammar::LogicalOperand {
4056                    kind: crate::grammar::OperandKind::IdRef,
4057                    quantifier: crate::grammar::OperandQuantifier::One,
4058                }],
4059                s::Decoration::OffsetIdEXT => vec![crate::grammar::LogicalOperand {
4060                    kind: crate::grammar::OperandKind::IdRef,
4061                    quantifier: crate::grammar::OperandQuantifier::One,
4062                }],
4063                s::Decoration::ConditionalINTEL => vec![crate::grammar::LogicalOperand {
4064                    kind: crate::grammar::OperandKind::IdRef,
4065                    quantifier: crate::grammar::OperandQuantifier::One,
4066                }],
4067                s::Decoration::CounterBuffer => vec![crate::grammar::LogicalOperand {
4068                    kind: crate::grammar::OperandKind::IdRef,
4069                    quantifier: crate::grammar::OperandQuantifier::One,
4070                }],
4071                s::Decoration::MaxByteOffsetId => vec![crate::grammar::LogicalOperand {
4072                    kind: crate::grammar::OperandKind::IdRef,
4073                    quantifier: crate::grammar::OperandQuantifier::One,
4074                }],
4075                s::Decoration::NodeMaxPayloadsAMDX => vec![crate::grammar::LogicalOperand {
4076                    kind: crate::grammar::OperandKind::IdRef,
4077                    quantifier: crate::grammar::OperandQuantifier::One,
4078                }],
4079                s::Decoration::PayloadNodeNameAMDX => vec![crate::grammar::LogicalOperand {
4080                    kind: crate::grammar::OperandKind::IdRef,
4081                    quantifier: crate::grammar::OperandQuantifier::One,
4082                }],
4083                s::Decoration::NodeSharesPayloadLimitsWithAMDX => {
4084                    vec![crate::grammar::LogicalOperand {
4085                        kind: crate::grammar::OperandKind::IdRef,
4086                        quantifier: crate::grammar::OperandQuantifier::One,
4087                    }]
4088                }
4089                s::Decoration::UniformId => vec![crate::grammar::LogicalOperand {
4090                    kind: crate::grammar::OperandKind::IdScope,
4091                    quantifier: crate::grammar::OperandQuantifier::One,
4092                }],
4093                s::Decoration::InitModeALTERA => vec![crate::grammar::LogicalOperand {
4094                    kind: crate::grammar::OperandKind::InitializationModeQualifier,
4095                    quantifier: crate::grammar::OperandQuantifier::One,
4096                }],
4097                s::Decoration::FPMaxErrorDecorationINTEL => vec![crate::grammar::LogicalOperand {
4098                    kind: crate::grammar::OperandKind::LiteralFloat,
4099                    quantifier: crate::grammar::OperandQuantifier::One,
4100                }],
4101                s::Decoration::MMHostInterfaceAddressWidthALTERA => {
4102                    vec![crate::grammar::LogicalOperand {
4103                        kind: crate::grammar::OperandKind::LiteralInteger,
4104                        quantifier: crate::grammar::OperandQuantifier::One,
4105                    }]
4106                }
4107                s::Decoration::Alignment => vec![crate::grammar::LogicalOperand {
4108                    kind: crate::grammar::OperandKind::LiteralInteger,
4109                    quantifier: crate::grammar::OperandQuantifier::One,
4110                }],
4111                s::Decoration::ArrayStride => vec![crate::grammar::LogicalOperand {
4112                    kind: crate::grammar::OperandKind::LiteralInteger,
4113                    quantifier: crate::grammar::OperandQuantifier::One,
4114                }],
4115                s::Decoration::InputAttachmentIndex => vec![crate::grammar::LogicalOperand {
4116                    kind: crate::grammar::OperandKind::LiteralInteger,
4117                    quantifier: crate::grammar::OperandQuantifier::One,
4118                }],
4119                s::Decoration::BankNV => vec![crate::grammar::LogicalOperand {
4120                    kind: crate::grammar::OperandKind::LiteralInteger,
4121                    quantifier: crate::grammar::OperandQuantifier::One,
4122                }],
4123                s::Decoration::BankBitsALTERA => vec![crate::grammar::LogicalOperand {
4124                    kind: crate::grammar::OperandKind::LiteralInteger,
4125                    quantifier: crate::grammar::OperandQuantifier::ZeroOrMore,
4126                }],
4127                s::Decoration::BankwidthALTERA => vec![crate::grammar::LogicalOperand {
4128                    kind: crate::grammar::OperandKind::LiteralInteger,
4129                    quantifier: crate::grammar::OperandQuantifier::One,
4130                }],
4131                s::Decoration::NumbanksALTERA => vec![crate::grammar::LogicalOperand {
4132                    kind: crate::grammar::OperandKind::LiteralInteger,
4133                    quantifier: crate::grammar::OperandQuantifier::One,
4134                }],
4135                s::Decoration::Binding => vec![crate::grammar::LogicalOperand {
4136                    kind: crate::grammar::OperandKind::LiteralInteger,
4137                    quantifier: crate::grammar::OperandQuantifier::One,
4138                }],
4139                s::Decoration::BufferLocationALTERA => vec![crate::grammar::LogicalOperand {
4140                    kind: crate::grammar::OperandKind::LiteralInteger,
4141                    quantifier: crate::grammar::OperandQuantifier::One,
4142                }],
4143                s::Decoration::Offset => vec![crate::grammar::LogicalOperand {
4144                    kind: crate::grammar::OperandKind::LiteralInteger,
4145                    quantifier: crate::grammar::OperandQuantifier::One,
4146                }],
4147                s::Decoration::CacheControlLoadINTEL => vec![
4148                    crate::grammar::LogicalOperand {
4149                        kind: crate::grammar::OperandKind::LiteralInteger,
4150                        quantifier: crate::grammar::OperandQuantifier::One,
4151                    },
4152                    crate::grammar::LogicalOperand {
4153                        kind: crate::grammar::OperandKind::LoadCacheControl,
4154                        quantifier: crate::grammar::OperandQuantifier::One,
4155                    },
4156                ],
4157                s::Decoration::CacheControlStoreINTEL => vec![
4158                    crate::grammar::LogicalOperand {
4159                        kind: crate::grammar::OperandKind::LiteralInteger,
4160                        quantifier: crate::grammar::OperandQuantifier::One,
4161                    },
4162                    crate::grammar::LogicalOperand {
4163                        kind: crate::grammar::OperandKind::StoreCacheControl,
4164                        quantifier: crate::grammar::OperandQuantifier::One,
4165                    },
4166                ],
4167                s::Decoration::CacheSizeALTERA => vec![crate::grammar::LogicalOperand {
4168                    kind: crate::grammar::OperandKind::LiteralInteger,
4169                    quantifier: crate::grammar::OperandQuantifier::One,
4170                }],
4171                s::Decoration::Component => vec![crate::grammar::LogicalOperand {
4172                    kind: crate::grammar::OperandKind::LiteralInteger,
4173                    quantifier: crate::grammar::OperandQuantifier::One,
4174                }],
4175                s::Decoration::InitiationIntervalALTERA => vec![crate::grammar::LogicalOperand {
4176                    kind: crate::grammar::OperandKind::LiteralInteger,
4177                    quantifier: crate::grammar::OperandQuantifier::One,
4178                }],
4179                s::Decoration::MMHostInterfaceDataWidthALTERA => {
4180                    vec![crate::grammar::LogicalOperand {
4181                        kind: crate::grammar::OperandKind::LiteralInteger,
4182                        quantifier: crate::grammar::OperandQuantifier::One,
4183                    }]
4184                }
4185                s::Decoration::DescriptorSet => vec![crate::grammar::LogicalOperand {
4186                    kind: crate::grammar::OperandKind::LiteralInteger,
4187                    quantifier: crate::grammar::OperandQuantifier::One,
4188                }],
4189                s::Decoration::PipelineEnableALTERA => vec![crate::grammar::LogicalOperand {
4190                    kind: crate::grammar::OperandKind::LiteralInteger,
4191                    quantifier: crate::grammar::OperandQuantifier::One,
4192                }],
4193                s::Decoration::ForcePow2DepthALTERA => vec![crate::grammar::LogicalOperand {
4194                    kind: crate::grammar::OperandKind::LiteralInteger,
4195                    quantifier: crate::grammar::OperandQuantifier::One,
4196                }],
4197                s::Decoration::IOPipeStorageALTERA => vec![crate::grammar::LogicalOperand {
4198                    kind: crate::grammar::OperandKind::LiteralInteger,
4199                    quantifier: crate::grammar::OperandQuantifier::One,
4200                }],
4201                s::Decoration::Index => vec![crate::grammar::LogicalOperand {
4202                    kind: crate::grammar::OperandKind::LiteralInteger,
4203                    quantifier: crate::grammar::OperandQuantifier::One,
4204                }],
4205                s::Decoration::MaxConcurrencyALTERA => vec![crate::grammar::LogicalOperand {
4206                    kind: crate::grammar::OperandKind::LiteralInteger,
4207                    quantifier: crate::grammar::OperandQuantifier::One,
4208                }],
4209                s::Decoration::FuncParamIOKindINTEL => vec![crate::grammar::LogicalOperand {
4210                    kind: crate::grammar::OperandKind::LiteralInteger,
4211                    quantifier: crate::grammar::OperandQuantifier::One,
4212                }],
4213                s::Decoration::MMHostInterfaceLatencyALTERA => {
4214                    vec![crate::grammar::LogicalOperand {
4215                        kind: crate::grammar::OperandKind::LiteralInteger,
4216                        quantifier: crate::grammar::OperandQuantifier::One,
4217                    }]
4218                }
4219                s::Decoration::LatencyControlLabelALTERA => vec![crate::grammar::LogicalOperand {
4220                    kind: crate::grammar::OperandKind::LiteralInteger,
4221                    quantifier: crate::grammar::OperandQuantifier::One,
4222                }],
4223                s::Decoration::Location => vec![crate::grammar::LogicalOperand {
4224                    kind: crate::grammar::OperandKind::LiteralInteger,
4225                    quantifier: crate::grammar::OperandQuantifier::One,
4226                }],
4227                s::Decoration::MatrixStride => vec![crate::grammar::LogicalOperand {
4228                    kind: crate::grammar::OperandKind::LiteralInteger,
4229                    quantifier: crate::grammar::OperandQuantifier::One,
4230                }],
4231                s::Decoration::MaxByteOffset => vec![crate::grammar::LogicalOperand {
4232                    kind: crate::grammar::OperandKind::LiteralInteger,
4233                    quantifier: crate::grammar::OperandQuantifier::One,
4234                }],
4235                s::Decoration::MMHostInterfaceMaxBurstALTERA => {
4236                    vec![crate::grammar::LogicalOperand {
4237                        kind: crate::grammar::OperandKind::LiteralInteger,
4238                        quantifier: crate::grammar::OperandQuantifier::One,
4239                    }]
4240                }
4241                s::Decoration::MaxPrivateCopiesALTERA => vec![crate::grammar::LogicalOperand {
4242                    kind: crate::grammar::OperandKind::LiteralInteger,
4243                    quantifier: crate::grammar::OperandQuantifier::One,
4244                }],
4245                s::Decoration::MaxReplicatesALTERA => vec![crate::grammar::LogicalOperand {
4246                    kind: crate::grammar::OperandKind::LiteralInteger,
4247                    quantifier: crate::grammar::OperandQuantifier::One,
4248                }],
4249                s::Decoration::MathOpDSPModeALTERA => vec![
4250                    crate::grammar::LogicalOperand {
4251                        kind: crate::grammar::OperandKind::LiteralInteger,
4252                        quantifier: crate::grammar::OperandQuantifier::One,
4253                    },
4254                    crate::grammar::LogicalOperand {
4255                        kind: crate::grammar::OperandKind::LiteralInteger,
4256                        quantifier: crate::grammar::OperandQuantifier::One,
4257                    },
4258                ],
4259                s::Decoration::SIMTCallINTEL => vec![crate::grammar::LogicalOperand {
4260                    kind: crate::grammar::OperandKind::LiteralInteger,
4261                    quantifier: crate::grammar::OperandQuantifier::One,
4262                }],
4263                s::Decoration::SecondaryViewportRelativeNV
4264                | s::Decoration::GlobalVariableOffsetINTEL => {
4265                    vec![crate::grammar::LogicalOperand {
4266                        kind: crate::grammar::OperandKind::LiteralInteger,
4267                        quantifier: crate::grammar::OperandQuantifier::One,
4268                    }]
4269                }
4270                s::Decoration::PrefetchALTERA => vec![crate::grammar::LogicalOperand {
4271                    kind: crate::grammar::OperandKind::LiteralInteger,
4272                    quantifier: crate::grammar::OperandQuantifier::One,
4273                }],
4274                s::Decoration::LatencyControlConstraintALTERA => vec![
4275                    crate::grammar::LogicalOperand {
4276                        kind: crate::grammar::OperandKind::LiteralInteger,
4277                        quantifier: crate::grammar::OperandQuantifier::One,
4278                    },
4279                    crate::grammar::LogicalOperand {
4280                        kind: crate::grammar::OperandKind::LiteralInteger,
4281                        quantifier: crate::grammar::OperandQuantifier::One,
4282                    },
4283                    crate::grammar::LogicalOperand {
4284                        kind: crate::grammar::OperandKind::LiteralInteger,
4285                        quantifier: crate::grammar::OperandQuantifier::One,
4286                    },
4287                ],
4288                s::Decoration::SpecId => vec![crate::grammar::LogicalOperand {
4289                    kind: crate::grammar::OperandKind::LiteralInteger,
4290                    quantifier: crate::grammar::OperandQuantifier::One,
4291                }],
4292                s::Decoration::Stream => vec![crate::grammar::LogicalOperand {
4293                    kind: crate::grammar::OperandKind::LiteralInteger,
4294                    quantifier: crate::grammar::OperandQuantifier::One,
4295                }],
4296                s::Decoration::StridesizeALTERA => vec![crate::grammar::LogicalOperand {
4297                    kind: crate::grammar::OperandKind::LiteralInteger,
4298                    quantifier: crate::grammar::OperandQuantifier::One,
4299                }],
4300                s::Decoration::FunctionDenormModeINTEL => vec![
4301                    crate::grammar::LogicalOperand {
4302                        kind: crate::grammar::OperandKind::LiteralInteger,
4303                        quantifier: crate::grammar::OperandQuantifier::One,
4304                    },
4305                    crate::grammar::LogicalOperand {
4306                        kind: crate::grammar::OperandKind::FPDenormMode,
4307                        quantifier: crate::grammar::OperandQuantifier::One,
4308                    },
4309                ],
4310                s::Decoration::FunctionFloatingPointModeINTEL => vec![
4311                    crate::grammar::LogicalOperand {
4312                        kind: crate::grammar::OperandKind::LiteralInteger,
4313                        quantifier: crate::grammar::OperandQuantifier::One,
4314                    },
4315                    crate::grammar::LogicalOperand {
4316                        kind: crate::grammar::OperandKind::FPOperationMode,
4317                        quantifier: crate::grammar::OperandQuantifier::One,
4318                    },
4319                ],
4320                s::Decoration::FunctionRoundingModeINTEL => vec![
4321                    crate::grammar::LogicalOperand {
4322                        kind: crate::grammar::OperandKind::LiteralInteger,
4323                        quantifier: crate::grammar::OperandQuantifier::One,
4324                    },
4325                    crate::grammar::LogicalOperand {
4326                        kind: crate::grammar::OperandKind::FPRoundingMode,
4327                        quantifier: crate::grammar::OperandQuantifier::One,
4328                    },
4329                ],
4330                s::Decoration::ImplementInRegisterMapALTERA => {
4331                    vec![crate::grammar::LogicalOperand {
4332                        kind: crate::grammar::OperandKind::LiteralInteger,
4333                        quantifier: crate::grammar::OperandQuantifier::One,
4334                    }]
4335                }
4336                s::Decoration::MMHostInterfaceWaitRequestALTERA => {
4337                    vec![crate::grammar::LogicalOperand {
4338                        kind: crate::grammar::OperandKind::LiteralInteger,
4339                        quantifier: crate::grammar::OperandQuantifier::One,
4340                    }]
4341                }
4342                s::Decoration::WordsizeALTERA => vec![crate::grammar::LogicalOperand {
4343                    kind: crate::grammar::OperandKind::LiteralInteger,
4344                    quantifier: crate::grammar::OperandQuantifier::One,
4345                }],
4346                s::Decoration::XfbBuffer => vec![crate::grammar::LogicalOperand {
4347                    kind: crate::grammar::OperandKind::LiteralInteger,
4348                    quantifier: crate::grammar::OperandQuantifier::One,
4349                }],
4350                s::Decoration::XfbStride => vec![crate::grammar::LogicalOperand {
4351                    kind: crate::grammar::OperandKind::LiteralInteger,
4352                    quantifier: crate::grammar::OperandQuantifier::One,
4353                }],
4354                s::Decoration::MemberOffsetNV => vec![crate::grammar::LogicalOperand {
4355                    kind: crate::grammar::OperandKind::LiteralInteger,
4356                    quantifier: crate::grammar::OperandQuantifier::One,
4357                }],
4358                s::Decoration::MemoryALTERA => vec![crate::grammar::LogicalOperand {
4359                    kind: crate::grammar::OperandKind::LiteralString,
4360                    quantifier: crate::grammar::OperandQuantifier::One,
4361                }],
4362                s::Decoration::MergeALTERA => vec![
4363                    crate::grammar::LogicalOperand {
4364                        kind: crate::grammar::OperandKind::LiteralString,
4365                        quantifier: crate::grammar::OperandQuantifier::One,
4366                    },
4367                    crate::grammar::LogicalOperand {
4368                        kind: crate::grammar::OperandKind::LiteralString,
4369                        quantifier: crate::grammar::OperandQuantifier::One,
4370                    },
4371                ],
4372                s::Decoration::LinkageAttributes => vec![
4373                    crate::grammar::LogicalOperand {
4374                        kind: crate::grammar::OperandKind::LiteralString,
4375                        quantifier: crate::grammar::OperandQuantifier::One,
4376                    },
4377                    crate::grammar::LogicalOperand {
4378                        kind: crate::grammar::OperandKind::LinkageType,
4379                        quantifier: crate::grammar::OperandQuantifier::One,
4380                    },
4381                ],
4382                s::Decoration::ClobberINTEL => vec![crate::grammar::LogicalOperand {
4383                    kind: crate::grammar::OperandKind::LiteralString,
4384                    quantifier: crate::grammar::OperandQuantifier::One,
4385                }],
4386                s::Decoration::UserSemantic => vec![crate::grammar::LogicalOperand {
4387                    kind: crate::grammar::OperandKind::LiteralString,
4388                    quantifier: crate::grammar::OperandQuantifier::One,
4389                }],
4390                s::Decoration::UserTypeGOOGLE => vec![crate::grammar::LogicalOperand {
4391                    kind: crate::grammar::OperandKind::LiteralString,
4392                    quantifier: crate::grammar::OperandQuantifier::One,
4393                }],
4394                _ => vec![],
4395            },
4396            Self::TensorAddressingOperands(v) => {
4397                let mut result = vec![];
4398                result.extend(
4399                    [
4400                        s::TensorAddressingOperands::TENSOR_VIEW,
4401                        s::TensorAddressingOperands::DECODE_FUNC,
4402                    ]
4403                    .iter()
4404                    .filter(|arg| v.contains(**arg))
4405                    .flat_map(|_| {
4406                        [crate::grammar::LogicalOperand {
4407                            kind: crate::grammar::OperandKind::IdRef,
4408                            quantifier: crate::grammar::OperandQuantifier::One,
4409                        }]
4410                        .iter()
4411                        .cloned()
4412                    }),
4413                );
4414                result
4415            }
4416            Self::TensorOperands(v) => {
4417                let mut result = vec![];
4418                result.extend(
4419                    [
4420                        s::TensorOperands::OUT_OF_BOUNDS_VALUE_ARM,
4421                        s::TensorOperands::MAKE_ELEMENT_AVAILABLE_ARM,
4422                        s::TensorOperands::MAKE_ELEMENT_VISIBLE_ARM,
4423                    ]
4424                    .iter()
4425                    .filter(|arg| v.contains(**arg))
4426                    .flat_map(|_| {
4427                        [crate::grammar::LogicalOperand {
4428                            kind: crate::grammar::OperandKind::IdRef,
4429                            quantifier: crate::grammar::OperandQuantifier::One,
4430                        }]
4431                        .iter()
4432                        .cloned()
4433                    }),
4434                );
4435                result
4436            }
4437            _ => vec![],
4438        }
4439    }
4440}