c/main: Use correct predicted display time for rendering

Closes 

Reported-by: Boris-Chengbiao Zhou <bobo1239@web.de>
Tested-by: Boris-Chengbiao Zhou <bobo1239@web.de>
This commit is contained in:
Jakob Bornecrantz 2021-03-09 17:45:33 +00:00
parent eb594409dd
commit 003b70d05e
3 changed files with 7 additions and 1 deletions

View file

@ -144,6 +144,7 @@ compositor_wait_frame(struct xrt_compositor *xc,
c->frame.waited.id = frame_id;
c->frame.waited.desired_present_time_ns = desired_present_time_ns;
c->frame.waited.present_slop_ns = present_slop_ns;
c->frame.waited.predicted_display_time_ns = predicted_display_time_ns;
uint64_t now_ns = os_monotonic_get_ns();
if (now_ns < wake_up_time_ns) {

View file

@ -158,6 +158,7 @@ struct comp_shaders
struct comp_frame
{
int64_t id;
uint64_t predicted_display_time_ns;
uint64_t desired_present_time_ns;
uint64_t present_slop_ns;
};

View file

@ -374,7 +374,11 @@ renderer_get_view_projection(struct comp_renderer *r)
struct xrt_space_relation relation;
xrt_device_get_tracked_pose(r->c->xdev, XRT_INPUT_GENERIC_HEAD_POSE, r->c->last_next_display_time, &relation);
xrt_device_get_tracked_pose( //
r->c->xdev, //
XRT_INPUT_GENERIC_HEAD_POSE, //
r->c->frame.rendering.predicted_display_time_ns, //
&relation); //
struct xrt_vec3 eye_relation = {
0.063000f, /* TODO: get actual ipd_meters */