debug: Fix shader dumping (#1466)

This commit is contained in:
Crementif 2025-01-04 20:38:42 +01:00 committed by GitHub
parent 1e30d72658
commit 4b792aa4d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 9 deletions

View file

@ -451,9 +451,8 @@ void LatteShader_DumpShader(uint64 baseHash, uint64 auxHash, LatteDecompilerShad
suffix = "gs"; suffix = "gs";
else if (shader->shaderType == LatteConst::ShaderType::Pixel) else if (shader->shaderType == LatteConst::ShaderType::Pixel)
suffix = "ps"; suffix = "ps";
fs::path dumpPath = "dump/shaders";
dumpPath /= fmt::format("{:016x}_{:016x}_{}.txt", baseHash, auxHash, suffix); FileStream* fs = FileStream::createFile2(ActiveSettings::GetUserDataPath("dump/shaders/{:016x}_{:016x}_{}.txt", baseHash, auxHash, suffix));
FileStream* fs = FileStream::createFile2(dumpPath);
if (fs) if (fs)
{ {
if (shader->strBuf_shaderSource) if (shader->strBuf_shaderSource)
@ -479,9 +478,8 @@ void LatteShader_DumpRawShader(uint64 baseHash, uint64 auxHash, uint32 type, uin
suffix = "copy"; suffix = "copy";
else if (type == SHADER_DUMP_TYPE_COMPUTE) else if (type == SHADER_DUMP_TYPE_COMPUTE)
suffix = "compute"; suffix = "compute";
fs::path dumpPath = "dump/shaders";
dumpPath /= fmt::format("{:016x}_{:016x}_{}.bin", baseHash, auxHash, suffix); FileStream* fs = FileStream::createFile2(ActiveSettings::GetUserDataPath("dump/shaders/{:016x}_{:016x}_{}.bin", baseHash, auxHash, suffix));
FileStream* fs = FileStream::createFile2(dumpPath);
if (fs) if (fs)
{ {
fs->writeData(programCode, programLen); fs->writeData(programCode, programLen);

View file

@ -1113,9 +1113,7 @@ void MainWindow::OnDebugDumpUsedShaders(wxCommandEvent& event)
{ {
try try
{ {
// create directory fs::create_directories(ActiveSettings::GetUserDataPath("dump/shaders"));
const fs::path path(ActiveSettings::GetUserDataPath());
fs::create_directories(path / "dump" / "shaders");
} }
catch (const std::exception & ex) catch (const std::exception & ex)
{ {