Avoid pacer immediate return when achievable
In case of discarded frames (no end frame or no layers) we don't get called on mark_gpu_done, so times don't get updated. If the game continues to call waitFrame, we advance the predicted display time, but may enter the immediate return, accumulating delay.
This commit is contained in:
@@ -139,7 +139,7 @@ void app_pacer::predict(int64_t now_ns,
|
||||
// Sync phase with compositor
|
||||
last_display_time = compositor_display_time + period * ((period / 2 + last_display_time - compositor_display_time) / period);
|
||||
|
||||
if (cpu_time > period or gpu_time > period or (min_ready > last_display_time and min_ready < last_display_time + period))
|
||||
if (min_ready > last_display_time and min_ready < last_display_time + period)
|
||||
{
|
||||
// We are limited by app time, don't wait
|
||||
*out_wake_up_time = now_ns;
|
||||
|
||||
Reference in New Issue
Block a user