fix: init_single_program check linking status
This commit is contained in:
@@ -462,6 +462,8 @@ static bool init_single_program(ShaderProgram *program, unsigned int i,
|
|||||||
unsigned int index2;
|
unsigned int index2;
|
||||||
char name[STR_LEN];
|
char name[STR_LEN];
|
||||||
const char *prefix;
|
const char *prefix;
|
||||||
|
GLint link_status;
|
||||||
|
char link_log[STR_LEN];
|
||||||
|
|
||||||
program->programs[i] = glCreateProgram();
|
program->programs[i] = glCreateProgram();
|
||||||
if (check_glerror(program, "init_single_program/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;
|
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
|
// create uniforms pointers
|
||||||
program->itime_locations[i] = glGetUniformLocation(
|
program->itime_locations[i] = glGetUniformLocation(
|
||||||
program->programs[i],
|
program->programs[i],
|
||||||
|
|||||||
Reference in New Issue
Block a user