1
votes

After compiling a ShaderProgram if it doesn't compile I print the log. However, I can't find a way to tell if the error is in the fragment or vertex shader.

Here I put an error in the frag shader:

0:1(1): error: syntax error, unexpected NEW_IDENTIFIER

This error is in the vert shader:

0:1(1): error: syntax error, unexpected NEW_IDENTIFIER

is there a way to show more detail about where the error is?

Looking at the Libgdx ShaderProgram source I couldn't seem to see one: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShaderProgram.html

1
Libgdx is just passing the log back from the underlying OpenGL driver, its not compiling the shader itself.P.T.
well... obviously, but how can I get indication of which shader its just sent to the driver thats had an error?Chris Camacho

1 Answers

0
votes

Not ideal, but: You can add a blank line at the beginning of one of the two shaders. Then see if the line number for the error changes to determine which one it applies to.