KhronosGroup / glslang

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

Fix an issue of getExtBuiltins() #3551

Closed amdrexu closed 3 months ago

amdrexu commented 3 months ago

This function is used to import SPIR-V extended instruction set. It mistakenly treated the name of SPIR-V extended instruction set as the name of SPIR-V extension. For example, when we have such code

getExtBuiltins("NonSemantic.DebugBreak")

'NonSemantic.DebugBreak' is added to SPIR-V extension. Rather, the SPIR-V extension name is 'SPV_KHR_non_semantics_info'. Therefore, we should avoid this since the name of SPIR-V extended instruction set is not necessarily equal to that of relevant SPIR-V extension. Adding a SPIR-V extension must be done by calling addExtension() explicitly.

arcady-lunarg commented 3 months ago

Could you add a test for this? Maybe using the DebugBreak instruction, it would be a good demonstration too.

amdrexu commented 3 months ago

Could you add a test for this? Maybe using the DebugBreak instruction, it would be a good demonstration too.

Sure. I will add it.