Skip to content

Commit

Permalink
Merge pull request #4441 from stenzek/vulkan-max-image-count
Browse files Browse the repository at this point in the history
Vulkan: Handle maxImageCount of zero when creating swap chain
  • Loading branch information
degasus committed Nov 13, 2016
2 parents c723532 + 160fee6 commit bc98ec7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Core/VideoBackends/Vulkan/SwapChain.cpp
Expand Up @@ -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?
Expand Down

0 comments on commit bc98ec7

Please sign in to comment.