1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[dxgi] Add DXVK_ENABLE_NVAPI envvar

Add a new environment variable DXVK_ENABLE_NVAPI as an environment-level
override for 'nvapiHack'. This will allow for DLSS (and other
NvAPI-backed features) to be available without the user manually writing
a configuration file, allowing for more seamless integration with
Proton's launch script.
This commit is contained in:
Liam Middlebrook 2022-03-15 16:08:29 -07:00 committed by Philip Rebohle
parent 115385d1d9
commit f92c6ae859

View File

@ -40,7 +40,11 @@ namespace dxvk {
this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 0)) << 20; this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 0)) << 20;
this->maxSharedMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxSharedMemory", 0)) << 20; this->maxSharedMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxSharedMemory", 0)) << 20;
this->nvapiHack = config.getOption<bool>("dxgi.nvapiHack", true); // Force nvapiHack to be disabled if NvAPI is enabled in environment
if (env::getEnvVar("DXVK_ENABLE_NVAPI") == "1")
this->nvapiHack = false;
else
this->nvapiHack = config.getOption<bool>("dxgi.nvapiHack", true);
} }
} }