# HG changeset patch # User sam # Date 1719325215 -25200 # Node ID 73eaec7e1690c8ed81fc5fca859c44149e9420af # Parent cdf7ec8d04d210189fb1763fea275bee34556f12 add: function to get max supported sampling count diff -r cdf7ec8d04d2 -r 73eaec7e1690 semicongine/engine.nim --- a/semicongine/engine.nim Tue Jun 25 20:24:38 2024 +0700 +++ b/semicongine/engine.nim Tue Jun 25 21:20:15 2024 +0700 @@ -197,6 +197,12 @@ func Limits*(engine: Engine): VkPhysicalDeviceLimits = engine.device.physicalDevice.properties.limits +func MaxFramebufferSampleCount*(engine: Engine, maxSamples = VK_SAMPLE_COUNT_8_BIT): VkSampleCountFlagBits = + let available = VkSampleCountFlags( + engine.Limits.framebufferColorSampleCounts.uint32 and engine.Limits.framebufferDepthSampleCounts.uint32 + ).toEnums + return min(max(available), maxSamples) + proc UpdateInputs*(engine: Engine): bool = UpdateInputs(engine.window.PendingEvents())