When I compile a broken GLSL shader then the NVidia driver gives me error messages like this:
0(102) : error C1008: undefined variable "vec"
I know the number inside the brackets is the line number. I wonder what the 0
at the beginning of the error message means. I hoped it would be the index in the sources array which is passed to glShaderSource
but that's not the case. It's always 0
. Does someone know what this first number means?
And is there some official standard for the error message format so I'm able to parse the line number from it or do other OpenGL implementations use other formats? I only have access to NVidia hardware so I can't check how the error messages are looking like when using AMD or Intel hardware.
It is a file name, which you can't specify via GL API, so it is 0.
You can set it with #line num filename
preprocessor command right within shader code. Could be helpful if your shader is constructed from many files with #include
s via external preprocessor (before passing source to GL).
There is no standard for messages. Everyone doing whatever they want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With