From 57070ad6203375123fdd4e734a12f7bbabe24cb4 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sat, 23 Apr 2022 17:28:21 +0100 Subject: [PATCH] u/pacing: Make the comp time be at least 2ms in fake pacer --- src/xrt/auxiliary/util/u_pacing_compositor_fake.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xrt/auxiliary/util/u_pacing_compositor_fake.c b/src/xrt/auxiliary/util/u_pacing_compositor_fake.c index 222e6c508..aedc6cda6 100644 --- a/src/xrt/auxiliary/util/u_pacing_compositor_fake.c +++ b/src/xrt/auxiliary/util/u_pacing_compositor_fake.c @@ -198,6 +198,11 @@ u_pc_fake_create(uint64_t estimated_frame_period_ns, uint64_t now_ns, struct u_p // 20% of the frame time. ft->comp_time_ns = get_percent_of_time(estimated_frame_period_ns, 20); + // Or at least 2ms. + if (ft->comp_time_ns < U_TIME_1MS_IN_NS * 2) { + ft->comp_time_ns = U_TIME_1MS_IN_NS * 2; + } + // Make the next present time be in the future. ft->last_present_time_ns = now_ns + U_TIME_1MS_IN_NS * 50;