fix: init_single_program check linking status

This commit is contained in:
2026-05-16 16:00:39 +02:00
parent aa8d6c85c0
commit 20e3d39963
+15
View File
@@ -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],