summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2017-06-26 21:08:21 +0200
committerJules Blok <jules.blok@gmail.com>2017-07-05 22:43:39 +0200
commit1f2d43c8709e5fab2f8c3c7de81bdf160b5f6363 (patch)
tree5c8dd520b7a8dcc756940757883561add2dde9a0 /Source/Core/VideoBackends/Vulkan/SwapChain.cpp
parentf3508742ac3ef87ab1093ab284e36034f7639a5f (diff)
Vulkan: Implement Quad-Buffered stereoscopy support.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/SwapChain.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/SwapChain.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
index d43a0e4499..21009510bb 100644
--- a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
+++ b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
@@ -320,6 +320,9 @@ bool SwapChain::CreateSwapChain()
return false;
}
+ // Select the number of image layers for Quad-Buffered stereoscopy
+ uint32_t image_layers = g_ActiveConfig.iStereoMode == STEREO_QUADBUFFER ? 2 : 1;
+
// Store the old/current swap chain when recreating for resize
VkSwapchainKHR old_swap_chain = m_swap_chain;
@@ -333,7 +336,7 @@ bool SwapChain::CreateSwapChain()
m_surface_format.format,
m_surface_format.colorSpace,
size,
- 1,
+ image_layers,
image_usage,
VK_SHARING_MODE_EXCLUSIVE,
0,
@@ -359,6 +362,7 @@ bool SwapChain::CreateSwapChain()
m_width = size.width;
m_height = size.height;
+ m_layers = image_layers;
return true;
}
@@ -400,7 +404,7 @@ bool SwapChain::SetupSwapChainImages()
&view,
m_width,
m_height,
- 1};
+ m_layers};
res = vkCreateFramebuffer(g_vulkan_context->GetDevice(), &framebuffer_info, nullptr,
&image.framebuffer);