> it uses a CRTC vblank deadline based approach to postpone posting KMS updates until as late as possible, and uses this method to achieve lower latency cursor movements, as well avoiding potential cursor stutter when the main thread is too busy to manage completing a frame in time.
Mouse movements no longer happen on main thread.
And the RT KMS thread delays posting the update until just before a deadline, to make sure the mouse is samples at the last possible moment! What a neat & straightforward & simple hack, sampling late. I'm sure this kind of stuff is what Good game devs have been doing for decades but still amazes me to read this.
Yep in gamedev it's called frame pacing. If you have a 16 ms frame budget and you know rendering will take about 4 ms, you can sleep for 10 ms, sample the latest possible inputs, and kick off rendering just in time to make the deadline.
If you estimate wrong, you start missing frames. If you don't do any frame pacing, the game always has a little bit of preventable input lag.
I only learned about this a couple years ago, but I think I felt it years ago - One of my games just seemed to feel better with a 10 millisecond sleep right after I submitted each OpenGL frame. In a world where you can't control hardware and OS lag, that 10 ms of free lag reduction is wondrous.
jauntywundrkind|2 years ago
Mouse movements no longer happen on main thread.
And the RT KMS thread delays posting the update until just before a deadline, to make sure the mouse is samples at the last possible moment! What a neat & straightforward & simple hack, sampling late. I'm sure this kind of stuff is what Good game devs have been doing for decades but still amazes me to read this.
ReactiveJelly|2 years ago
If you estimate wrong, you start missing frames. If you don't do any frame pacing, the game always has a little bit of preventable input lag.
I only learned about this a couple years ago, but I think I felt it years ago - One of my games just seemed to feel better with a 10 millisecond sleep right after I submitted each OpenGL frame. In a world where you can't control hardware and OS lag, that 10 ms of free lag reduction is wondrous.