From 2bae3a5c8ba51cd97562a102769de7f549cb0aef Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 14 Jan 2019 18:28:53 +0100 Subject: [PATCH] [d3d11] Reintroduce support for dxgi.maxFrameLatency This option was previously ignored for some reason. --- src/d3d11/d3d11_device.cpp | 3 ++- src/d3d11/d3d11_options.cpp | 13 +++++++------ src/d3d11/d3d11_options.h | 4 ++++ src/dxgi/dxgi_options.cpp | 3 --- src/dxgi/dxgi_options.h | 9 --------- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 7d0146d8..d0a4521d 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1736,7 +1736,8 @@ namespace dxvk { m_d3d11Device (this, FeatureLevel, FeatureFlags), m_d3d11Presenter(this, &m_d3d11Device), m_d3d11Interop (this, &m_d3d11Device), - m_wineFactory (&m_d3d11Presenter) { + m_wineFactory (&m_d3d11Presenter), + m_frameLatencyCap(m_d3d11Device.GetOptions()->maxFrameLatency) { for (uint32_t i = 0; i < m_frameEvents.size(); i++) m_frameEvents[i] = new DxvkEvent(); } diff --git a/src/d3d11/d3d11_options.cpp b/src/d3d11/d3d11_options.cpp index 037838b2..69ed718d 100644 --- a/src/d3d11/d3d11_options.cpp +++ b/src/d3d11/d3d11_options.cpp @@ -5,14 +5,15 @@ namespace dxvk { D3D11Options::D3D11Options(const Config& config) { - this->allowMapFlagNoWait = config.getOption("d3d11.allowMapFlagNoWait", false); - this->dcSingleUseMode = config.getOption("d3d11.dcSingleUseMode", true); - this->fakeStreamOutSupport = config.getOption("d3d11.fakeStreamOutSupport", false); + this->allowMapFlagNoWait = config.getOption("d3d11.allowMapFlagNoWait", false); + this->dcSingleUseMode = config.getOption("d3d11.dcSingleUseMode", true); + this->fakeStreamOutSupport = config.getOption("d3d11.fakeStreamOutSupport", false); this->zeroInitWorkgroupMemory = config.getOption("d3d11.zeroInitWorkgroupMemory", false); - this->maxTessFactor = config.getOption("d3d11.maxTessFactor", 0); - this->samplerAnisotropy = config.getOption("d3d11.samplerAnisotropy", -1); - this->deferSurfaceCreation = config.getOption("dxgi.deferSurfaceCreation", false); + this->maxTessFactor = config.getOption("d3d11.maxTessFactor", 0); + this->samplerAnisotropy = config.getOption("d3d11.samplerAnisotropy", -1); + this->deferSurfaceCreation = config.getOption("dxgi.deferSurfaceCreation", false); this->numBackBuffers = config.getOption("dxgi.numBackBuffers", 0); + this->maxFrameLatency = config.getOption("dxgi.maxFrameLatency", 0); this->syncInterval = config.getOption("dxgi.syncInterval", -1); this->syncMode = D3D11SwapChainSyncMode(config.getOption("dxgi.syncMode", 0)); } diff --git a/src/d3d11/d3d11_options.h b/src/d3d11/d3d11_options.h index 551018e9..6ee23385 100644 --- a/src/d3d11/d3d11_options.h +++ b/src/d3d11/d3d11_options.h @@ -68,6 +68,10 @@ namespace dxvk { /// passed to IDXGISwapChain::Present. int32_t syncInterval; + /// Override maximum frame latency if the app specifies + /// a higher value. May help with frame timing issues. + int32_t maxFrameLatency; + /// Defer surface creation until first present call. This /// fixes issues with games that create multiple swap chains /// for a single window that may interfere with each other. diff --git a/src/dxgi/dxgi_options.cpp b/src/dxgi/dxgi_options.cpp index 1c91817b..e263be7c 100644 --- a/src/dxgi/dxgi_options.cpp +++ b/src/dxgi/dxgi_options.cpp @@ -28,9 +28,6 @@ namespace dxvk { DxgiOptions::DxgiOptions(const Config& config) { - this->deferSurfaceCreation = config.getOption ("dxgi.deferSurfaceCreation", false); - this->maxFrameLatency = config.getOption ("dxgi.maxFrameLatency", 0); - // Fetch these as a string representing a hexadecimal number and parse it. this->customVendorId = parsePciId(config.getOption("dxgi.customVendorId")); this->customDeviceId = parsePciId(config.getOption("dxgi.customDeviceId")); diff --git a/src/dxgi/dxgi_options.h b/src/dxgi/dxgi_options.h index 3eb63c35..d5f3bb23 100644 --- a/src/dxgi/dxgi_options.h +++ b/src/dxgi/dxgi_options.h @@ -17,15 +17,6 @@ namespace dxvk { struct DxgiOptions { DxgiOptions(const Config& config); - /// Defer surface creation until first present call. This - /// fixes issues with games that create multiple swap chains - /// for a single window that may interfere with each other. - bool deferSurfaceCreation; - - /// Override maximum frame latency if the app specifies - /// a higher value. May help with frame timing issues. - int32_t maxFrameLatency; - /// Override PCI vendor and device IDs reported to the /// application. This may make apps think they are running /// on a different GPU than they do and behave differently.