34 XrViewConfigurationType
view_type = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO;
77 m_oxr->swapchains.clear();
78 m_oxr->action_sets.clear();
80 if (m_oxr->reference_space != XR_NULL_HANDLE) {
83 if (m_oxr->view_space != XR_NULL_HANDLE) {
86 if (m_oxr->combined_eye_space != XR_NULL_HANDLE) {
89 if (m_oxr->session != XR_NULL_HANDLE) {
93 m_oxr->session = XR_NULL_HANDLE;
94 m_oxr->session_state = XR_SESSION_STATE_UNKNOWN;
96 m_oxr->passthrough_supported =
false;
97 m_oxr->passthrough_layer.layerHandle = XR_NULL_HANDLE;
106void GHOST_XrSession::initSystem()
108 assert(m_context->
getInstance() != XR_NULL_HANDLE);
109 assert(m_oxr->system_id == XR_NULL_SYSTEM_ID);
111 XrSystemGetInfo system_info = {};
112 system_info.type = XR_TYPE_SYSTEM_GET_INFO;
113 system_info.formFactor = XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY;
116 "Failed to get device information. Is a device plugged in?");
126 const GHOST_XrPose &base_pose,
129 XrReferenceSpaceCreateInfo create_info = {XR_TYPE_REFERENCE_SPACE_CREATE_INFO};
130 create_info.poseInReferenceSpace.orientation.w = 1.0f;
132 create_info.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_STAGE;
145 create_info.poseInReferenceSpace.position.x = base_pose->position[0];
146 create_info.poseInReferenceSpace.position.y = base_pose->position[1];
147 create_info.poseInReferenceSpace.position.z = base_pose->position[2];
148 create_info.poseInReferenceSpace.orientation.x = base_pose->orientation_quat[1];
149 create_info.poseInReferenceSpace.orientation.y = base_pose->orientation_quat[2];
150 create_info.poseInReferenceSpace.orientation.z = base_pose->orientation_quat[3];
151 create_info.poseInReferenceSpace.orientation.w = base_pose->orientation_quat[0];
158 if (XR_FAILED(result)) {
162 if (result == XR_ERROR_REFERENCE_SPACE_UNSUPPORTED) {
165 "Warning: XR runtime does not support stage reference space, falling back to local "
166 "reference space.\n");
168 create_info.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL;
170 "Failed to create local reference space.");
180 CHECK_XR(xrGetReferenceSpaceBoundsRect(oxr.
session, XR_REFERENCE_SPACE_TYPE_STAGE, &extents),
181 "Failed to get stage reference space bounds.");
182 if (extents.width == 0.0f || extents.height == 0.0f) {
185 "Warning: Invalid stage reference space bounds, falling back to local reference "
186 "space. To use the stage reference space, please define a tracking space via the XR "
194 create_info.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_LOCAL;
196 "Failed to create local reference space.");
200 create_info.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_VIEW;
202 "Failed to create view reference space.");
206 create_info.referenceSpaceType = XR_REFERENCE_SPACE_TYPE_COMBINED_EYE_VARJO;
208 "Failed to create combined eye reference space.");
214 assert(m_context->
getInstance() != XR_NULL_HANDLE);
215 assert(m_oxr->session == XR_NULL_HANDLE);
218 "Invalid API usage: No way to bind graphics context to the XR session. Call "
219 "GHOST_XrGraphicsContextBindFuncs() with valid parameters before starting the "
220 "session (through GHOST_XrSessionStart()).");
225 bindGraphicsContext();
226 if (m_gpu_ctx ==
nullptr) {
228 "Invalid API usage: No graphics context returned through the callback set with "
229 "GHOST_XrGraphicsContextBindFuncs(). This is required for session starting (through "
230 "GHOST_XrSessionStart()).");
233 std::string requirement_str;
236 if (!m_gpu_binding->checkVersionRequirements(
237 *m_gpu_ctx, m_context->
getInstance(), m_oxr->system_id, &requirement_str))
239 std::ostringstream strstream;
240 strstream <<
"Available graphics context version does not meet the following requirements: "
244 m_gpu_binding->initFromGhostContext(*m_gpu_ctx);
246 XrSessionCreateInfo create_info = {};
247 create_info.type = XR_TYPE_SESSION_CREATE_INFO;
248 create_info.systemId = m_oxr->system_id;
249 create_info.next = &m_gpu_binding->oxr_binding;
252 "Failed to create VR session. The OpenXR runtime may have additional requirements for "
253 "the graphics driver that are not met. Other causes are possible too however.\nTip: "
254 "The --debug-xr command line option for Blender might allow the runtime to output "
255 "detailed error information to the command line.");
266 xrRequestExitSession(m_oxr->session);
269void GHOST_XrSession::beginSession()
271 XrSessionBeginInfo begin_info = {XR_TYPE_SESSION_BEGIN_INFO};
272 begin_info.primaryViewConfigurationType = m_oxr->view_type;
273 CHECK_XR(xrBeginSession(m_oxr->session, &begin_info),
"Failed to cleanly begin the VR session.");
276void GHOST_XrSession::endSession()
278 assert(m_oxr->session != XR_NULL_HANDLE);
279 CHECK_XR(xrEndSession(m_oxr->session),
"Failed to cleanly end the VR session.");
283 const XrEventDataSessionStateChanged &lifecycle)
285 m_oxr->session_state = lifecycle.state;
289 assert(m_oxr->session == XR_NULL_HANDLE || m_oxr->session == lifecycle.session);
291 switch (lifecycle.state) {
292 case XR_SESSION_STATE_READY:
295 case XR_SESSION_STATE_STOPPING:
298 case XR_SESSION_STATE_EXITING:
299 case XR_SESSION_STATE_LOSS_PENDING:
314void GHOST_XrSession::prepareDrawing()
316 assert(m_context->
getInstance() != XR_NULL_HANDLE);
318 std::vector<XrViewConfigurationView> view_configs;
323 m_oxr->view_type = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_QUAD_VARJO;
327 XR_VARJO_FOVEATED_RENDERING_EXTENSION_NAME);
330 xrEnumerateViewConfigurationViews(
331 m_context->
getInstance(), m_oxr->system_id, m_oxr->view_type, 0, &view_count,
nullptr),
332 "Failed to get count of view configurations.");
333 view_configs.resize(view_count, {XR_TYPE_VIEW_CONFIGURATION_VIEW});
339 view_configs.data()),
340 "Failed to get view configurations.");
343 if (m_oxr->foveation_supported) {
344 std::vector<XrFoveatedViewConfigurationViewVARJO> request_foveated_config{
345 view_count, {XR_TYPE_FOVEATED_VIEW_CONFIGURATION_VIEW_VARJO,
nullptr, XR_TRUE}};
347 auto foveated_views = std::vector<XrViewConfigurationView>(view_count,
348 {XR_TYPE_VIEW_CONFIGURATION_VIEW});
350 for (
uint32_t i = 0; i < view_count; i++) {
351 foveated_views[i].next = &request_foveated_config[i];
358 foveated_views.data()),
359 "Failed to get foveated view configurations.");
362 for (
uint32_t i = 0; i < view_count; i++) {
363 view_configs[i].recommendedImageRectWidth = std::max(
364 view_configs[i].recommendedImageRectWidth, foveated_views[i].recommendedImageRectWidth);
365 view_configs[i].recommendedImageRectHeight = std::max(
366 view_configs[i].recommendedImageRectHeight,
367 foveated_views[i].recommendedImageRectHeight);
371 for (
const XrViewConfigurationView &view_config : view_configs) {
372 m_oxr->swapchains.emplace_back(*m_gpu_binding, m_oxr->session, view_config);
375 m_oxr->views.resize(view_count, {XR_TYPE_VIEW});
377 m_draw_info = std::make_unique<GHOST_XrDrawInfo>();
380void GHOST_XrSession::beginFrameDrawing()
382 XrFrameWaitInfo wait_info = {XR_TYPE_FRAME_WAIT_INFO};
383 XrFrameBeginInfo begin_info = {XR_TYPE_FRAME_BEGIN_INFO};
384 XrFrameState frame_state = {XR_TYPE_FRAME_STATE};
387 CHECK_XR(xrWaitFrame(m_oxr->session, &wait_info, &frame_state),
388 "Failed to synchronize frame rates between Blender and the device.");
391 m_draw_info->foveation_active =
false;
392 if (m_oxr->foveation_supported) {
393 XrSpaceLocation render_gaze_location{XR_TYPE_SPACE_LOCATION};
394 CHECK_XR(xrLocateSpace(m_oxr->combined_eye_space,
396 frame_state.predictedDisplayTime,
397 &render_gaze_location),
398 "Failed to locate combined eye space.");
400 m_draw_info->foveation_active = (render_gaze_location.locationFlags &
401 XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT) != 0;
404 CHECK_XR(xrBeginFrame(m_oxr->session, &begin_info),
405 "Failed to submit frame rendering start state.");
407 m_draw_info->frame_state = frame_state;
410 m_draw_info->frame_begin_time = std::chrono::high_resolution_clock::now();
417 std::chrono::duration<double, std::milli> duration = std::chrono::high_resolution_clock::now() -
419 const double duration_ms = duration.count();
420 const int avg_frame_count = 8;
421 double avg_ms_tot = 0.0;
429 avg_ms_tot += ms_iter;
432 printf(
"VR frame render time: %.0fms - %.2f FPS (%.2f FPS 8 frames average)\n",
434 1000.0 / duration_ms,
438void GHOST_XrSession::endFrameDrawing(std::vector<XrCompositionLayerBaseHeader *> &layers)
440 XrFrameEndInfo end_info = {XR_TYPE_FRAME_END_INFO};
442 end_info.displayTime = m_draw_info->frame_state.predictedDisplayTime;
443 end_info.environmentBlendMode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE;
444 end_info.layerCount = layers.size();
445 end_info.layers = layers.data();
447 CHECK_XR(xrEndFrame(m_oxr->session, &end_info),
"Failed to submit rendered frame.");
456 std::vector<XrCompositionLayerProjectionView>
457 projection_layer_views;
458 XrCompositionLayerProjection proj_layer;
459 std::vector<XrCompositionLayerBaseHeader *> layers;
465 if (m_oxr->passthrough_supported) {
466 layers.push_back((XrCompositionLayerBaseHeader *)&m_oxr->passthrough_layer);
473 if (m_draw_info->frame_state.shouldRender) {
474 proj_layer = drawLayer(projection_layer_views, draw_customdata);
475 if (layers.size() > 0) {
476 proj_layer.layerFlags = XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT;
478 layers.push_back(
reinterpret_cast<XrCompositionLayerBaseHeader *
>(&proj_layer));
481 endFrameDrawing(layers);
489 r_info.fov.angle_left = view.fov.angleLeft;
490 r_info.fov.angle_right = view.fov.angleRight;
491 r_info.fov.angle_up = view.fov.angleUp;
492 r_info.fov.angle_down = view.fov.angleDown;
496 XrCompositionLayerProjectionView &r_proj_layer_view,
497 const XrSpaceLocation &view_location,
500 void *draw_customdata)
503 GHOST_XrDrawViewInfo draw_view_info = {};
505 r_proj_layer_view.type = XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW;
506 r_proj_layer_view.pose = view.pose;
507 r_proj_layer_view.fov = view.fov;
510 assert(view_idx < 256);
511 draw_view_info.view_idx = char(view_idx);
512 draw_view_info.swapchain_format = swapchain.
getFormat();
513 draw_view_info.expects_srgb_buffer = swapchain.
isBufferSRGB();
514 draw_view_info.ofsx = r_proj_layer_view.subImage.imageRect.offset.x;
515 draw_view_info.ofsy = r_proj_layer_view.subImage.imageRect.offset.y;
516 draw_view_info.width = r_proj_layer_view.subImage.imageRect.extent.width;
517 draw_view_info.height = r_proj_layer_view.subImage.imageRect.extent.height;
523 m_gpu_binding->submitToSwapchainImage(*swapchain_image, draw_view_info);
528XrCompositionLayerProjection GHOST_XrSession::drawLayer(
529 std::vector<XrCompositionLayerProjectionView> &r_proj_layer_views,
void *draw_customdata)
531 XrViewLocateInfo viewloc_info = {XR_TYPE_VIEW_LOCATE_INFO};
532 XrViewLocateFoveatedRenderingVARJO foveated_info{
533 XR_TYPE_VIEW_LOCATE_FOVEATED_RENDERING_VARJO,
nullptr,
true};
534 XrViewState view_state = {XR_TYPE_VIEW_STATE};
535 XrCompositionLayerProjection layer = {XR_TYPE_COMPOSITION_LAYER_PROJECTION};
536 XrSpaceLocation view_location{XR_TYPE_SPACE_LOCATION};
539 viewloc_info.viewConfigurationType = m_oxr->view_type;
540 viewloc_info.displayTime = m_draw_info->frame_state.predictedDisplayTime;
541 viewloc_info.space = m_oxr->reference_space;
543 if (m_draw_info->foveation_active) {
544 viewloc_info.next = &foveated_info;
547 CHECK_XR(xrLocateViews(m_oxr->session,
552 m_oxr->views.data()),
553 "Failed to query frame view and projection state.");
555 assert(m_oxr->swapchains.size() == view_count);
559 m_oxr->view_space, m_oxr->reference_space, viewloc_info.displayTime, &view_location),
560 "Failed to query frame view space");
562 r_proj_layer_views.resize(view_count);
564 for (
uint32_t view_idx = 0; view_idx < view_count; view_idx++) {
565 drawView(m_oxr->swapchains[view_idx],
566 r_proj_layer_views[view_idx],
568 m_oxr->views[view_idx],
573 layer.space = m_oxr->reference_space;
574 layer.viewCount = r_proj_layer_views.size();
575 layer.views = r_proj_layer_views.data();
582 return m_gpu_binding && m_gpu_binding->needsUpsideDownDrawing(*m_gpu_ctx);
593 if (m_oxr->session == XR_NULL_HANDLE) {
596 switch (m_oxr->session_state) {
597 case XR_SESSION_STATE_READY:
598 case XR_SESSION_STATE_SYNCHRONIZED:
599 case XR_SESSION_STATE_VISIBLE:
600 case XR_SESSION_STATE_FOCUSED:
619void GHOST_XrSession::bindGraphicsContext()
644 std::map<std::string, GHOST_XrActionSet>::iterator it = oxr->
action_sets.find(action_set_name);
653 std::map<std::string, GHOST_XrActionSet> &action_sets = m_oxr->action_sets;
654 if (action_sets.find(info.name) != action_sets.end()) {
661 std::piecewise_construct, std::make_tuple(info.name), std::make_tuple(instance, info));
668 std::map<std::string, GHOST_XrActionSet> &action_sets = m_oxr->action_sets;
670 action_sets.erase(action_set_name);
675 const GHOST_XrActionInfo *infos)
678 if (action_set ==
nullptr) {
695 const char *
const *action_names)
698 if (action_set ==
nullptr) {
709 const GHOST_XrActionProfileInfo *infos)
712 if (action_set ==
nullptr) {
717 XrSession session = m_oxr->session;
719 for (
uint32_t profile_idx = 0; profile_idx <
count; ++profile_idx) {
720 const GHOST_XrActionProfileInfo &info = infos[profile_idx];
723 if (action ==
nullptr) {
735 const char *
const *action_names,
736 const char *
const *profile_paths)
739 if (action_set ==
nullptr) {
745 if (action ==
nullptr) {
756 std::map<XrPath, std::vector<XrActionSuggestedBinding>> profile_bindings;
757 for (
auto &[name, action_set] : m_oxr->action_sets) {
758 action_set.getBindings(profile_bindings);
761 if (profile_bindings.size() < 1) {
765 XrInteractionProfileSuggestedBinding bindings_info{
766 XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING};
769 for (
auto &[profile, bindings] : profile_bindings) {
770 bindings_info.interactionProfile = profile;
771 bindings_info.countSuggestedBindings =
uint32_t(bindings.size());
772 bindings_info.suggestedBindings = bindings.data();
774 CHECK_XR(xrSuggestInteractionProfileBindings(instance, &bindings_info),
775 "Failed to suggest interaction profile bindings.");
779 XrSessionActionSetsAttachInfo attach_info{XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO};
780 attach_info.countActionSets =
uint32_t(m_oxr->action_sets.size());
783 std::vector<XrActionSet> action_sets(attach_info.countActionSets);
785 for (
auto &[name, action_set] : m_oxr->action_sets) {
786 action_sets[i++] = action_set.getActionSet();
788 attach_info.actionSets = action_sets.data();
790 CHECK_XR(xrAttachSessionActionSets(m_oxr->session, &attach_info),
791 "Failed to attach XR action sets.");
798 std::map<std::string, GHOST_XrActionSet> &action_sets = m_oxr->action_sets;
800 XrActionsSyncInfo sync_info{XR_TYPE_ACTIONS_SYNC_INFO};
801 sync_info.countActiveActionSets = (action_set_name !=
nullptr) ? 1 :
803 if (sync_info.countActiveActionSets < 1) {
807 std::vector<XrActiveActionSet> active_action_sets(sync_info.countActiveActionSets);
810 if (action_set_name !=
nullptr) {
812 if (action_set ==
nullptr) {
816 XrActiveActionSet &active_action_set = active_action_sets[0];
817 active_action_set.actionSet = action_set->
getActionSet();
818 active_action_set.subactionPath = XR_NULL_PATH;
822 for (
auto &[name, action_set] : action_sets) {
823 XrActiveActionSet &active_action_set = active_action_sets[i++];
824 active_action_set.actionSet = action_set.
getActionSet();
825 active_action_set.subactionPath = XR_NULL_PATH;
828 sync_info.activeActionSets = active_action_sets.data();
830 CHECK_XR(xrSyncActions(m_oxr->session, &sync_info),
"Failed to synchronize XR actions.");
833 XrSession session = m_oxr->session;
834 XrSpace reference_space = m_oxr->reference_space;
835 const XrTime &predicted_display_time = m_draw_info->frame_state.predictedDisplayTime;
837 if (action_set !=
nullptr) {
838 action_set->
updateStates(session, reference_space, predicted_display_time);
841 for (
auto &[name, action_set] : action_sets) {
842 action_set.
updateStates(session, reference_space, predicted_display_time);
850 const char *action_name,
851 const char *subaction_path,
853 const float &frequency,
854 const float &litude)
857 if (action_set ==
nullptr) {
862 if (action ==
nullptr) {
867 m_oxr->session, action_name, subaction_path, duration, frequency, amplitude);
873 const char *action_name,
874 const char *subaction_path)
877 if (action_set ==
nullptr) {
882 if (action ==
nullptr) {
892 if (action_set ==
nullptr) {
902 if (action_set ==
nullptr) {
907 if (action ==
nullptr) {
917 if (action_set ==
nullptr) {
925 void **r_customdata_array)
928 if (action_set ==
nullptr) {
948 XrSession session = m_oxr->session;
949 std::map<std::string, GHOST_XrControllerModel> &controller_models = m_oxr->controller_models;
950 std::map<std::string, GHOST_XrControllerModel>::iterator it = controller_models.find(
953 if (it == controller_models.end()) {
955 it = controller_models
956 .emplace(std::piecewise_construct,
957 std::make_tuple(subaction_path),
958 std::make_tuple(instance, subaction_path))
962 it->second.load(session);
969 std::map<std::string, GHOST_XrControllerModel> &controller_models = m_oxr->controller_models;
971 controller_models.erase(subaction_path);
976 XrSession session = m_oxr->session;
977 std::map<std::string, GHOST_XrControllerModel>::iterator it = m_oxr->controller_models.find(
979 if (it == m_oxr->controller_models.end()) {
983 it->second.updateComponents(session);
989 GHOST_XrControllerModelData &r_data)
991 std::map<std::string, GHOST_XrControllerModel>::iterator it = m_oxr->controller_models.find(
993 if (it == m_oxr->controller_models.end()) {
997 it->second.getData(r_data);
1030void GHOST_XrSession::enablePassthrough()
1033 m_oxr->passthrough_supported =
false;
1037 if (m_oxr->passthrough_layer.layerHandle != XR_NULL_HANDLE) {
1045 XrPassthroughCreateInfoFB passthrough_create_info = {};
1046 passthrough_create_info.type = XR_TYPE_PASSTHROUGH_CREATE_INFO_FB;
1047 passthrough_create_info.next =
nullptr;
1048 passthrough_create_info.flags |= XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB;
1050 XrPassthroughFB passthrough_handle;
1053 XrPassthroughLayerCreateInfoFB passthrough_layer_create_info;
1054 passthrough_layer_create_info.type = XR_TYPE_PASSTHROUGH_LAYER_CREATE_INFO_FB;
1055 passthrough_layer_create_info.next =
nullptr;
1056 passthrough_layer_create_info.passthrough = passthrough_handle;
1057 passthrough_layer_create_info.flags |= XR_PASSTHROUGH_IS_RUNNING_AT_CREATION_BIT_FB;
1058 passthrough_layer_create_info.purpose = XR_PASSTHROUGH_LAYER_PURPOSE_RECONSTRUCTION_FB;
1060 XrPassthroughLayerFB passthrough_layer_handle;
1062 m_oxr->session, &passthrough_layer_create_info, &passthrough_layer_handle);
1067 m_oxr->passthrough_layer.type = XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB;
1068 m_oxr->passthrough_layer.next =
nullptr;
1069 m_oxr->passthrough_layer.flags = XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT;
1070 m_oxr->passthrough_layer.space =
nullptr;
1071 m_oxr->passthrough_layer.layerHandle = passthrough_layer_handle;
1073 m_oxr->passthrough_supported = (result == XR_SUCCESS);
GHOST C-API function and type declarations.
std::unique_ptr< GHOST_IXrGraphicsBinding > GHOST_XrGraphicsBindingCreateFromType(GHOST_TXrGraphicsBinding type, GHOST_Context &context)
static void init_passthrough_extension_functions(XrInstance instance)
static void create_reference_spaces(OpenXRSessionData &oxr, const GHOST_XrPose &base_pose, bool isDebugMode)
static void print_debug_timings(GHOST_XrDrawInfo &draw_info)
static void ghost_xr_draw_view_info_from_view(const XrView &view, GHOST_XrDrawViewInfo &r_info)
static PFN_xrCreatePassthroughLayerFB g_xrCreatePassthroughLayerFB
static PFN_xrPassthroughLayerResumeFB g_xrPassthroughLayerResumeFB
static PFN_xrCreatePassthroughFB g_xrCreatePassthroughFB
static PFN_xrPassthroughStartFB g_xrPassthroughStartFB
static GHOST_XrActionSet * find_action_set(OpenXRSessionData *oxr, const char *action_set_name)
void copy_openxr_pose_to_ghost_pose(const XrPosef &oxr_pose, GHOST_XrPose &r_ghost_pose)
#define INIT_EXTENSION_FUNCTION(name)
#define CHECK_XR_ASSERT(call)
#define CHECK_XR(call, error_msg)
void updateStates(XrSession session, XrSpace reference_space, const XrTime &predicted_display_time)
GHOST_XrAction * findAction(const char *action_name)
bool createAction(XrInstance instance, const GHOST_XrActionInfo &info)
XrActionSet getActionSet() const
void getActionCustomdataArray(void **r_customdata_array)
uint32_t getActionCount() const
void destroyAction(const char *action_name)
bool createBinding(XrInstance instance, XrSession session, const GHOST_XrActionProfileInfo &info)
void destroyBinding(const char *profile_path)
void applyHapticFeedback(XrSession session, const char *action_name, const char *subaction_path_str, const int64_t &duration, const float &frequency, const float &litude)
void stopHapticFeedback(XrSession session, const char *action_name, const char *subaction_path_str)
Main GHOST container to manage OpenXR through.
XrInstance getInstance() const
GHOST_TXrGraphicsBinding getGraphicsBindingType() const
const GHOST_XrCustomFuncs & getCustomFuncs() const
bool isDebugTimeMode() const
bool isExtensionEnabled(const char *ext) const
void destroyActionBindings(const char *action_set_name, uint32_t count, const char *const *action_names, const char *const *profile_paths)
void destroyActionSet(const char *action_set_name)
void draw(void *draw_customdata)
bool createActionSet(const GHOST_XrActionSetInfo &info)
void * getActionCustomdata(const char *action_set_name, const char *action_name)
void unloadControllerModel(const char *subaction_path)
void * getActionSetCustomdata(const char *action_set_name)
bool updateControllerModelComponents(const char *subaction_path)
bool createActionBindings(const char *action_set_name, uint32_t count, const GHOST_XrActionProfileInfo *infos)
GHOST_XrSession(GHOST_XrContext &xr_context)
void stopHapticAction(const char *action_set_name, const char *action_name, const char *subaction_path)
LifeExpectancy handleStateChangeEvent(const XrEventDataSessionStateChanged &lifecycle)
void getActionCustomdataArray(const char *action_set_name, void **r_customdata_array)
bool loadControllerModel(const char *subaction_path)
bool syncActions(const char *action_set_name=nullptr)
bool needsUpsideDownDrawing() const
void start(const GHOST_XrSessionBeginInfo *begin_info)
void destroyActions(const char *action_set_name, uint32_t count, const char *const *action_names)
void unbindGraphicsContext()
bool applyHapticAction(const char *action_set_name, const char *action_name, const char *subaction_path, const int64_t &duration, const float &frequency, const float &litude)
uint32_t getActionCount(const char *action_set_name)
bool getControllerModelData(const char *subaction_path, GHOST_XrControllerModelData &r_data)
bool createActions(const char *action_set_name, uint32_t count, const GHOST_XrActionInfo *infos)
GHOST_TXrSwapchainFormat getFormat() const
void updateCompositionLayerProjectViewSubImage(XrSwapchainSubImage &r_sub_image)
bool isBufferSRGB() const
XrSwapchainImageBaseHeader * acquireDrawableSwapchainImage()
GHOST_XrDrawViewFn draw_view_fn
GHOST_XrSessionExitFn session_exit_fn
GHOST_XrSessionCreateFn session_create_fn
void * session_exit_customdata
GHOST_XrDisablePassthroughFn disable_passthrough_fn
GHOST_XrGraphicsContextUnbindFn gpu_ctx_unbind_fn
GHOST_XrGraphicsContextBindFn gpu_ctx_bind_fn
GHOST_XrPassthroughEnabledFn passthrough_enabled_fn
std::chrono::high_resolution_clock::time_point frame_begin_time
std::list< double > last_frame_times
XrSpace combined_eye_space
XrCompositionLayerPassthroughFB passthrough_layer
std::map< std::string, GHOST_XrControllerModel > controller_models
bool passthrough_supported
XrViewConfigurationType view_type
std::map< std::string, GHOST_XrActionSet > action_sets
XrSessionState session_state
std::vector< GHOST_XrSwapchain > swapchains
std::vector< XrView > views