The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: Ignore primaryViewConfigurationType in headless

Spec:
"In a headless session, the XrSessionBeginInfo::primaryViewConfigurationType must be ignored and may be 0."

+7 -2
+5 -1
src/xrt/state_trackers/oxr/oxr_api_session.c
··· 94 94 OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrBeginSession"); 95 95 OXR_VERIFY_SESSION_NOT_LOST(&log, sess); 96 96 OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, beginInfo, XR_TYPE_SESSION_BEGIN_INFO); 97 - OXR_VERIFY_VIEW_CONFIG_TYPE(&log, sess->sys->inst, beginInfo->primaryViewConfigurationType); 97 + 98 + // in a headless session there is no compositor and primaryViewConfigurationType must be ignored 99 + if (sess->compositor != NULL) { 100 + OXR_VERIFY_VIEW_CONFIG_TYPE(&log, sess->sys->inst, beginInfo->primaryViewConfigurationType); 101 + } 98 102 99 103 if (sess->has_begun) { 100 104 return oxr_error(&log, XR_ERROR_SESSION_RUNNING, "Session is already running");
+2 -1
src/xrt/state_trackers/oxr/oxr_session.c
··· 210 210 if (xc != NULL) { 211 211 XrViewConfigurationType view_type = beginInfo->primaryViewConfigurationType; 212 212 213 - if (view_type != sess->sys->view_config_type) { 213 + // in a headless session there is no compositor and primaryViewConfigurationType must be ignored 214 + if (sess->compositor != NULL && view_type != sess->sys->view_config_type) { 214 215 /*! @todo we only support a single view config type per 215 216 * system right now */ 216 217 return oxr_error(log, XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED,