Shader translator do not handle shaders without `main`
at: https://github.com/ptitSeb/gl4es/commit/f5dda93ac7eaf1e3a44b1ee5585a6bf61d0656c5 Found by: wined3d (GLSL backend) + https://github.com/google/angle/commit/4a4ae726c449b719fc3d2ff258c0cded8adb07bd (Vulkan backend) on Win32
On desktop GL, shaders are allowed to compiled multiple compilation units. GLSLang 4.60 spec says:
The function main is used as the entry point to a shader executable. A shader need not contain a function named main, but one shader in a set of shaders linked together to form a single shader executable must, or a link-time error results.
It is not true for ESSL; ESSL spec says:
All shaders must define a function named main.
One idea to fix this is just defer compilation to link time and concat sources before compile. I have prototyped such implementation https://github.com/okuoku/gl4es/commit/9382fa18471b8533012838b918db5592ebe5e21f and confirmed it can flawlessly execute wined3d generated GLSL shaders on Vulkan backend of ANGLE. Although it is still allowed to detect any compilation error on link time, deferring every compilation might be overkill so I guess we should have a bit better solution e.g.) make it behind environment variable or something.
Nice one. I was thinking of something similar but never started working on that. I'll gladly merge a PR on that :)