st/oxr: Allow wait frame in headless since it does more than just waiting.

This commit is contained in:
Ryan Pavlik 2019-10-22 17:53:07 +02:00 committed by Jakob Bornecrantz
parent 5becb60714
commit 713830338e
2 changed files with 7 additions and 8 deletions
src/xrt/state_trackers/oxr

View file

@ -108,10 +108,6 @@ oxr_xrWaitFrame(XrSession session,
struct oxr_session *sess;
struct oxr_logger log;
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrWaitFrame");
if (sess->compositor == NULL) {
return oxr_error(&log, XR_ERROR_GRAPHICS_DEVICE_INVALID,
"xrWaitFrame is illegal in headless sessions");
}
OXR_VERIFY_ARG_TYPE_AND_NULL(&log, frameState, XR_TYPE_FRAME_STATE);
OXR_VERIFY_ARG_NOT_NULL(&log, frameState);

View file

@ -391,10 +391,13 @@ oxr_session_frame_wait(struct oxr_logger *log,
time_state_get_now_and_update(sess->sys->inst->timekeeping);
struct xrt_compositor *xc = sess->compositor;
xc->wait_frame(xc, &frameState->predictedDisplayTime,
&frameState->predictedDisplayPeriod);
frameState->shouldRender = should_render(sess->state);
if (xc != NULL) {
xc->wait_frame(xc, &frameState->predictedDisplayTime,
&frameState->predictedDisplayPeriod);
frameState->shouldRender = should_render(sess->state);
} else {
frameState->shouldRender = XR_FALSE;
}
return oxr_session_success_result(sess);
}