From f78509ba9bf64d686b1d47c7478ce686d7bbdc69 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Sun, 17 Mar 2019 20:34:07 -0700 Subject: [PATCH] st/oxr: Hand determination of frame time and interval over to compositor --- src/xrt/state_trackers/oxr/oxr_objects.h | 1 - src/xrt/state_trackers/oxr/oxr_session.c | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_objects.h b/src/xrt/state_trackers/oxr/oxr_objects.h index 711af9610..811f9f2a6 100644 --- a/src/xrt/state_trackers/oxr/oxr_objects.h +++ b/src/xrt/state_trackers/oxr/oxr_objects.h @@ -463,7 +463,6 @@ struct oxr_session */ float ipd_meters; - uint64_t nominal_frame_interval_ns; float static_prediction_s; /*! diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index fff67ebbc..c521c0aa8 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -299,16 +299,11 @@ oxr_session_frame_wait(struct oxr_logger *log, " session is not running"); } - // OK to update this here because xrWaitFrame must be externally - // synchronized by the app. + //! @todo this should be carefully synchronized, because there may be + //! more than one session per instance. timepoint_ns now = time_state_get_now_and_update(sess->sys->inst->timekeeping); - // Set defaults - may be overridden by compositor. - frameState->predictedDisplayPeriod = sess->nominal_frame_interval_ns; - frameState->predictedDisplayTime = - now + frameState->predictedDisplayPeriod; - struct xrt_compositor *xc = sess->compositor; xc->wait_frame(xc, &frameState->predictedDisplayTime, &frameState->predictedDisplayPeriod); @@ -492,8 +487,6 @@ oxr_session_create(struct oxr_logger *log, } sess->ipd_meters = debug_get_num_option_ipd() / 1000.0f; - //! @todo hard-coding 90Hz - sess->nominal_frame_interval_ns = 11111111; sess->static_prediction_s = debug_get_num_option_prediction_ms() / 1000.0f;