From e10a37d39aa10b44fa5f01f85a06b516ebd47423 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 16 May 2023 23:03:05 +0100 Subject: [PATCH] u/pacing: Add env variable to set present to display offset --- src/xrt/auxiliary/util/u_pacing_compositor_fake.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xrt/auxiliary/util/u_pacing_compositor_fake.c b/src/xrt/auxiliary/util/u_pacing_compositor_fake.c index c9d181c6d..8f4588926 100644 --- a/src/xrt/auxiliary/util/u_pacing_compositor_fake.c +++ b/src/xrt/auxiliary/util/u_pacing_compositor_fake.c @@ -29,6 +29,7 @@ * */ +DEBUG_GET_ONCE_FLOAT_OPTION(present_to_display_offset_ms, "U_PACING_COMP_PRESENT_TO_DISPLAY_OFFSET_MS", 4.0f) DEBUG_GET_ONCE_FLOAT_OPTION(min_comp_time_ms, "U_PACING_COMP_MIN_TIME_MS", 3.0f) /*! @@ -275,9 +276,12 @@ u_pc_fake_create(uint64_t estimated_frame_period_ns, uint64_t now_ns, struct u_p // To make sure the code can start from a non-zero frame id. ft->frame_id_generator = 5; + // An arbitrary guess, that happens to be based on Index. + float present_to_display_offset_ms = debug_get_float_option_present_to_display_offset_ms(); + // Present to display offset, aka vblank to pixel turning into photons. ft->present_to_display_offset_ms = (struct u_var_draggable_f32){ - .val = 4.0, // An arbitrary guess, that happens to be based on Index. + .val = present_to_display_offset_ms, .min = 1.0, // A lot of things assumes this is not negative. .step = 0.1, .max = +40.0,