diff options
author | Paul Gofman <pgofman@codeweavers.com> | 2023-10-10 00:16:30 +0300 |
---|---|---|
committer | Philip Rebohle <25567304+doitsujin@users.noreply.github.com> | 2023-10-10 13:01:51 +0300 |
commit | 552d2f0a6d5c5710124ce921d5f9e132082c584a (patch) | |
tree | 458671e01f48970328d4b3019b8a9f46817f3138 | |
parent | 4d974685c9c26e41df4406f9fbf30ce46c9234f6 (diff) |
[dxgi] Add useMonitorFallback option
And enable it for CP2077.
It is supposed to be dropped once QueryDisplayConfig optimization
is in Proton Wine.
-rw-r--r-- | dxvk.conf | 11 | ||||
-rw-r--r-- | src/dxgi/dxgi_factory.cpp | 3 | ||||
-rw-r--r-- | src/dxgi/dxgi_options.cpp | 4 | ||||
-rw-r--r-- | src/dxgi/dxgi_options.h | 3 | ||||
-rw-r--r-- | src/util/config/config.cpp | 7 |
5 files changed, 28 insertions, 0 deletions
@@ -623,3 +623,14 @@ # DO NOT CHANGE THIS UNLESS YOU HAVE A VERY GOOD REASON. # d3d9.textureMemory = 100 + +# Always enumerate all monitors on each dxgi output +# +# Used to avoid performance degradation in some games +# (will be deprecated once QueryDisplayConfig optimization +# is in Proton Wine). +# +# Supported values: +# - True/False + +# dxgi.useMonitorFallback = False diff --git a/src/dxgi/dxgi_factory.cpp b/src/dxgi/dxgi_factory.cpp index 84b3d404..d14ace5d 100644 --- a/src/dxgi/dxgi_factory.cpp +++ b/src/dxgi/dxgi_factory.cpp @@ -124,10 +124,13 @@ namespace dxvk { } } + // If any monitors are left on the list, enable the // fallback to always enumerate all monitors. if ((m_monitorFallback = !monitors.empty())) Logger::warn("DXGI: Found monitors not associated with any adapter, using fallback"); + else + m_monitorFallback = m_options.useMonitorFallback; } diff --git a/src/dxgi/dxgi_options.cpp b/src/dxgi/dxgi_options.cpp index c78bc0ee..c2366077 100644 --- a/src/dxgi/dxgi_options.cpp +++ b/src/dxgi/dxgi_options.cpp @@ -101,6 +101,10 @@ namespace dxvk { Logger::info("HDR was configured to be enabled, but has been force disabled as a UE4 DX11 game was detected."); this->enableHDR = false; } + + this->useMonitorFallback = config.getOption<bool>("dxgi.useMonitorFallback", env::getEnvVar("DXVK_MONITOR_FALLBACK") == "1"); + if (this->useMonitorFallback) + Logger::info("Enabled useMonitorFallback option"); } } diff --git a/src/dxgi/dxgi_options.h b/src/dxgi/dxgi_options.h index 326c0b50..c6492471 100644 --- a/src/dxgi/dxgi_options.h +++ b/src/dxgi/dxgi_options.h @@ -44,6 +44,9 @@ namespace dxvk { /// Enable HDR bool enableHDR; + + /// Use monitor fallback to enumerating all monitors per output + bool useMonitorFallback; }; } diff --git a/src/util/config/config.cpp b/src/util/config/config.cpp index c0de0ee7..f4d5ea7a 100644 --- a/src/util/config/config.cpp +++ b/src/util/config/config.cpp @@ -846,6 +846,13 @@ namespace dxvk { { R"(\\RiftApart\.exe$)", {{ { "dxgi.hideNvidiaGpu", "False" }, }} }, + /* CP2077 enumerates display outputs each frame. + * Avoid using QueryDisplayConfig to avoid + * performance degradation until the + * optimization of that function is in Proton. */ + { R"(\\Cyberpunk2077\.exe$)", {{ + { "dxgi.useMonitorFallback", "True" }, + }} }, }}; |