diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2017-10-11 23:02:48 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-11 23:02:48 +1000 |
| commit | 90ca2e8042ce2d119dc4723f6ce82b1a60372aaa (patch) | |
| tree | d5c966ddb1bfa0576af9883ac30ba22a849c1e1d /Source/Core/VideoBackends/Vulkan/SwapChain.cpp | |
| parent | d26eda3023a0d896f1992d9deffbbcc47195c2a3 (diff) | |
| parent | 4301b8538df2d2728e624cfc2576758272dbb0c9 (diff) | |
Merge pull request #6066 from stenzek/vulkan-resize
Vulkan: Fixes for window resizing
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/SwapChain.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/SwapChain.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp index c5b3791637..abcd38c94a 100644 --- a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp +++ b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp @@ -472,14 +472,27 @@ bool SwapChain::ResizeSwapChain() return true; } +bool SwapChain::RecreateSwapChain() +{ + DestroySwapChainImages(); + DestroySwapChain(); + if (!CreateSwapChain() || !SetupSwapChainImages()) + { + PanicAlert("Failed to re-configure swap chain images, this is fatal (for now)"); + return false; + } + + return true; +} + bool SwapChain::SetVSync(bool enabled) { if (m_vsync_enabled == enabled) return true; - // Resizing recreates the swap chain with the new present mode. + // Recreate the swap chain with the new present mode. m_vsync_enabled = enabled; - return ResizeSwapChain(); + return RecreateSwapChain(); } bool SwapChain::RecreateSurface(void* native_handle) |
