rspirv/binary/
autogen_error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
// AUTOMATICALLY GENERATED from the SPIR-V JSON grammar:
//   external/spirv.core.grammar.json.
// DO NOT MODIFY!

use std::{error, fmt};
#[doc = "Decoder Error"]
#[derive(Debug, PartialEq, Eq)]
#[allow(clippy::upper_case_acronyms)]
pub enum Error {
    StreamExpected(usize),
    LimitReached(usize),
    ImageOperandsUnknown(usize, spirv::Word),
    FPFastMathModeUnknown(usize, spirv::Word),
    SelectionControlUnknown(usize, spirv::Word),
    LoopControlUnknown(usize, spirv::Word),
    FunctionControlUnknown(usize, spirv::Word),
    MemorySemanticsUnknown(usize, spirv::Word),
    MemoryAccessUnknown(usize, spirv::Word),
    KernelProfilingInfoUnknown(usize, spirv::Word),
    RayFlagsUnknown(usize, spirv::Word),
    FragmentShadingRateUnknown(usize, spirv::Word),
    SourceLanguageUnknown(usize, spirv::Word),
    ExecutionModelUnknown(usize, spirv::Word),
    AddressingModelUnknown(usize, spirv::Word),
    MemoryModelUnknown(usize, spirv::Word),
    ExecutionModeUnknown(usize, spirv::Word),
    StorageClassUnknown(usize, spirv::Word),
    DimUnknown(usize, spirv::Word),
    SamplerAddressingModeUnknown(usize, spirv::Word),
    SamplerFilterModeUnknown(usize, spirv::Word),
    ImageFormatUnknown(usize, spirv::Word),
    ImageChannelOrderUnknown(usize, spirv::Word),
    ImageChannelDataTypeUnknown(usize, spirv::Word),
    FPRoundingModeUnknown(usize, spirv::Word),
    FPDenormModeUnknown(usize, spirv::Word),
    QuantizationModesUnknown(usize, spirv::Word),
    FPOperationModeUnknown(usize, spirv::Word),
    OverflowModesUnknown(usize, spirv::Word),
    LinkageTypeUnknown(usize, spirv::Word),
    AccessQualifierUnknown(usize, spirv::Word),
    HostAccessQualifierUnknown(usize, spirv::Word),
    FunctionParameterAttributeUnknown(usize, spirv::Word),
    DecorationUnknown(usize, spirv::Word),
    BuiltInUnknown(usize, spirv::Word),
    ScopeUnknown(usize, spirv::Word),
    GroupOperationUnknown(usize, spirv::Word),
    KernelEnqueueFlagsUnknown(usize, spirv::Word),
    CapabilityUnknown(usize, spirv::Word),
    RayQueryIntersectionUnknown(usize, spirv::Word),
    RayQueryCommittedIntersectionTypeUnknown(usize, spirv::Word),
    RayQueryCandidateIntersectionTypeUnknown(usize, spirv::Word),
    PackedVectorFormatUnknown(usize, spirv::Word),
    CooperativeMatrixOperandsUnknown(usize, spirv::Word),
    CooperativeMatrixLayoutUnknown(usize, spirv::Word),
    CooperativeMatrixUseUnknown(usize, spirv::Word),
    InitializationModeQualifierUnknown(usize, spirv::Word),
    LoadCacheControlUnknown(usize, spirv::Word),
    StoreCacheControlUnknown(usize, spirv::Word),
    #[doc = r"Failed to decode a string."]
    #[doc = r""]
    #[doc = r"For structured error handling, the second element could be"]
    #[doc = r"`string::FromUtf8Error`, but the will prohibit the compiler"]
    #[doc = r"from generating `PartialEq` for this enum."]
    DecodeStringFailed(usize, String),
}
impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            Error::StreamExpected(index) => {
                write!(f, "expected more bytes in the stream at index {}", index)
            }
            Error::LimitReached(index) => write!(f, "reached word limit at index {}", index),
            Error::ImageOperandsUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind ImageOperands at index {}",
                word, index
            ),
            Error::FPFastMathModeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind FPFastMathMode at index {}",
                word, index
            ),
            Error::SelectionControlUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind SelectionControl at index {}",
                word, index
            ),
            Error::LoopControlUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind LoopControl at index {}",
                word, index
            ),
            Error::FunctionControlUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind FunctionControl at index {}",
                word, index
            ),
            Error::MemorySemanticsUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind MemorySemantics at index {}",
                word, index
            ),
            Error::MemoryAccessUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind MemoryAccess at index {}",
                word, index
            ),
            Error::KernelProfilingInfoUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind KernelProfilingInfo at index {}",
                word, index
            ),
            Error::RayFlagsUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind RayFlags at index {}",
                word, index
            ),
            Error::FragmentShadingRateUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind FragmentShadingRate at index {}",
                word, index
            ),
            Error::SourceLanguageUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind SourceLanguage at index {}",
                word, index
            ),
            Error::ExecutionModelUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind ExecutionModel at index {}",
                word, index
            ),
            Error::AddressingModelUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind AddressingModel at index {}",
                word, index
            ),
            Error::MemoryModelUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind MemoryModel at index {}",
                word, index
            ),
            Error::ExecutionModeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind ExecutionMode at index {}",
                word, index
            ),
            Error::StorageClassUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind StorageClass at index {}",
                word, index
            ),
            Error::DimUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind Dim at index {}",
                word, index
            ),
            Error::SamplerAddressingModeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind SamplerAddressingMode at index {}",
                word, index
            ),
            Error::SamplerFilterModeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind SamplerFilterMode at index {}",
                word, index
            ),
            Error::ImageFormatUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind ImageFormat at index {}",
                word, index
            ),
            Error::ImageChannelOrderUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind ImageChannelOrder at index {}",
                word, index
            ),
            Error::ImageChannelDataTypeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind ImageChannelDataType at index {}",
                word, index
            ),
            Error::FPRoundingModeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind FPRoundingMode at index {}",
                word, index
            ),
            Error::FPDenormModeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind FPDenormMode at index {}",
                word, index
            ),
            Error::QuantizationModesUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind QuantizationModes at index {}",
                word, index
            ),
            Error::FPOperationModeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind FPOperationMode at index {}",
                word, index
            ),
            Error::OverflowModesUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind OverflowModes at index {}",
                word, index
            ),
            Error::LinkageTypeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind LinkageType at index {}",
                word, index
            ),
            Error::AccessQualifierUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind AccessQualifier at index {}",
                word, index
            ),
            Error::HostAccessQualifierUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind HostAccessQualifier at index {}",
                word, index
            ),
            Error::FunctionParameterAttributeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind FunctionParameterAttribute at index {}",
                word, index
            ),
            Error::DecorationUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind Decoration at index {}",
                word, index
            ),
            Error::BuiltInUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind BuiltIn at index {}",
                word, index
            ),
            Error::ScopeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind Scope at index {}",
                word, index
            ),
            Error::GroupOperationUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind GroupOperation at index {}",
                word, index
            ),
            Error::KernelEnqueueFlagsUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind KernelEnqueueFlags at index {}",
                word, index
            ),
            Error::CapabilityUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind Capability at index {}",
                word, index
            ),
            Error::RayQueryIntersectionUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind RayQueryIntersection at index {}",
                word, index
            ),
            Error::RayQueryCommittedIntersectionTypeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind RayQueryCommittedIntersectionType at index {}",
                word, index
            ),
            Error::RayQueryCandidateIntersectionTypeUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind RayQueryCandidateIntersectionType at index {}",
                word, index
            ),
            Error::PackedVectorFormatUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind PackedVectorFormat at index {}",
                word, index
            ),
            Error::CooperativeMatrixOperandsUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind CooperativeMatrixOperands at index {}",
                word, index
            ),
            Error::CooperativeMatrixLayoutUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind CooperativeMatrixLayout at index {}",
                word, index
            ),
            Error::CooperativeMatrixUseUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind CooperativeMatrixUse at index {}",
                word, index
            ),
            Error::InitializationModeQualifierUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind InitializationModeQualifier at index {}",
                word, index
            ),
            Error::LoadCacheControlUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind LoadCacheControl at index {}",
                word, index
            ),
            Error::StoreCacheControlUnknown(index, word) => write!(
                f,
                "unknown value {} for operand kind StoreCacheControl at index {}",
                word, index
            ),
            Error::DecodeStringFailed(index, ref e) => {
                write!(f, "cannot decode string at index {}: {}", index, e)
            }
        }
    }
}
impl error::Error for Error {}