Is there any official way to get/substitute the index of the source-string that was passed to ShaderSource(…) in the log-string that gets
returned by GetShaderInfoLog? For some time I was able to rely on that Nvidia-drivers prefixed error-messages with "%SourceIndex(%LineNumber)"and ATI with “ERROR: %SourceIndex:%LineNumber”. But suddenly all Errors-messages are prefixed with 0(%LineNumber) referring to some concatenated source that never was passed to gl in that way which makes finding the Point of error unnecessary difficult.
And by the way: Do other Vendor’s Drivers produce similar Output?
All error messages on which platform?
Windows 8 64-bit using 310.90 Nvidia Drivers.
The following Fragment can be used to reproduce:
const char* sources[] = {
"#define NOT_EMPTY
",
"#if (__FILE__ == 0 )
"
"#error \"File\"
"
"#endif
",
"void main() {}
"
};
char logBuffer[1000];
GLint status;
GLuint shader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(shader, 3, sources, 0);
glCompileShader(shader);
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
if(status != GL_TRUE) {
glGetShaderInfoLog(shader, 1000, 0, logBuffer);
printf("%s
", logBuffer);
}
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.