Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce naming conventions for aliased tokens #429

Closed
alan-baker opened this issue May 8, 2024 · 1 comment · Fixed by #432
Closed

Enforce naming conventions for aliased tokens #429

alan-baker opened this issue May 8, 2024 · 1 comment · Fixed by #432

Comments

@alan-baker
Copy link
Contributor

Currently the grammar file has duplicate entries for when tokens from extensions are promoted to KHR or core. #426 added some utility methods for getting the names of enumerants. We should ensure to always follow a convention preferring the "highest" priority suffix:

  1. No suffix (core)
  2. KHR
  3. EXT
  4. Vendor

The best way to do this would be to modify the grammar to satisfy this ranking and enforce it via our build checks.

This is related to #138, but easier to act on until we resolve the larger aliasing question.

@alan-baker
Copy link
Contributor Author

Ran across a current instance of this for reference. In the BuiltIn enumerants:

        {
          "enumerant" : "RayTmaxNV",
          "value" : 5326,
          "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
          "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
          "version" : "None"
        },
        {
          "enumerant" : "RayTmaxKHR",
          "value" : 5326,
          "capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
          "extensions" : [ "SPV_NV_ray_tracing" , "SPV_KHR_ray_tracing" ],
          "version" : "None"
        },

alan-baker added a commit to alan-baker/SPIRV-Headers that referenced this issue May 29, 2024
Fixes KhronosGroup#429

* Enforce Core -> KHR -> EXT -> Vendor conventions for aliased names
* Update grammar to satisfy these conventions and regenerate headers
bashbaug pushed a commit that referenced this issue Jun 5, 2024
* Enforce grammar naming conventions for aliases

Fixes #429

* Enforce Core -> KHR -> EXT -> Vendor conventions for aliased names
* Update grammar to satisfy these conventions and regenerate headers

* Prevent duplicate (token,name) pairs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants