The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

u/pacing: Add minimum compositor time

+8 -3
+8 -3
src/xrt/auxiliary/util/u_pacing_compositor_fake.c
··· 29 29 * 30 30 */ 31 31 32 + DEBUG_GET_ONCE_FLOAT_OPTION(min_comp_time_ms, "U_PACING_COMP_MIN_TIME_MS", 3.0f) 33 + 32 34 /*! 33 35 * A very simple pacer that tries it best to pace a compositor. Used when the 34 36 * compositor can't get any good or limited feedback from the presentation ··· 284 286 // 20% of the frame time. 285 287 ft->comp_time_ns = get_percent_of_time(estimated_frame_period_ns, 20); 286 288 287 - // Or at least 2ms. 288 - if (ft->comp_time_ns < U_TIME_1MS_IN_NS * 2) { 289 - ft->comp_time_ns = U_TIME_1MS_IN_NS * 2; 289 + // Or at least a certain amount of time. 290 + float min_comp_time_ms_f = debug_get_float_option_min_comp_time_ms(); 291 + uint64_t min_comp_time_ns = time_ms_f_to_ns(min_comp_time_ms_f); 292 + 293 + if (ft->comp_time_ns < min_comp_time_ns) { 294 + ft->comp_time_ns = min_comp_time_ns; 290 295 } 291 296 292 297 // Make the next present time be in the future.