Skip to content

Commit

Permalink
[Vulkan] Fix swapchain creation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hyazinthh committed Dec 12, 2023
1 parent a3740cf commit f91a039
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
{
Expand Down

0 comments on commit f91a039

Please sign in to comment.