The effect of web browser “Input Lag” in HTML5 games (2017)
vsynctester.com
vsynctester.com
Exclusive fullscreen applications shouldn't need any compositing, surely they must be exempt from that.
While investigating cursor lag issues on my computer (which were caused by an errant Intel Optane card, of all things...) I read through Windows’ video driver documentation and I learned that while Windows does direct the mouse pointer completely independently of the DWM, there is no requirement that the cursor be rendered during scanout (like a hardware sprite) and it is permissible for a GPU to render the pointer to the framebuffer. In fact, there’s a lot that’s undefined by the specs - for example, I used to believe there was a hard limit of 127x127 on cursor sizes (based on the ICO file format) but it turns out there is no upper-limit on cursor sizes at all. If you set a huge cursor image (say, 1500x1500px) some GPUs do render it to the framebuffer but others do not (in my testing, newer Radeon cards behaved differently if the image was above ~600px, whereas with my Nvidia cards anything over 255x255 had a different mouse-acceleration curve, that was weird)
There is also a feature designed to let applications bypass this delay in windowed mode using GPU hardware overlays, however it needs GPU driver support and it is not supported on Nvidia or AMD drivers AFAIK. Basically nobody uses it.
Fullscreen exclusive mode support is still common in games.
AFAIK you can avoid it by using DXGI flip model.
random page:
>(DXGI) Flip Model is a new mode introduced in Windows 8 that makes the SwapChain work efficiently with the Windows DWM (Desktop Window Manager). Flip Model eliminates performance penalties normally associated with windowed mode rendering and introduces new methods to measure and regulate render latency.
There is a flag DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING which can completely eliminate DWM's latency even for normal composited windows, but it only functions on systems with hardware overlays, which are not supported on Nvidia or AMD.
What about Intel and Matrox?
What about desktop compositors for Linux? And the macOS compositor? (Not that macOS is pleasant to use with a mouse...)
I believe the situation is worse on most Linux compositors. MacOS I'm not sure of. I tested just now and it looks like at least one frame of latency on most things, and they don't implement the window dragging hack DWM does either.
Huh? That should be the first time I hear it itsn't...
If the flip triggered composite finishes before vsync, you could also let a second flip trigger a new composite, etc. If your windows do a lot of flipping between vsyncs, you could burn a lot of cpu/gpu time compositing, but latency improvement would be worth it, at least for some applications.
Edit: I have seen a lot of negative opinions on tripple buffering, but they seem to be related to increased latency as a result of implementations that wouldn't drop rendered frames, even when two frames were rendered between vsyncs. That's a silly thing to do, so I assume a triple buffered DWM wouldn't do that.
To be fair, it is difficult for applications to support <1 frame of latency even when the compositor allows it. It requires precise timing and very predictable rendering performance. Even VR applications struggle with this, despite the fact that the consequence of latency and/or missed frames isn't just a floaty feel to the mouse pointer, but literal nausea.
If we can just teach audiences to clap one sixteenth-note later than usual then all live music could go completely digital!
Other tests, including on the same site, are able to get the real-time hardware cursor position which the test code knows is ahead of the last-drawn cursor position and whatever position it’s drawing right now.