From d01f4c1461e587381f886dcd95e4bf3b446f8cbc Mon Sep 17 00:00:00 2001 From: Marcin Siniarski <15676482+siniarskimar@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:27:16 +0200 Subject: [PATCH] todo: Handle mailbox_khr in the future It requires the timing to be done by the application as the most recent frame is always pushed onto it's internal queue. I need query the monitor refresh rate and ensure we are rendering at that frequency. --- src/vulkan.zig | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/vulkan.zig b/src/vulkan.zig index 4004bc0..3b4509d 100644 --- a/src/vulkan.zig +++ b/src/vulkan.zig @@ -532,17 +532,18 @@ pub const Swapchain = struct { /// `fifo_khr` maintains a mutiple-entry queue. Each entry is appened to the end of the queue /// /// [p] - [1] - [2] - ... + // TODO: When using mailbox_khr, manually limit frame rate to display's refresh rate fn findPresentationMode( - allocator: std.mem.Allocator, - instance: Instance, - context: *const RenderContext, + _: std.mem.Allocator, + _: Instance, + _: *const RenderContext, ) !vk.PresentModeKHR { - const modes = try instance.getPhysicalDeviceSurfacePresentModesAllocKHR(context.pdev, context.surface, allocator); - defer allocator.free(modes); + // const modes = try instance.getPhysicalDeviceSurfacePresentModesAllocKHR(context.pdev, context.surface, allocator); + // defer allocator.free(modes); - for (modes) |mode| { - if (mode == .mailbox_khr) return mode; - } + // for (modes) |mode| { + // if (mode == .mailbox_khr) return mode; + // } return .fifo_khr; }