The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: Track the primary view configuration

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2612>

+18 -2
+7
src/xrt/state_trackers/oxr/oxr_objects.h
··· 1849 1849 XrSessionState state; 1850 1850 1851 1851 /*! 1852 + * This is set in xrBeginSession and is the primaryViewConfiguration 1853 + * argument, this is then used in xrEndFrame to know which view 1854 + * configuration the application is submitting it's frame in. 1855 + */ 1856 + XrViewConfigurationType current_view_config_type; 1857 + 1858 + /*! 1852 1859 * There is a extra state between xrBeginSession has been called and 1853 1860 * the first xrEndFrame has been called. These are to track this. 1854 1861 */
+9
src/xrt/state_trackers/oxr/oxr_session.c
··· 347 347 "Frame sync object refused to let us begin session, probably already running"); 348 348 } 349 349 350 + // Set the current view configuration type, used in xrEndFrame. 351 + sess->current_view_config_type = beginInfo->primaryViewConfigurationType; 352 + 350 353 return oxr_session_success_result(sess); 351 354 } 352 355 ··· 412 415 return oxr_error(log, ret, "Frame sync object refused to let us end session, probably not running"); 413 416 } 414 417 sess->has_ended_once = false; 418 + 419 + // Unset the current view configuration type here. 420 + sess->current_view_config_type = XR_VIEW_CONFIGURATION_TYPE_MAX_ENUM; 415 421 416 422 return oxr_session_success_result(sess); 417 423 } ··· 1071 1077 // Action system hashmaps. 1072 1078 u_hashmap_int_create(&sess->act_sets_attachments_by_key); 1073 1079 u_hashmap_int_create(&sess->act_attachments_by_key); 1080 + 1081 + // This is set to something valid in begin session, used in xrEndFrame. 1082 + sess->current_view_config_type = XR_VIEW_CONFIGURATION_TYPE_MAX_ENUM; 1074 1083 1075 1084 // Done with basic init, set out variable. 1076 1085 *out_session = sess;
+2 -2
src/xrt/state_trackers/oxr/oxr_session_frame_end.c
··· 595 595 return ret; 596 596 } 597 597 598 - switch (sess->sys->view_config_type) { 598 + switch (sess->current_view_config_type) { 599 599 case XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO: 600 600 if (proj->viewCount != 1) { 601 601 return oxr_error(log, XR_ERROR_VALIDATION_FAILURE, ··· 631 631 default: 632 632 assert(false && "view type validation unimplemented"); 633 633 return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "view type %d not supported", 634 - sess->sys->view_config_type); 634 + sess->current_view_config_type); 635 635 break; 636 636 } 637 637