Skip to content

Commit

Permalink
Validate enums have sensible versions and are visible (#369)
Browse files Browse the repository at this point in the history
* Validate enums have a sensible versions and are visible

Add version field for each eumerant.

For capabilities and instructions introduced by an extension (its
first version is "None"):
- the capability should be guarded by an extension
- the instruction should be guarded by a capability.

Other enums are presumed guarded transitiviely by use as an operand
to an instruction or another operand.

Fixes: #278, #368

* Fix capability logic, and check more cases

For capabilities, only check for lack of an extension.
If capability X lists capabilities Y and Z, those are not guards *for*
X, but rather when X is enabled it also implicitly enables Y and Z.

Also, an instruction that is *not* in a core SPIR-V version
must not be directly enabled by *both* and extension and a capability.
There are 78 existing cases that break this rule, so grandparent them
in with an allow-list.

* Add "version": "None" to enums added for a recent extension

Add it for the HostAccessQualifier enums from
SPV_INTEL_global_variable_host_access
  • Loading branch information
dneto0 authored Aug 23, 2023
1 parent b8b9eb8 commit d790ced
Show file tree
Hide file tree
Showing 3 changed files with 1,552 additions and 675 deletions.
Loading

0 comments on commit d790ced

Please sign in to comment.