diff options
author | Philip Rebohle <philip.rebohle@tu-dortmund.de> | 2023-11-27 06:39:24 +0300 |
---|---|---|
committer | Philip Rebohle <philip.rebohle@tu-dortmund.de> | 2023-12-01 16:14:13 +0300 |
commit | 03c09ce15f9f1e3ae4dd24dffb1e3f235127bcfc (patch) | |
tree | 081ad29cafabf630c3e7ff7f5fb494881b9561ee | |
parent | 91f7f43c35f240231c9e5efd0b24a27da5c16a8a (diff) |
[dxvk] Add option to skip integrated GPU adapters
-rw-r--r-- | dxvk.conf | 12 | ||||
-rw-r--r-- | src/dxvk/dxvk_instance.cpp | 7 | ||||
-rw-r--r-- | src/dxvk/dxvk_options.cpp | 1 | ||||
-rw-r--r-- | src/dxvk/dxvk_options.h | 5 |
4 files changed, 24 insertions, 1 deletions
@@ -634,3 +634,15 @@ # - True/False # dxgi.useMonitorFallback = False + + +# Hide integrated graphics from applications +# +# Only has an effect when dedicated GPUs are present on the system. It is +# not recommended to use this option at all unless absolutely necessary for +# a game to work; prefer using DXVK_FILTER_DEVICE_NAME whenever possible. +# +# Supported values: +# - True/False + +# dxvk.hideIntegratedGraphics = False diff --git a/src/dxvk/dxvk_instance.cpp b/src/dxvk/dxvk_instance.cpp index 01688182..55ba5245 100644 --- a/src/dxvk/dxvk_instance.cpp +++ b/src/dxvk/dxvk_instance.cpp @@ -286,7 +286,12 @@ namespace dxvk { return aRank < bRank; }); - + + if (m_options.hideIntegratedGraphics && numDGPU > 0 && numIGPU > 0) { + result.resize(numDGPU); + numIGPU = 0; + } + if (result.empty()) { Logger::warn("DXVK: No adapters found. Please check your " "device filter settings and Vulkan setup. " diff --git a/src/dxvk/dxvk_options.cpp b/src/dxvk/dxvk_options.cpp index 9c4a8355..47e24492 100644 --- a/src/dxvk/dxvk_options.cpp +++ b/src/dxvk/dxvk_options.cpp @@ -12,6 +12,7 @@ namespace dxvk { maxChunkSize = config.getOption<int32_t> ("dxvk.maxChunkSize", 0); hud = config.getOption<std::string>("dxvk.hud", ""); tearFree = config.getOption<Tristate>("dxvk.tearFree", Tristate::Auto); + hideIntegratedGraphics = config.getOption<bool> ("dxvk.hideIntegratedGraphics", false); } } diff --git a/src/dxvk/dxvk_options.h b/src/dxvk/dxvk_options.h index f367e5c6..e7e6862f 100644 --- a/src/dxvk/dxvk_options.h +++ b/src/dxvk/dxvk_options.h @@ -36,6 +36,11 @@ namespace dxvk { /// Forces swap chain into MAILBOX (if true) /// or FIFO_RELAXED (if false) present mode Tristate tearFree; + + // Hides integrated GPUs if dedicated GPUs are + // present. May be necessary for some games that + // incorrectly assume monitor layouts. + bool hideIntegratedGraphics; }; } |