mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
vulkan: explicitly specify triple-buffering instead of minBuffers+1.
This commit is contained in:
@@ -1985,9 +1985,10 @@ void Graphics::createSwapChain()
|
|||||||
|
|
||||||
if (extent.width > 0 && extent.height > 0)
|
if (extent.width > 0 && extent.height > 0)
|
||||||
{
|
{
|
||||||
uint32_t imageCount = swapChainSupport.capabilities.minImageCount + 1;
|
// Attempt triple-buffering when available.
|
||||||
if (swapChainSupport.capabilities.maxImageCount > 0 && imageCount > swapChainSupport.capabilities.maxImageCount)
|
uint32_t imageCount = std::max(3u, swapChainSupport.capabilities.minImageCount);
|
||||||
imageCount = swapChainSupport.capabilities.maxImageCount;
|
if (swapChainSupport.capabilities.maxImageCount > 0)
|
||||||
|
imageCount = std::min(imageCount, swapChainSupport.capabilities.maxImageCount);
|
||||||
|
|
||||||
VkSwapchainCreateInfoKHR createInfo{};
|
VkSwapchainCreateInfoKHR createInfo{};
|
||||||
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
|
createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
|
||||||
|
|||||||
Reference in New Issue
Block a user