Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader translator do not handle shaders without main #408

Open
okuoku opened this issue Jan 2, 2023 · 1 comment
Open

Shader translator do not handle shaders without main #408

okuoku opened this issue Jan 2, 2023 · 1 comment

Comments

@okuoku
Copy link
Contributor

okuoku commented Jan 2, 2023

at: f5dda93
Found by: wined3d (GLSL backend) + google/angle@4a4ae72 (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 okuoku@9382fa1 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.

@ptitSeb
Copy link
Owner

ptitSeb commented Jan 2, 2023

Nice one. I was thinking of something similar but never started working on that. I'll gladly merge a PR on that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants