mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[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:
parent
3db00a0f40
commit
ae01bd8bd4
@ -199,11 +199,13 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (options->syncInterval >= 0)
|
if (options->syncInterval >= 0)
|
||||||
SyncInterval = options->syncInterval;
|
SyncInterval = options->syncInterval;
|
||||||
|
|
||||||
bool vsync = SyncInterval != 0;
|
|
||||||
|
|
||||||
m_dirty |= vsync != m_vsync;
|
if (!(PresentFlags & DXGI_PRESENT_TEST)) {
|
||||||
m_vsync = vsync;
|
bool vsync = SyncInterval != 0;
|
||||||
|
|
||||||
|
m_dirty |= vsync != m_vsync;
|
||||||
|
m_vsync = vsync;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_presenter == nullptr)
|
if (m_presenter == nullptr)
|
||||||
CreatePresenter();
|
CreatePresenter();
|
||||||
@ -211,7 +213,7 @@ namespace dxvk {
|
|||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
if (!m_presenter->hasSwapChain()) {
|
if (!m_presenter->hasSwapChain()) {
|
||||||
RecreateSwapChain(vsync);
|
RecreateSwapChain(m_vsync);
|
||||||
m_dirty = false;
|
m_dirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +227,7 @@ namespace dxvk {
|
|||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (std::exchange(m_dirty, false))
|
if (std::exchange(m_dirty, false))
|
||||||
RecreateSwapChain(vsync);
|
RecreateSwapChain(m_vsync);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
PresentImage(SyncInterval);
|
PresentImage(SyncInterval);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user