The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: support XrEventDataVisibilityMaskChangedKHR for visibility mask

authored by

Qichang Sun and committed by
Qichang Sun
7fd2a8cc 92a18718

+50
+13
src/xrt/include/xrt/xrt_session.h
··· 61 61 62 62 //! The passthrough state of the session has changed 63 63 XRT_SESSION_EVENT_PASSTHRU_STATE_CHANGE = 8, 64 + 65 + // ! The visibility mask of given view has changed 66 + XRT_SESSION_EVENT_VISIBILITY_MASK_CHANGE = 9 64 67 }; 65 68 66 69 /*! ··· 165 168 }; 166 169 167 170 /*! 171 + * Visibility mask changed event 172 + */ 173 + struct xrt_session_event_visibility_mask_change 174 + { 175 + enum xrt_session_event_type type; 176 + uint32_t view_index; 177 + }; 178 + 179 + /*! 168 180 * Union of all session events, used to return multiple events through one call. 169 181 * Each event struct must start with a @ref xrt_session_event_type field. 170 182 * ··· 181 193 struct xrt_session_event_reference_space_change_pending ref_change; 182 194 struct xrt_session_event_perf_change performance; 183 195 struct xrt_session_event_passthrough_state_change passthru; 196 + struct xrt_session_event_visibility_mask_change mask_change; 184 197 }; 185 198 186 199 /*!
+25
src/xrt/state_trackers/oxr/oxr_event.c
··· 318 318 } 319 319 #endif // OXR_HAVE_FB_passthrough 320 320 321 + #ifdef OXR_HAVE_KHR_visibility_mask 322 + XrResult 323 + oxr_event_push_XrEventDataVisibilityMaskChangedKHR(struct oxr_logger *log, 324 + struct oxr_session *sess, 325 + XrViewConfigurationType viewConfigurationType, 326 + uint32_t viewIndex) 327 + { 328 + struct oxr_instance *inst = sess->sys->inst; 329 + XrEventDataVisibilityMaskChangedKHR *changed; 330 + struct oxr_event *event = NULL; 331 + 332 + ALLOC(log, inst, &event, &changed); 333 + changed->type = XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR; 334 + changed->session = oxr_session_to_openxr(sess); 335 + changed->viewConfigurationType = viewConfigurationType; 336 + changed->viewIndex = viewIndex; 337 + event->result = XR_SUCCESS; 338 + lock(inst); 339 + push(inst, event); 340 + unlock(inst); 341 + 342 + return XR_SUCCESS; 343 + } 344 + #endif // OXR_HAVE_KHR_visibility_mask 345 + 321 346 XrResult 322 347 oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess) 323 348 {
+6
src/xrt/state_trackers/oxr/oxr_objects.h
··· 824 824 XrVisibilityMaskTypeKHR visibilityMaskType, 825 825 uint32_t viewIndex, 826 826 XrVisibilityMaskKHR *visibilityMask); 827 + 828 + XrResult 829 + oxr_event_push_XrEventDataVisibilityMaskChangedKHR(struct oxr_logger *log, 830 + struct oxr_session *sess, 831 + XrViewConfigurationType viewConfigurationType, 832 + uint32_t viewIndex); 827 833 #endif // OXR_HAVE_KHR_visibility_mask 828 834 829 835 #ifdef OXR_HAVE_EXT_performance_settings
+6
src/xrt/state_trackers/oxr/oxr_session.c
··· 403 403 log, sess, xrt_to_passthrough_state_flags(xse.passthru.state)); 404 404 #endif // OXR_HAVE_FB_passthrough 405 405 break; 406 + case XRT_SESSION_EVENT_VISIBILITY_MASK_CHANGE: 407 + #ifdef OXR_HAVE_KHR_visibility_mask 408 + oxr_event_push_XrEventDataVisibilityMaskChangedKHR(log, sess, sess->sys->view_config_type, 409 + xse.mask_change.view_index); 410 + #endif // OXR_HAVE_KHR_visibility_mask 411 + break; 406 412 default: U_LOG_W("unhandled event type! %d", xse.type); break; 407 413 } 408 414 }