Commit b871ebc
committed
Support implicit capability declarations per SPIR-V spec
Per the spec's Capability table "Implicitly Declares" column, declaring
a capability transitively declares its dependencies. For example,
declaring GroupNonUniformArithmetic implicitly declares GroupNonUniform.
Add expand_implicit_capabilities() which computes the transitive closure
using grammar data, matching the C++ validator's RegisterCapability().
Also refactor capabilities.rs:
- Extract validate_capabilities into focused helper functions
- Remove dead code (is_soft_dependency, required_capabilities_for_capability)
- Make internal helpers private (aliases, is_vendor_extension, etc.)
- Rename functions for clarity (required_extension, required_version)
- Deduplicate capability extraction via collect_explicit_capabilities
- Simplify capability_operand and capability_satisfied
- Update tests to expect success for implicit declarations1 parent 8a74989 commit b871ebc
File tree
4 files changed
+380
-504
lines changed- rust/spirv-tools-core/src/validation
- rules
- tests
4 files changed
+380
-504
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
539 | 542 | | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
550 | 546 | | |
551 | 547 | | |
552 | 548 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
| 95 | + | |
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
| |||
911 | 910 | | |
912 | 911 | | |
913 | 912 | | |
914 | | - | |
| 913 | + | |
915 | 914 | | |
916 | 915 | | |
917 | 916 | | |
| |||
0 commit comments