-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
ImGui Shaders failing to compile #8104
Comments
Are you sure you used the right syntax? The string should be e.g. "#version 430 core".
Ah. At this point the issue to debug is why does glCreateShader() returns a valid handle in your setup? you may investigate and debug that without even using most of imgui_impl_opengl3.cpp code. May add a dummy Because OpenGL symbols are loaded differently depending on the compilation unit (the path to call |
Hey, thanks for the help on where to begin debugging! :D |
Version/Branch of Dear ImGui:
Version 1.91.0, Branch: master
Back-ends:
imgui_impl_Glfw.cpp + imgui_impl_OpenGL3.cpp
Compiler, OS:
Gcc, Windows 11
Full config/build information:
No response
Details:
This is the error I am receiving :
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile vertex shader! With GLSL: #version 130
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile fragment shader! With GLSL: #version 130
ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link shader program! With GLSL #version 130
Here's my setup :
Here is my ImGui init :
Here's the ImGui loop that is called inside my main render loop :
Here's the main render loop :
The error happens when this fct is called ImGui_ImplOpenGL3_NewFrame();
the debug trail takes me into a portion of imgui where shaders are being compiled and linked into a program. afaik this is supposed to happen, however I'm getting the errors shown above.
I have tried Replacing nullptr with glsl version strings (tried 430 core, 330 core, 330, 430, etc. )
My internet research has not provided me with many other potential solutions.
Thanks, AzureFarer
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
EDIT :
I found this difference in debugging a working version from my current version.
In the ImGui_ImplOpenGL3_CreateDeviceObjects() function, when creating GLuint shader handles, the glCreateShader will return a value.
In the broken version, glCreateShader returns a value of 0 & 0 respectively for the VS and FS, indicating something went wrong during creation of the shader objs.
In the working version, glCreateShader returns a value of 7 & 8 respectively for the VS and FS.
The text was updated successfully, but these errors were encountered: