Use triple buffering if and when the previous frame is running late. This means the next frame will be dispatched on time instead of also starting late. It also triggers a GPU clock boost if deemed necessary by the driver. Although frequency scaling is not required to get a performance gain here because even a fixed frequency GPU will benefit from not over-sleeping anymore.
If the previous frame is not running late then we stick to double buffering so there's no latency penalty when the system is able to maintain full frame rate.
In my case this improves 4K overview animations on a basic Intel GPU from 30 FPS to 60 FPS.
Requires: !1968 (included here)