st/oxr: Ignore primaryViewConfigurationType in headless

Spec:
"In a headless session, the XrSessionBeginInfo::primaryViewConfigurationType must be ignored and may be 0."
This commit is contained in:
Christoph Haag 2024-05-29 22:51:12 +02:00
parent 5980804535
commit ccfac98d36
2 changed files with 7 additions and 2 deletions

View file

@ -94,7 +94,11 @@ oxr_xrBeginSession(XrSession session, const XrSessionBeginInfo *beginInfo)
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrBeginSession");
OXR_VERIFY_SESSION_NOT_LOST(&log, sess);
OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, beginInfo, XR_TYPE_SESSION_BEGIN_INFO);
OXR_VERIFY_VIEW_CONFIG_TYPE(&log, sess->sys->inst, beginInfo->primaryViewConfigurationType);
// in a headless session there is no compositor and primaryViewConfigurationType must be ignored
if (sess->compositor != NULL) {
OXR_VERIFY_VIEW_CONFIG_TYPE(&log, sess->sys->inst, beginInfo->primaryViewConfigurationType);
}
if (sess->has_begun) {
return oxr_error(&log, XR_ERROR_SESSION_RUNNING, "Session is already running");

View file

@ -210,7 +210,8 @@ oxr_session_begin(struct oxr_logger *log, struct oxr_session *sess, const XrSess
if (xc != NULL) {
XrViewConfigurationType view_type = beginInfo->primaryViewConfigurationType;
if (view_type != sess->sys->view_config_type) {
// in a headless session there is no compositor and primaryViewConfigurationType must be ignored
if (sess->compositor != NULL && view_type != sess->sys->view_config_type) {
/*! @todo we only support a single view config type per
* system right now */
return oxr_error(log, XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED,