KhronosGroup / SPIRV-Tools

Apache License 2.0
1.03k stars 542 forks source link

Need to validate that Location is only applied to things that are allowed to have locations #3816

Open gfxstrand opened 3 years ago

gfxstrand commented 3 years ago

The latest SPIR-V spec currently says of the Location decoration:

Only valid for the Input, Output, and UniformConstant Storage Classes.

However, the NV_ray_tracing extension also uses it for ray payloads and callable data which have their own storage classes. This bug is being fixed by https://github.com/KhronosGroup/SPIRV-Registry/pull/80. However, to my knowledge, SPV_NV_ray_tracing shaders aren't failing validation so there is a validation check missing here.

alan-baker commented 3 years ago

Right now the validator checks vertex, tessellation, geometry and fragment stages for correct location and component assignment. I'd be happy to review additions covering ray tracing.