You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are multiple subjects. (See #605 as a related issue.)
Legal GLSL
It is illegal GLSL to not have the source code have "void main()" as the entry point. SPIR-V for Vulkan/OpenGL did not change that rule.
Renaming the SPIR-V entry point
You should be able to use the following to rename the GLSL entry point to a different SPIR-V entry point:
glslangValidator -e myEntry --source-entrypoint main ...
Compile-time versus link-time with multiple compilation units
Lacking main as an entry point is a link-time error, not a compile-time error, and your shader uses a desktop version, which allows multiple compilation units (as in, the entry point could still be in another compilation).
Both the -H and -V options implicitly request the link for you, but you need to provide all the compilation units together, as SPIR-V for graphics has only one compilation unit per stage, so multiple GLSL compilation units are turned into a single SPIR-V compilation unit in one go.
-o
It looks like when -o was added, it did not also implicitly link. I can see that going either way, depending on whether you want it to act like other tools making just one of many compilation units, or do what SPIR-V for graphics actually needs today.
This is prompted by google/shaderc#860
With this GLSL shader:
I tried:
and got this error:
If I use -H instead of -o a.spv then it does emit sensible output:
So there's a discrepancy between -H and -o.
But also the person in the Shaderc issue was suggesting --sep would be useful for GLSL compilation.
The text was updated successfully, but these errors were encountered: