Commit 0693158
committed
Fix capability extension validation to use ANY-of semantics
Grammar extension lists for capabilities are alternatives: at least one
of the listed extensions must be present, not all of them. For example,
ShaderViewportIndexLayerEXT can be enabled by either
SPV_EXT_shader_viewport_index_layer OR SPV_NV_viewport_array2.
The previous code iterated all grammar extensions and failed on the
first one not found, effectively requiring ALL extensions. This matches
the C++ behavior which uses HasAnyOfExtensions() to check if any single
extension from the grammar list is present.
Add regression tests for capabilities with alternative extensions.1 parent 38824bc commit 0693158
File tree
2 files changed
+116
-12
lines changed- rust/spirv-tools-core/src/validation
- rules
- tests
2 files changed
+116
-12
lines changedLines changed: 35 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
125 | 131 | | |
126 | | - | |
| 132 | + | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| |||
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
174 | | - | |
175 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
176 | 193 | | |
177 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
178 | 197 | | |
179 | 198 | | |
180 | 199 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
187 | 210 | | |
188 | 211 | | |
189 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30277 | 30277 | | |
30278 | 30278 | | |
30279 | 30279 | | |
| 30280 | + | |
| 30281 | + | |
| 30282 | + | |
| 30283 | + | |
| 30284 | + | |
| 30285 | + | |
| 30286 | + | |
| 30287 | + | |
| 30288 | + | |
| 30289 | + | |
| 30290 | + | |
| 30291 | + | |
| 30292 | + | |
| 30293 | + | |
| 30294 | + | |
| 30295 | + | |
| 30296 | + | |
| 30297 | + | |
| 30298 | + | |
| 30299 | + | |
| 30300 | + | |
| 30301 | + | |
| 30302 | + | |
| 30303 | + | |
| 30304 | + | |
| 30305 | + | |
| 30306 | + | |
| 30307 | + | |
| 30308 | + | |
| 30309 | + | |
| 30310 | + | |
| 30311 | + | |
| 30312 | + | |
| 30313 | + | |
| 30314 | + | |
| 30315 | + | |
| 30316 | + | |
| 30317 | + | |
| 30318 | + | |
| 30319 | + | |
| 30320 | + | |
| 30321 | + | |
| 30322 | + | |
| 30323 | + | |
| 30324 | + | |
| 30325 | + | |
| 30326 | + | |
| 30327 | + | |
| 30328 | + | |
| 30329 | + | |
| 30330 | + | |
| 30331 | + | |
| 30332 | + | |
| 30333 | + | |
| 30334 | + | |
| 30335 | + | |
| 30336 | + | |
| 30337 | + | |
| 30338 | + | |
| 30339 | + | |
| 30340 | + | |
| 30341 | + | |
| 30342 | + | |
| 30343 | + | |
| 30344 | + | |
| 30345 | + | |
| 30346 | + | |
| 30347 | + | |
| 30348 | + | |
| 30349 | + | |
| 30350 | + | |
| 30351 | + | |
| 30352 | + | |
| 30353 | + | |
| 30354 | + | |
| 30355 | + | |
| 30356 | + | |
| 30357 | + | |
| 30358 | + | |
| 30359 | + | |
| 30360 | + | |
0 commit comments