diff options
| author | Stenzek <stenzek@gmail.com> | 2018-02-09 20:59:56 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-02-22 19:08:54 +1000 |
| commit | 052d78bcb1bfafb2b4d17775ae0070496ba9e3ea (patch) | |
| tree | d2ac6c49c34e664d829c5f9e94eaa2d1f2bd2cd1 /Source | |
| parent | 3fd4142f361bd6af2c147faf48e1d1d62d170067 (diff) | |
OGL: Log warnings from shader compiles, even if it compiled successfully
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index 6bb32d4179..80c30e1f92 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -485,8 +485,7 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, const glGetShaderiv(id, GL_COMPILE_STATUS, &compileStatus); GLsizei length = 0; glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length); - - if (compileStatus != GL_TRUE || (length > 1 && DEBUG_GLSL)) + if (compileStatus != GL_TRUE || length > 1) { std::string info_log; info_log.resize(length); @@ -509,7 +508,10 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, const break; } - ERROR_LOG(VIDEO, "%s Shader info log:\n%s", prefix, info_log.c_str()); + if (compileStatus != GL_TRUE) + ERROR_LOG(VIDEO, "%s failed compilation:\n%s", prefix, info_log.c_str()); + else + WARN_LOG(VIDEO, "%s compiled with warnings:\n%s", prefix, info_log.c_str()); std::string filename = StringFromFormat( "%sbad_%s_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), prefix, num_failures++); @@ -543,12 +545,16 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, const std::string& vc glGetProgramiv(id, GL_LINK_STATUS, &linkStatus); GLsizei length = 0; glGetProgramiv(id, GL_INFO_LOG_LENGTH, &length); - if (linkStatus != GL_TRUE || (length > 1 && DEBUG_GLSL)) + if (linkStatus != GL_TRUE || length > 1) { std::string info_log; info_log.resize(length); glGetProgramInfoLog(id, length, &length, &info_log[0]); - ERROR_LOG(VIDEO, "Program info log:\n%s", info_log.c_str()); + + if (linkStatus != GL_TRUE) + ERROR_LOG(VIDEO, "Program failed linking:\n%s", info_log.c_str()); + else + WARN_LOG(VIDEO, "Program linked with warnings:\n%s", info_log.c_str()); std::string filename = StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++); |
