From 990a8baf1b3523aed8f85f6ae78c5ba8e6deaa8c Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Tue, 22 Dec 2015 20:15:07 -0600 Subject: [PATCH] Fix cases where GL_INFO_LOG_LENGTH returns 0. --- src/xenia/gpu/gl4/gl4_shader.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/gl4/gl4_shader.cc b/src/xenia/gpu/gl4/gl4_shader.cc index 2079772ef..d461cbfd2 100644 --- a/src/xenia/gpu/gl4/gl4_shader.cc +++ b/src/xenia/gpu/gl4/gl4_shader.cc @@ -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()); }