diff --git a/src/shaders.c b/src/shaders.c index 837e049..7aa0f97 100644 --- a/src/shaders.c +++ b/src/shaders.c @@ -462,6 +462,8 @@ static bool init_single_program(ShaderProgram *program, unsigned int i, unsigned int index2; char name[STR_LEN]; const char *prefix; + GLint link_status; + char link_log[STR_LEN]; program->programs[i] = glCreateProgram(); if (check_glerror(program, "init_single_program/glCreateProgram")) { @@ -479,6 +481,19 @@ static bool init_single_program(ShaderProgram *program, unsigned int i, return false; } + glGetProgramiv(program->programs[i], GL_LINK_STATUS, &link_status); + if (check_glerror(program, "init_single_program/glGetProgramiv")) { + return false; + } + if (link_status != GL_TRUE) { + glGetProgramInfoLog(program->programs[i], STR_LEN, NULL, link_log); + if (check_glerror(program, "init_single_program/glGetProgramInfoLog")) { + return false; + } + log_error("Program %d link error: %s", i + 1, link_log); + return false; + } + // create uniforms pointers program->itime_locations[i] = glGetUniformLocation( program->programs[i],