summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-11-13 14:12:32 +0100
committerGitHub <noreply@github.com>2016-11-13 14:12:32 +0100
commitbc98ec77beef88dd910d7f86c11967aad53061f3 (patch)
tree24abbfdf417dfbedf4a5f1570eef8f795909664c /Source/Core/VideoBackends/Vulkan/SwapChain.cpp
parentc723532f0db017334870a965553d9b4bcc80f886 (diff)
parent160fee67916c9cb7f6c4ceef04874c8efb051f76 (diff)
Merge pull request #4441 from stenzek/vulkan-max-image-count
Vulkan: Handle maxImageCount of zero when creating swap chain
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/SwapChain.cpp')
-rw-r--r--Source/Core/VideoBackends/Vulkan/SwapChain.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
index 1027099d21..d43a0e4499 100644
--- a/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
+++ b/Source/Core/VideoBackends/Vulkan/SwapChain.cpp
@@ -290,8 +290,11 @@ bool SwapChain::CreateSwapChain()
return false;
// Select number of images in swap chain, we prefer one buffer in the background to work on
- uint32_t image_count =
- std::min(surface_capabilities.minImageCount + 1, surface_capabilities.maxImageCount);
+ uint32_t image_count = surface_capabilities.minImageCount + 1;
+
+ // maxImageCount can be zero, in which case there isn't an upper limit on the number of buffers.
+ if (surface_capabilities.maxImageCount > 0)
+ image_count = std::min(image_count, surface_capabilities.maxImageCount);
// Determine the dimensions of the swap chain. Values of -1 indicate the size we specify here
// determines window size?