5 ms·
Unfortunately not. Flip model improves efficiency by removing one copy. However, the window contents are still composited into DWM's backbuffer just after vsync
by modeless 6y ago
Unfortunately not. Flip model improves efficiency by removing one copy. However, the window contents are still composited into DWM's backbuffer just after vsync, so any rendering that happens during the frame is not displayed until the following frame.
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.
- DaiPlusPlus 6y ago> 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...)
- modeless 6y agoIntel does support it. No idea about Matrox, but it seems like they don't make their own GPU chips anymore so probably not. 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.
- DaiPlusPlus 6y agoI note that touchpads (especially on Macs) seem to have considerably higher perceptual lag compared to mice, I think because of the smoothing necessary to make touchpads less fiddly - and as most macOS users are using a touchpad I imagine that contributes to less complaints about lag specifically because it would be difficult to pin-down.
- modeless 6y agoHonestly macOS has always felt laggy to me in comparison to Windows. Even with a mouse. I think there are latency issues there, but also many design issues like the interminable animation for maximizing windows. Compare to the speed of Aero Snap gestures.
- coldtea 6y ago>Not that macOS is pleasant to use with a mouse... Huh? That should be the first time I hear it itsn't...
- toast0 6y agoIs there a reason DWM doesn't triple buffer? I'm not skilled in the dark arts of graphics, but it would seem to me if you triggered compositing to a backbuffer on vsync and to a separate backbuffer when a window flipped its swap chain, on the next vsync you could use the flip triggered buffer if it finished or the vsync triggered one if the flip triggered didn't finish on time. 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.
- modeless 6y agoThey just don't prioritize low latency enough to implement such a feature. They're probably more focused on power efficiency. The overlay solution is better (although it's not free wrt power consumption either). It's just lame that Nvidia and AMD don't support it. 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.