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

Merge 8048be5774d401a56dccfeee8999da44d7d3fa8e into c04410ca00f33162d0875bc8500d3f8185bc73df

This commit is contained in:
aleiby 2025-02-28 17:51:07 +01:00 committed by GitHub
commit c86bd30299
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 27 additions and 0 deletions

View File

@ -31,6 +31,19 @@ namespace dxvk {
m_options = DxvkOptions(m_config);
std::string vkLoaderLayersDisableEnv = env::getEnvVar("VK_LOADER_LAYERS_DISABLE");
if (!vkLoaderLayersDisableEnv.empty())
Logger::info(str::format("VK_LOADER_LAYERS_DISABLE: ", vkLoaderLayersDisableEnv));
// Optionally override VK_LOADER_LAYERS_DISABLE with specified DXVK_LOADER_LAYERS_DISABLE
// Or set DXVK_OVERRIDE_VK_LOADER_LAYERS_DISABLE=1 alone, to clear VK_LOADER_LAYERS_DISABLE
std::string dxvkLoaderLayersDisableEnv = env::getEnvVar("DXVK_LOADER_LAYERS_DISABLE");
if (!dxvkLoaderLayersDisableEnv.empty() || env::getEnvVar("DXVK_OVERRIDE_VK_LOADER_LAYERS_DISABLE") == "1")
{
Logger::info(str::format("DXVK_LOADER_LAYERS_DISABLE: ", dxvkLoaderLayersDisableEnv));
env::setEnvVar("VK_LOADER_LAYERS_DISABLE", dxvkLoaderLayersDisableEnv.c_str());
}
// Load Vulkan library
createLibraryLoader(args);

View File

@ -35,6 +35,13 @@ namespace dxvk::env {
#endif
}
void setEnvVar(const char* name, const char* value) {
#ifdef _WIN32
::SetEnvironmentVariableA(name, value);
#else
std::setenv(name, value);
#endif
}
size_t matchFileExtension(const std::string& name, const char* ext) {
auto pos = name.find_last_of('.');

View File

@ -27,6 +27,13 @@ namespace dxvk::env {
* \returns Value of the variable
*/
std::string getEnvVar(const char* name);
/**
* \brief Sets environment variable
* \param [in] name Name of the variable
* \param [in] value New value to set
*/
void setEnvVar(const char* name, const char* value);
/**
* \brief Checks whether a file name has a given extension