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

GL Shader compilation error not shown if OpenGL doesn't provide an error log #927

Open
TLAliceDev opened this issue Oct 26, 2023 · 0 comments

Comments

@TLAliceDev
Copy link

I'm trying out sokol for the first time. While trying to create my pipeline, I was getting a shader missing or invalid error, despite having the shader field in the desc filled properly with a shader created through sokol-shdc.
Since that error was only reporting about pipeline creation it took me quite a while to figure out where the problem was. After some debugging I eventually found that it was during shader compilation, and that the reason I was not receiving any errors about it was because the opengl shader information log was empty, meaning that _SG_ERROR(GL_SHADER_COMPILATION_FAILED) never got called.
After finding that out, I pretty quickly realised that i had simply forgotten to give my SDL window the opengl flag. A pretty simple error that took me close to 2 days to work out due to the lack of error messages.
The fact that _SG_ERROR(GL_SHADER_COMPILATION_FAILED) is only called in the if (log_len > 0) block feels like an oversight and I believe it would be helpful to other people who might come across similar situations if the error was brought up to just above that block.

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

1 participant