(D3D11/12) Reduce lag with WaitForVBlank

This commit is contained in:
sonninnos 2022-06-12 10:56:43 +03:00
parent a5d145e211
commit 31a43b9390
2 changed files with 15 additions and 0 deletions

View File

@ -2374,6 +2374,14 @@ static bool d3d11_gfx_frame(
#endif
DXGIPresent(d3d11->swapChain, d3d11->swap_interval, present_flags);
if (vsync)
{
IDXGIOutput *pOutput;
DXGIGetContainingOutput(d3d11->swapChain, &pOutput);
DXGIWaitForVBlank(pOutput);
}
Release(rtv);
return true;

View File

@ -2660,6 +2660,13 @@ static bool d3d12_gfx_frame(
#endif
DXGIPresent(d3d12->chain.handle, sync_interval, present_flags);
if (vsync)
{
IDXGIOutput *pOutput;
DXGIGetContainingOutput(d3d12->chain.handle, &pOutput);
DXGIWaitForVBlank(pOutput);
}
return true;
}