KhronosGroup / glslang

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

GLSL: Add support for keyword `inline` and `noinline` #3018

Closed chirsz-ever closed 1 year ago

chirsz-ever commented 1 year ago

inline and noinline are reserved keywords in OpenGL GLSL versions 1.40 and OpenGL ES ESSL versions 3.10, which are the lowest version requirement of GL_KHR_vulkan_glsl.

It is very suitable to set Function Control field for an OpFunction instruction when the source code uses inline or noinline.

Would This feature need to update GL_KHR_vulkan_glsl, or introduce a new extension?

greg-lunarg commented 1 year ago

Would This feature need to update GL_KHR_vulkan_glsl, or introduce a new extension?

Yes, one of these would be needed to be able to add support.

jbarnoin commented 5 months ago

@greg-lunarg I've been looking for how to prevent a function being inlined in GLSL and found this issue. I don't quite understand why it was closed as completed above. The spec still lists noinline as a keyword reserved for future use, and trying to use it in code results in a reserved keyword error. I haven't found an extension to allow this either. SPIR-V supports this as of this commit, and so does HLSL, but I can't find anything about GLSL. https://github.com/KhronosGroup/SPIRV-Tools/pull/3858

Was this closed as completed by mistake or is there something else I'm missing?

arcady-lunarg commented 5 months ago

In the end it's a GLSL spec issue, because glslang is the GLSL reference compiler. Since there is no extension specification for this feature, we can't just implement something. You can open an issue in the GLSL repository, or if you want to try your hand at spec writing, you can write an extension spec for this feature.

jbarnoin commented 5 months ago

@arcady-lunarg Right. For now I mostly wanted clarification that this issue wasn't really "completed" in the sense of the keywords now being usable in GLSL / using glslang, despite the closing reason for this issue, to clear up any misunderstanding.

I guess your message provides this clarification for now, for anyone finding this issue who might think the feature has been integrated.

arcady-lunarg commented 5 months ago

I think it's more that we didn't give too much thought to which category of "closed" was being applied when clicking the button.

jbarnoin commented 5 months ago

I figured as much, thanks for clarifying.