mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-14 04:29:15 +01:00
Merge 8048be5774d401a56dccfeee8999da44d7d3fa8e into afbfee6cdd840e3711628153d2b0e15cd63e57e3
This commit is contained in:
commit
aa6588b238
@ -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);
|
||||
|
||||
|
@ -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('.');
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user