[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.
This commit is contained in:
Philip Rebohle 2020-01-04 11:18:51 +01:00
parent 3db00a0f40
commit ae01bd8bd4
1 changed files with 8 additions and 6 deletions

View File

@ -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);