How to detect GLSL warnings?

Posted by msell on Game Development See other posts from Game Development or by msell
Published on 2012-06-11T09:36:28Z Indexed on 2012/06/11 10:48 UTC
Read the original article Hit count: 215

Filed under:
|

After compiling a shader with glCompileShader, I can call glGetShaderiv with GL_COMPILE_STATUS to check if the shader compiled successfully. I can also call glGetShaderInfoLog to get information about possible errors, warnings or other info. The information log returned by this function is unspecified.

In a tool where users can write their own shaders, I would like to print all errors and warnings from the compilation, but nothing if no warnings or errors were found. The problem is that the GL_COMPILE_STATUS returns only false if the compilation failed and true otherwise. If no problems were found, some drivers return empty info log from glGetShaderInfoLog, but some drivers can return something else such as "No errors.", which I do not want to print to the user. How is this problem generally solved?

© Game Development or respective owner

Related posts about opengl

Related posts about glsl