Handle maxImageCount 0 in QVulkanWindow
Take the logic we use in QRhi's Vulkan backend. Pick-to: 6.0 5.15 Fixes: QTBUG-85791 Change-Id: Ifdc2b3d351af71fbc86e20abcede902303e41fc4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>bb10
parent
133af89038
commit
f6cb24f4c0
|
|
@ -1043,9 +1043,11 @@ void QVulkanWindowPrivate::recreateSwapChain()
|
|||
VkPhysicalDevice physDev = physDevs.at(physDevIndex);
|
||||
VkSurfaceCapabilitiesKHR surfaceCaps;
|
||||
vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDev, surface, &surfaceCaps);
|
||||
uint32_t reqBufferCount = swapChainBufferCount;
|
||||
if (surfaceCaps.maxImageCount)
|
||||
reqBufferCount = qBound(surfaceCaps.minImageCount, reqBufferCount, surfaceCaps.maxImageCount);
|
||||
uint32_t reqBufferCount;
|
||||
if (surfaceCaps.maxImageCount == 0)
|
||||
reqBufferCount = qMax<uint32_t>(2, surfaceCaps.minImageCount);
|
||||
else
|
||||
reqBufferCount = qMax(qMin<uint32_t>(surfaceCaps.maxImageCount, 3), surfaceCaps.minImageCount);
|
||||
|
||||
VkExtent2D bufferSize = surfaceCaps.currentExtent;
|
||||
if (bufferSize.width == uint32_t(-1)) {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public:
|
|||
// rendering thread will get throttled to the presentation rate (vsync).
|
||||
// This is in effect Example 5 from the VK_KHR_swapchain spec.
|
||||
VkPresentModeKHR presentMode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
int swapChainBufferCount = 2;
|
||||
int swapChainBufferCount = 0;
|
||||
int frameLag = 2;
|
||||
|
||||
QSize swapChainImageSize;
|
||||
|
|
|
|||
Loading…
Reference in New Issue