Add Dolphin version and current video backend to shader compilation logs

This commit is contained in:
Ryan Meredith
2020-01-24 03:29:38 -05:00
parent 04e9279f3d
commit e5f6d9320f
5 changed files with 35 additions and 9 deletions

View File

@ -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,9 +144,7 @@ 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 = VideoBackendBase::BadShaderFilename(stage_filename, counter++);
std::ofstream stream;
File::OpenFStream(stream, filename, std::ios_base::out);
if (stream.good())
@ -162,6 +162,10 @@ std::optional<SPIRVCodeVector> CompileShaderToSPV(EShLanguage stage, const char*
}
}
stream << "\n";
stream << "Dolphin Version: " + Common::scm_rev_str + "\n";
stream << "Video Backend: " + g_video_backend->GetDisplayName();
PanicAlert("%s (written to %s)", msg, filename.c_str());
};