Merge pull request #1682 from DDRBoxman/glshader

libobs-opengl: Log shader compiler errors
This commit is contained in:
Colin Edwards 2019-03-03 21:29:25 -06:00 committed by GitHub
commit f2c0bd54cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,8 +220,20 @@ static bool gl_shader_init(struct gs_shader *shader,
if (!gl_success("glGetShaderiv"))
return false;
if (!compiled)
if (!compiled) {
GLint infoLength = 0;
glGetShaderiv(shader->obj, GL_INFO_LOG_LENGTH, &infoLength);
char *infoLog = malloc(sizeof(char) * infoLength);
GLsizei returnedLength = 0;
glGetShaderInfoLog(shader->obj, infoLength, &returnedLength, infoLog);
blog(LOG_ERROR, "Error compiling shader:\n%s\n", infoLog);
free(infoLog);
success = false;
}
gl_get_shader_info(shader->obj, file, error_string);