diff options
| author | Jules Blok <jules.blok@gmail.com> | 2017-07-10 14:03:38 +0200 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2017-07-10 14:25:28 +0200 |
| commit | 3fc9a48da08572cf3ec4fe2bb88a2d56bb47f838 (patch) | |
| tree | 4e9bd4f0ec9017af998c7f707d25e8cbb2d122bb /Source/Core | |
| parent | 65495a1297a4cc8eb4f4d569fc283bfb0b1f569f (diff) | |
D3DBase: Use the swapchain discard mode when possible.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/D3DBase.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D/D3DBase.cpp b/Source/Core/VideoBackends/D3D/D3DBase.cpp index 40ae9d0c95..60475988ce 100644 --- a/Source/Core/VideoBackends/D3D/D3DBase.cpp +++ b/Source/Core/VideoBackends/D3D/D3DBase.cpp @@ -298,7 +298,7 @@ HRESULT Create(HWND wnd) swap_chain_desc.SampleDesc.Quality = 0; swap_chain_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; swap_chain_desc.Scaling = DXGI_SCALING_STRETCH; - swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; + swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; swap_chain_desc.Width = xres; swap_chain_desc.Height = yres; @@ -351,9 +351,18 @@ HRESULT Create(HWND wnd) &swapchain); if (FAILED(hr)) { + // Flip-model discard swapchains aren't supported on Windows 8, so here we fall back to + // a sequential swapchain + swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; + hr = factory->CreateSwapChainForHwnd(device, hWnd, &swap_chain_desc, nullptr, nullptr, + &swapchain); + } + + if (FAILED(hr)) + { // Flip-model swapchains aren't supported on Windows 7, so here we fall back to a legacy // BitBlt-model swapchain - swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_SEQUENTIAL; + swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; hr = factory->CreateSwapChainForHwnd(device, hWnd, &swap_chain_desc, nullptr, nullptr, &swapchain); } |
