summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-05-20 06:13:41 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-05-20 06:13:41 +0000
commit64888e8097027b9becb6ab4def09b510d291cf64 (patch)
tree4acc60e9471121f06862a503fe717b8012617375 /Graphics/GraphicsEngineD3D12
parentUnified shader type defines for all backends (diff)
downloadDiligentCore-64888e8097027b9becb6ab4def09b510d291cf64.tar.gz
DiligentCore-64888e8097027b9becb6ab4def09b510d291cf64.zip
Improved latency handling in D3D11 and D3D12 (API 240061, fixed https://github.com/DiligentGraphics/DiligentEngine/issues/81)
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp
index 301f8a1b..bcffe7d5 100644
--- a/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp
@@ -148,6 +148,11 @@ void SwapChainD3D12Impl::Present(Uint32 SyncInterval)
pImmediateCtxD3D12->Flush();
+ // In contrast to MSDN sample, we wait for the frame as late as possible - right
+ // before presenting.
+ // https://docs.microsoft.com/en-us/windows/uwp/gaming/reduce-latency-with-dxgi-1-3-swap-chains#step-4-wait-before-rendering-each-frame
+ WaitForFrame();
+
auto hr = m_pSwapChain->Present(SyncInterval, 0);
VERIFY(SUCCEEDED(hr), "Present failed");