Draft
Conversation
Before, MetalFence was implemented as simply a busy loop on an atomic int on metal, meaning the cpu would busy wait on the gpu to finish taking power from it and decreasing battery life. This was the only kind of cpu-gpu syncing (apart from requesting a swapchain)
not exactly sure how its supposed to work. Very rough prototype
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A very bad attempt to improve latency. By adding extra waits to 'WaitForSwapchain'. Any Mac users out there? Please tell me what you see on your machine when dragging imgui windows https://github.com/ocornut/imgui/tree/master/examples
I guess if you have a 120hz display, the frame lag is less bad
What's Implemented
Is this worth pursuing? Or should mac users give up and deal with the lag like how it is for most apps
Does anyone know what's the 'correct' way to implement this so you get the smoothness you see in chrome and safari? Because a simple [NSApp run] with DrawInMTKView alone doesn't work, since it doesn't track swapchain usage and it ends up looking exactly like how while(!quit) { draw_metal(); frame(); } does, and I guess most applications don't want to go the conventional NSViewController route and want their own while loop
you can check out the feel for yourself, video doesn't do it justice, github seems to reencode it and lower the framerate
https://github.com/alexgu754/LowLatencyOSX/tree/main
https://github.com/user-attachments/assets/34137caa-4eea-4ee3-a223-f4802993fb5f
Issue #14456