summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2017-07-06 01:26:06 +0200
committerGitHub <noreply@github.com>2017-07-06 01:26:06 +0200
commit29cc009706f133aac39ebaa7003d37555b926109 (patch)
treee95a51c7ea5abd471be45e00c98f11b308c21537 /Source/Core/VideoBackends/Vulkan/SwapChain.cpp
parent421a2c57761d4f51f8bcaf866e17a8c8b38b4cd2 (diff)
parent8476d0271d56ef2d49657d31d97d42395585ad3b (diff)
Merge pull request #5697 from Armada651/quad-buffer
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);