From f91a0391087e23d62d85cbf9cad64e47fb39e115 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 12 Dec 2023 11:16:37 +0100 Subject: [PATCH] [Vulkan] Fix swapchain creation The maxImageCount of VkSurfaceCapabilitiesKHR can be zero if there is no upper limit. In this case clamp between min and max would result in zero. --- .../Swapchain/SwapchainDescription.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Aardvark.Rendering.Vulkan/Swapchain/SwapchainDescription.fs b/src/Aardvark.Rendering.Vulkan/Swapchain/SwapchainDescription.fs index c9cdd7761..5d2216ea7 100644 --- a/src/Aardvark.Rendering.Vulkan/Swapchain/SwapchainDescription.fs +++ b/src/Aardvark.Rendering.Vulkan/Swapchain/SwapchainDescription.fs @@ -135,7 +135,8 @@ type GraphicsMode(format : Col.Format, bits : int, depthBits : int, stencilBits modes |> Seq.maxBy presentModeScore override x.ChooseBufferCount(min, max) = - clamp min max buffers + if max = 0 then Fun.Max(min, buffers) + else clamp min max buffers type SwapchainDescription = {