xrt: Plumbs enabled ext state for XR_EXT_eye_gaze_interaction

This commit is contained in:
Korcan Hussein 2023-05-26 12:28:07 +01:00 committed by Jakob Bornecrantz
parent 6b493e2968
commit 8865baafee
6 changed files with 18 additions and 5 deletions

View file

@ -1,10 +1,11 @@
// Copyright 2019-2022, Collabora, Ltd.
// Copyright 2019-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Multi client wrapper compositor.
* @author Pete Black <pblack@collabora.com>
* @author Jakob Bornecrantz <jakob@collabora.com>
* @author Korcan Hussein <korcan.hussein@collabora.com>
* @ingroup comp_multi
*/
@ -371,6 +372,7 @@ update_session_state_locked(struct multi_system_compositor *msc)
const struct xrt_begin_session_info begin_session_info = {
.view_type = XRT_VIEW_TYPE_STEREO,
.ext_hand_tracking_enabled = false,
.ext_eye_gaze_interaction_enabled = false,
};
switch (msc->sessions.state) {

View file

@ -861,6 +861,7 @@ struct xrt_begin_session_info
{
enum xrt_view_type view_type;
bool ext_hand_tracking_enabled;
bool ext_eye_gaze_interaction_enabled;
};
/*!

View file

@ -4,6 +4,7 @@
* @file
* @brief Header for @ref xrt_instance object.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @author Korcan Hussein <korcan.hussein@collabora.com>
* @ingroup xrt_iface
*/
@ -39,6 +40,7 @@ struct xrt_instance_info
{
char application_name[XRT_MAX_APPLICATION_NAME_SIZE];
bool ext_hand_tracking_enabled;
bool ext_eye_gaze_interaction_enabled;
};
/*!

View file

@ -214,6 +214,7 @@ ipc_handle_session_begin(volatile struct ipc_client_state *ics)
const struct xrt_begin_session_info begin_session_info = {
.view_type = XRT_VIEW_TYPE_STEREO,
.ext_hand_tracking_enabled = ics->client_state.info.ext_hand_tracking_enabled,
.ext_eye_gaze_interaction_enabled = ics->client_state.info.ext_eye_gaze_interaction_enabled,
};
return xrt_comp_begin_session(ics->xc, &begin_session_info);

View file

@ -4,6 +4,7 @@
* @file
* @brief Holds instance related functions.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @author Korcan Hussein <korcan.hussein@collabora.com>
* @ingroup oxr_main
*/
@ -245,10 +246,12 @@ oxr_instance_create(struct oxr_logger *log,
// fill in our application info - @todo - replicate all createInfo
// fields?
struct xrt_instance_info i_info = {0};
struct xrt_instance_info i_info = {
.ext_hand_tracking_enabled = extensions->EXT_hand_tracking,
.ext_eye_gaze_interaction_enabled = extensions->EXT_eye_gaze_interaction,
};
snprintf(i_info.application_name, sizeof(inst->xinst->instance_info.application_name), "%s",
createInfo->applicationInfo.applicationName);
i_info.ext_hand_tracking_enabled = extensions->EXT_hand_tracking;
#ifdef XRT_OS_ANDROID
XrInstanceCreateInfoAndroidKHR const *create_info_android = OXR_GET_INPUT_FROM_CHAIN(

View file

@ -1,10 +1,11 @@
// Copyright 2018-2022, Collabora, Ltd.
// Copyright 2018-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Holds session related functions.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @author Moses Turner <mosesturner@protonmail.com>
* @author Korcan Hussein <korcan.hussein@collabora.com>
* @ingroup oxr_main
*/
@ -139,9 +140,12 @@ oxr_session_begin(struct oxr_logger *log, struct oxr_session *sess, const XrSess
view_type);
}
const struct oxr_extension_status *extensions = &sess->sys->inst->extensions;
const struct xrt_begin_session_info begin_session_info = {
.view_type = (enum xrt_view_type)beginInfo->primaryViewConfigurationType,
.ext_hand_tracking_enabled = sess->sys->inst->extensions.EXT_hand_tracking,
.ext_hand_tracking_enabled = extensions->EXT_hand_tracking,
.ext_eye_gaze_interaction_enabled = extensions->EXT_eye_gaze_interaction,
};
xrt_result_t xret = xrt_comp_begin_session(xc, &begin_session_info);