Skip to content

Commit 67bcf92

Browse files
committed
fix sync failed.
1 parent 3eb2ef5 commit 67bcf92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

swap_chain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ wrapper::directx12::swap_chain::swap_chain(const ComPtr<IDXGISwapChain4>& source
1515

1616
void wrapper::directx12::swap_chain::present(bool sync) const
1717
{
18-
mWrapperInstance->Present(sync ? 1 : 0, 0);
18+
mWrapperInstance->Present(sync ? 1 : 0, sync ? 0 : DXGI_PRESENT_ALLOW_TEARING);
1919
}
2020

2121
DXGI_FORMAT wrapper::directx12::swap_chain::format() const
@@ -41,7 +41,7 @@ wrapper::directx12::swap_chain wrapper::directx12::swap_chain::create(const comm
4141
desc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
4242
desc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
4343
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
44-
desc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
44+
desc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING;
4545
desc.OutputWindow = handle;
4646
desc.SampleDesc.Quality = 0;
4747
desc.SampleDesc.Count = 1;

0 commit comments

Comments
 (0)