KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.91k stars 817 forks source link

Output 8 and 16 bit capabilities OpSpecConstantOp #3452

Closed ncesario-lunarg closed 7 months ago

ncesario-lunarg commented 7 months ago

OpSpecConstants with 8 or 16 width types require the corresponding capabilities.

Closes #3449.

For reference, here's the validation error that's currently being triggered by the existing code: https://github.com/KhronosGroup/SPIRV-Tools/blob/e03c8f5c8ed77f0b1a2408d55bb8f00a7ee9793c/source/val/validate_constants.cpp#L456-L463.

ncesario-lunarg commented 7 months ago

There is some code in GlslangToSpv.cpp that is supposed to be adding these capabilities but I think this is the right place to do so rather than trying to catch all the paths through which createSpecConstantOp can be called.

Yeah, this seemed "correct" to me, but at the same time there is probably an opportunity for consolidation in the future (e.g., common "constant code").