mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 08:15:33 +01:00
Merge pull request #6398 from stenzek/bad-files
OGL: Only create bad shader files in Dump when compile failed
This commit is contained in:
commit
b289be43eb
@ -553,9 +553,8 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (compileStatus != GL_TRUE)
|
if (compileStatus != GL_TRUE)
|
||||||
|
{
|
||||||
ERROR_LOG(VIDEO, "%s failed compilation:\n%s", prefix, info_log.c_str());
|
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(
|
std::string filename = StringFromFormat(
|
||||||
"%sbad_%s_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), prefix, num_failures++);
|
"%sbad_%s_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), prefix, num_failures++);
|
||||||
@ -564,21 +563,17 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, const
|
|||||||
file << s_glsl_header << code << info_log;
|
file << s_glsl_header << code << info_log;
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
if (compileStatus != GL_TRUE)
|
|
||||||
{
|
|
||||||
PanicAlert("Failed to compile %s shader: %s\n"
|
PanicAlert("Failed to compile %s shader: %s\n"
|
||||||
"Debug info (%s, %s, %s):\n%s",
|
"Debug info (%s, %s, %s):\n%s",
|
||||||
prefix, filename.c_str(), g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
prefix, filename.c_str(), g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
||||||
g_ogl_config.gl_version, info_log.c_str());
|
g_ogl_config.gl_version, info_log.c_str());
|
||||||
}
|
|
||||||
}
|
|
||||||
if (compileStatus != GL_TRUE)
|
|
||||||
{
|
|
||||||
// Compile failed
|
|
||||||
ERROR_LOG(VIDEO, "Shader compilation failed; see info log");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WARN_LOG(VIDEO, "%s compiled with warnings:\n%s", prefix, info_log.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,12 +589,9 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, const std::string& vc
|
|||||||
std::string info_log;
|
std::string info_log;
|
||||||
info_log.resize(length);
|
info_log.resize(length);
|
||||||
glGetProgramInfoLog(id, length, &length, &info_log[0]);
|
glGetProgramInfoLog(id, length, &length, &info_log[0]);
|
||||||
|
|
||||||
if (linkStatus != GL_TRUE)
|
if (linkStatus != GL_TRUE)
|
||||||
|
{
|
||||||
ERROR_LOG(VIDEO, "Program failed linking:\n%s", info_log.c_str());
|
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 =
|
std::string filename =
|
||||||
StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
|
StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
|
||||||
std::ofstream file;
|
std::ofstream file;
|
||||||
@ -610,8 +602,6 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, const std::string& vc
|
|||||||
file << info_log;
|
file << info_log;
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
if (linkStatus != GL_TRUE)
|
|
||||||
{
|
|
||||||
PanicAlert("Failed to link shaders: %s\n"
|
PanicAlert("Failed to link shaders: %s\n"
|
||||||
"Debug info (%s, %s, %s):\n%s",
|
"Debug info (%s, %s, %s):\n%s",
|
||||||
filename.c_str(), g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
filename.c_str(), g_ogl_config.gl_vendor, g_ogl_config.gl_renderer,
|
||||||
@ -619,6 +609,8 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, const std::string& vc
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WARN_LOG(VIDEO, "Program linked with warnings:\n%s", info_log.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user