KhronosGroup/SPIRV-Headers

Execution Model Enum values repeated in the grammar.json

jjfumero opened this issue · 1 comments

I noticed that, from SPIRV 1.5 there are some values repeated for some enum types.

For example:

https://github.com/KhronosGroup/SPIRV-Headers/blob/master/include/spirv/unified1/spirv.core.grammar.json#L9298-L9369

RayGenerationNV and RayGenerationKHR have the same value 5313. Is this correct? If they have the same value, what's the purpose if this differentiation in the name? Any pointers will be appreciated.

Similar for StorageClass and a few others:
https://github.com/KhronosGroup/SPIRV-Headers/blob/master/include/spirv/unified1/spirv.core.grammar.json#L9299-L9368

RayGenerationNV and RayGenerationKHR have the same value 5313. Is this correct? If they have the same value, what's the purpose if this differentiation in the name? Any pointers will be appreciated.

Yes this is correct. When an extension is promoted (from vendor to KHR, vendor to core, or KHR to core, etc), if the functionality is the same, we use the same tokens and just add a new spelling (alias) for the token name. It would be weird to use NV suffixed tokens in the KHR extension, for example.