[d3d11] Add option to enforce mailbox present mode

This commit is contained in:
Philip Rebohle 2020-04-12 20:25:20 +02:00
parent 7f03f45301
commit 4d8940957c
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 16 additions and 1 deletions

View File

@ -69,6 +69,16 @@
# d3d9.presentInterval = -1
# Enables the mailbox present mode in case regular Vsync is disabled.
# This should avoid tearing, but may be unsupported on some systems
# or require setting dxgi.numBackBuffers to a higher value in order
# to work properly. Please do not report issues with this option.
#
# Supported values: True, False
# dxgi.tearFree = False
# Performs range check on dynamically indexed constant buffers in shaders.
# This may be needed to work around a certain type of game bug, but may
# also introduce incorrect behaviour.

View File

@ -19,6 +19,7 @@ namespace dxvk {
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);
this->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
this->tearFree = config.getOption<bool>("dxgi.tearFree", false);
this->constantBufferRangeCheck = config.getOption<bool>("d3d11.constantBufferRangeCheck", false)
&& DxvkGpuVendor(devInfo.core.properties.vendorID) != DxvkGpuVendor::Amd;

View File

@ -72,6 +72,9 @@ namespace dxvk {
/// passed to IDXGISwapChain::Present.
int32_t syncInterval;
/// Tear-free mode if vsync is disabled
bool tearFree;
/// Override maximum frame latency if the app specifies
/// a higher value. May help with frame timing issues.
int32_t maxFrameLatency;

View File

@ -850,7 +850,8 @@ namespace dxvk {
if (Vsync) {
pDstModes[n++] = VK_PRESENT_MODE_FIFO_KHR;
} else {
pDstModes[n++] = VK_PRESENT_MODE_IMMEDIATE_KHR;
if (!m_parent->GetOptions()->tearFree)
pDstModes[n++] = VK_PRESENT_MODE_IMMEDIATE_KHR;
pDstModes[n++] = VK_PRESENT_MODE_MAILBOX_KHR;
pDstModes[n++] = VK_PRESENT_MODE_FIFO_RELAXED_KHR;
}