Skip to content
Permalink
Browse files

Add Dolphin version and current video backend to shader compilation logs

  • Loading branch information...
Ebola16 committed Nov 8, 2019
1 parent cc9c158 commit aaac0875bca4160f03ff7a7926be6ef674e7f253
@@ -10,8 +10,11 @@
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Common/Version.h"

#include "VideoBackends/D3DCommon/Shader.h"

#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"

namespace D3DCommon
@@ -105,8 +108,9 @@ std::optional<Shader::BinaryData> Shader::CompileShader(D3D_FEATURE_LEVEL featur
if (FAILED(hr))
{
static int num_failures = 0;
std::string filename = StringFromFormat(
"%sbad_%s_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), target, num_failures++);
std::string filename = StringFromFormat("%sbad_%s_%04i_", File::GetUserPath(D_DUMP_IDX).c_str(),
target, num_failures++) +
Common::scm_rev_str + "_" + g_video_backend->GetDisplayName() + ".txt";
std::ofstream file;
File::OpenFStream(file, filename, std::ios_base::out);
file.write(source.data(), source.size());
@@ -17,6 +17,7 @@
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Common/Version.h"

#include "Core/ConfigManager.h"

@@ -31,6 +32,7 @@
#include "VideoCommon/Statistics.h"
#include "VideoCommon/VertexLoaderManager.h"
#include "VideoCommon/VertexShaderManager.h"
#include "VideoCommon/VideoBackendBase.h"

namespace OGL
{
@@ -356,8 +358,10 @@ bool ProgramShaderCache::CheckShaderCompileResult(GLuint id, GLenum type, std::s
{
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::string filename =
StringFromFormat("%sbad_%s_%04i_", File::GetUserPath(D_DUMP_IDX).c_str(), prefix,
num_failures++) +
Common::scm_rev_str + "_" + g_video_backend->GetDisplayName() + ".txt";
std::ofstream file;
File::OpenFStream(file, filename, std::ios_base::out);
file << s_glsl_header << code << info_log;
@@ -393,7 +397,8 @@ bool ProgramShaderCache::CheckProgramLinkResult(GLuint id, std::string_view vcod
{
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++);
StringFromFormat("%sbad_p_%d_", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++) +
Common::scm_rev_str + "_" + g_video_backend->GetDisplayName() + ".txt";
std::ofstream file;
File::OpenFStream(file, filename, std::ios_base::out);
if (!vcode.empty())
@@ -21,7 +21,9 @@
#include "Common/Logging/Log.h"
#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
#include "Common/Version.h"

#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"

namespace Vulkan::ShaderCompiler
@@ -142,8 +144,9 @@ std::optional<SPIRVCodeVector> CompileShaderToSPV(EShLanguage stage, const char*

auto DumpBadShader = [&](const char* msg) {
static int counter = 0;
std::string filename = StringFromFormat(
"%sbad_%s_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), stage_filename, counter++);
std::string filename = StringFromFormat("%sbad_%s_%04i_", File::GetUserPath(D_DUMP_IDX).c_str(),
stage_filename, counter++) +
Common::scm_rev_str + "_" + g_video_backend->GetDisplayName() + ".txt";

std::ofstream stream;
File::OpenFStream(stream, filename, std::ios_base::out);

0 comments on commit aaac087

Please sign in to comment.
You can’t perform that action at this time.