mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 15:55:31 +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
@ -552,31 +552,26 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
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++);
|
|
||||||
std::ofstream file;
|
|
||||||
File::OpenFStream(file, filename, std::ios_base::out);
|
|
||||||
file << s_glsl_header << code << info_log;
|
|
||||||
file.close();
|
|
||||||
|
|
||||||
if (compileStatus != GL_TRUE)
|
if (compileStatus != GL_TRUE)
|
||||||
{
|
{
|
||||||
|
ERROR_LOG(VIDEO, "%s failed compilation:\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++);
|
||||||
|
std::ofstream file;
|
||||||
|
File::OpenFStream(file, filename, std::ios_base::out);
|
||||||
|
file << s_glsl_header << code << info_log;
|
||||||
|
file.close();
|
||||||
|
|
||||||
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());
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (compileStatus != GL_TRUE)
|
WARN_LOG(VIDEO, "%s compiled with warnings:\n%s", prefix, info_log.c_str());
|
||||||
{
|
|
||||||
// Compile failed
|
|
||||||
ERROR_LOG(VIDEO, "Shader compilation failed; see info log");
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -594,24 +589,19 @@ 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)
|
|
||||||
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++);
|
|
||||||
std::ofstream file;
|
|
||||||
File::OpenFStream(file, filename, std::ios_base::out);
|
|
||||||
file << s_glsl_header << vcode << s_glsl_header << pcode;
|
|
||||||
if (!gcode.empty())
|
|
||||||
file << s_glsl_header << gcode;
|
|
||||||
file << info_log;
|
|
||||||
file.close();
|
|
||||||
|
|
||||||
if (linkStatus != GL_TRUE)
|
if (linkStatus != GL_TRUE)
|
||||||
{
|
{
|
||||||
|
ERROR_LOG(VIDEO, "Program failed linking:\n%s", info_log.c_str());
|
||||||
|
std::string filename =
|
||||||
|
StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
|
||||||
|
std::ofstream file;
|
||||||
|
File::OpenFStream(file, filename, std::ios_base::out);
|
||||||
|
file << s_glsl_header << vcode << s_glsl_header << pcode;
|
||||||
|
if (!gcode.empty())
|
||||||
|
file << s_glsl_header << gcode;
|
||||||
|
file << info_log;
|
||||||
|
file.close();
|
||||||
|
|
||||||
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