changeset 1170:2addc5f6804f

merge
author sam@sambook-windows.localdomain
date Wed, 26 Jun 2024 05:14:30 +0700
parents d88f0286681b (current diff) 73eaec7e1690 (diff)
children dc6e1660831d 4d97cfc4888b
files
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/engine.nim	Wed Jun 26 05:14:00 2024 +0700
+++ b/semicongine/engine.nim	Wed Jun 26 05:14:30 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())