Commit ae01bd8b authored by Philip Rebohle's avatar Philip Rebohle

[dxgi] Ignore sync interval if PRESENT_TEST is used

Otherwise, the following sequence leads to the Vulkan
swap chain being recreated once per frame:

  swapchain->Present(0, DXGI_PRESENT_TEST);
  swapchain->Present(1, 0);

Found while investigating #1314.
parent 3db00a0f
......@@ -199,11 +199,13 @@ namespace dxvk {
if (options->syncInterval >= 0)
SyncInterval = options->syncInterval;
bool vsync = SyncInterval != 0;
m_dirty |= vsync != m_vsync;
m_vsync = vsync;
if (!(PresentFlags & DXGI_PRESENT_TEST)) {
bool vsync = SyncInterval != 0;
m_dirty |= vsync != m_vsync;
m_vsync = vsync;
}
if (m_presenter == nullptr)
CreatePresenter();
......@@ -211,7 +213,7 @@ namespace dxvk {
HRESULT hr = S_OK;
if (!m_presenter->hasSwapChain()) {
RecreateSwapChain(vsync);
RecreateSwapChain(m_vsync);
m_dirty = false;
}
......@@ -225,7 +227,7 @@ namespace dxvk {
return hr;
if (std::exchange(m_dirty, false))
RecreateSwapChain(vsync);
RecreateSwapChain(m_vsync);
try {
PresentImage(SyncInterval);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment