Fix cases where GL_INFO_LOG_LENGTH returns 0.
This commit is contained in:
parent
b49114bad6
commit
990a8baf1b
|
@ -140,8 +140,11 @@ bool GL4Shader::CompileProgram() {
|
|||
GLint log_length = 0;
|
||||
glGetProgramiv(program_, GL_INFO_LOG_LENGTH, &log_length);
|
||||
std::string info_log;
|
||||
info_log.resize(log_length - 1);
|
||||
glGetProgramInfoLog(program_, log_length, &log_length, &info_log[0]);
|
||||
if (log_length > 0) {
|
||||
info_log.resize(log_length - 1);
|
||||
glGetProgramInfoLog(program_, log_length, &log_length, &info_log[0]);
|
||||
}
|
||||
|
||||
if (!info_log.empty()) {
|
||||
XELOGD("Shader log: %s", info_log.c_str());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue