1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 16:29:16 +01:00

[d3d11] Avoid querying environment variables on shader creation

This commit is contained in:
Philip Rebohle 2022-10-24 17:58:57 +02:00
parent fea86ef116
commit b055c2daea
3 changed files with 7 additions and 1 deletions

View File

@ -67,6 +67,9 @@ namespace dxvk {
} }
} }
} }
// Shader dump path is only available via an environment variable
this->shaderDumpPath = env::getEnvVar("DXVK_SHADER_DUMP_PATH");
} }
} }

View File

@ -116,6 +116,9 @@ namespace dxvk {
/// useful for debugging purposes or when applications have /// useful for debugging purposes or when applications have
/// race conditions. /// race conditions.
bool enableContextLock; bool enableContextLock;
/// Shader dump path
std::string shaderDumpPath;
}; };
} }

View File

@ -24,7 +24,7 @@ namespace dxvk {
// If requested by the user, dump both the raw DXBC // If requested by the user, dump both the raw DXBC
// shader and the compiled SPIR-V module to a file. // shader and the compiled SPIR-V module to a file.
const std::string dumpPath = env::getEnvVar("DXVK_SHADER_DUMP_PATH"); const std::string& dumpPath = pDevice->GetOptions()->shaderDumpPath;
if (dumpPath.size() != 0) { if (dumpPath.size() != 0) {
reader.store(std::ofstream(str::topath(str::format(dumpPath, "/", name, ".dxbc").c_str()).c_str(), reader.store(std::ofstream(str::topath(str::format(dumpPath, "/", name, ".dxbc").c_str()).c_str(),