mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-03 12:28:07 +00:00
st/oxr: Rename the action set and action keys to distinct names.
This commit is contained in:
parent
2f8d1a54a5
commit
640fa1bbe5
src/xrt/state_trackers/oxr
|
@ -430,7 +430,8 @@ oxr_xrGetActionStateBoolean(XrSession session,
|
|||
return ret;
|
||||
}
|
||||
|
||||
return oxr_action_get_boolean(&log, sess, act->key, sub_paths, data);
|
||||
return oxr_action_get_boolean(&log, sess, act->act_key, sub_paths,
|
||||
data);
|
||||
}
|
||||
|
||||
XrResult
|
||||
|
@ -463,7 +464,8 @@ oxr_xrGetActionStateFloat(XrSession session,
|
|||
return ret;
|
||||
}
|
||||
|
||||
return oxr_action_get_vector1f(&log, sess, act->key, sub_paths, data);
|
||||
return oxr_action_get_vector1f(&log, sess, act->act_key, sub_paths,
|
||||
data);
|
||||
}
|
||||
|
||||
XrResult
|
||||
|
@ -496,7 +498,8 @@ oxr_xrGetActionStateVector2f(XrSession session,
|
|||
return ret;
|
||||
}
|
||||
|
||||
return oxr_action_get_vector2f(&log, sess, act->key, sub_paths, data);
|
||||
return oxr_action_get_vector2f(&log, sess, act->act_key, sub_paths,
|
||||
data);
|
||||
}
|
||||
|
||||
XrResult
|
||||
|
@ -528,7 +531,7 @@ oxr_xrGetActionStatePose(XrSession session,
|
|||
return ret;
|
||||
}
|
||||
|
||||
return oxr_action_get_pose(&log, sess, act->key, sub_paths, data);
|
||||
return oxr_action_get_pose(&log, sess, act->act_key, sub_paths, data);
|
||||
}
|
||||
|
||||
XrResult
|
||||
|
@ -555,7 +558,7 @@ oxr_xrEnumerateBoundSourcesForAction(
|
|||
"been called on this session.");
|
||||
}
|
||||
|
||||
return oxr_action_enumerate_bound_sources(&log, sess, act->key,
|
||||
return oxr_action_enumerate_bound_sources(&log, sess, act->act_key,
|
||||
sourceCapacityInput,
|
||||
sourceCountOutput, sources);
|
||||
}
|
||||
|
@ -597,8 +600,8 @@ oxr_xrApplyHapticFeedback(XrSession session,
|
|||
"Not created with output vibration type");
|
||||
}
|
||||
|
||||
return oxr_action_apply_haptic_feedback(&log, sess, act->key, sub_paths,
|
||||
hapticEvent);
|
||||
return oxr_action_apply_haptic_feedback(&log, sess, act->act_key,
|
||||
sub_paths, hapticEvent);
|
||||
}
|
||||
|
||||
XrResult
|
||||
|
@ -628,5 +631,6 @@ oxr_xrStopHapticFeedback(XrSession session,
|
|||
"Not created with output vibration type");
|
||||
}
|
||||
|
||||
return oxr_action_stop_haptic_feedback(&log, sess, act->key, sub_paths);
|
||||
return oxr_action_stop_haptic_feedback(&log, sess, act->act_key,
|
||||
sub_paths);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ oxr_xrCreateActionSpace(XrSession session,
|
|||
|
||||
struct oxr_space *spc;
|
||||
XrResult ret =
|
||||
oxr_space_action_create(&log, sess, act->key, createInfo, &spc);
|
||||
oxr_space_action_create(&log, sess, act->act_key, createInfo, &spc);
|
||||
if (ret != XR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -370,7 +370,7 @@ oxr_action_suggest_interaction_profile_bindings(
|
|||
XRT_CAST_OXR_HANDLE_TO_PTR(struct oxr_action *, s->action);
|
||||
|
||||
add_key_to_matching_bindings(bindings, num_bindings, s->binding,
|
||||
act->key);
|
||||
act->act_key);
|
||||
}
|
||||
|
||||
return XR_SUCCESS;
|
||||
|
|
|
@ -99,7 +99,8 @@ static void
|
|||
oxr_action_attachment_teardown(struct oxr_action_attachment *act_attached)
|
||||
{
|
||||
struct oxr_session *sess = act_attached->sess;
|
||||
u_hashmap_int_erase(sess->act_attachments_by_key, act_attached->key);
|
||||
u_hashmap_int_erase(sess->act_attachments_by_key,
|
||||
act_attached->act_key);
|
||||
oxr_source_cache_teardown(&(act_attached->user));
|
||||
oxr_source_cache_teardown(&(act_attached->head));
|
||||
oxr_source_cache_teardown(&(act_attached->left));
|
||||
|
@ -121,12 +122,12 @@ oxr_action_attachment_init(struct oxr_logger *log,
|
|||
struct oxr_session *sess = act_set_attached->sess;
|
||||
act_attached->sess = sess;
|
||||
act_attached->act_set_attached = act_set_attached;
|
||||
u_hashmap_int_insert(sess->act_attachments_by_key, act->key,
|
||||
u_hashmap_int_insert(sess->act_attachments_by_key, act->act_key,
|
||||
act_attached);
|
||||
|
||||
// Need to copy these, since we may outlive the action handle.
|
||||
act_attached->action_type = act->action_type;
|
||||
act_attached->key = act->key;
|
||||
act_attached->act_key = act->act_key;
|
||||
return XR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -149,11 +150,11 @@ oxr_action_set_attachment_init(
|
|||
{
|
||||
act_set_attached->sess = sess;
|
||||
|
||||
u_hashmap_int_insert(sess->act_sets_attachments_by_key, act_set->key,
|
||||
act_set_attached);
|
||||
u_hashmap_int_insert(sess->act_sets_attachments_by_key,
|
||||
act_set->act_set_key, act_set_attached);
|
||||
|
||||
// Need to copy these, since we may outlive the action handle.
|
||||
act_set_attached->key = act_set->key;
|
||||
act_set_attached->act_set_key = act_set->act_set_key;
|
||||
|
||||
return XR_SUCCESS;
|
||||
}
|
||||
|
@ -172,7 +173,7 @@ oxr_action_set_attachment_teardown(
|
|||
|
||||
struct oxr_session *sess = act_set_attached->sess;
|
||||
u_hashmap_int_erase(sess->act_sets_attachments_by_key,
|
||||
act_set_attached->key);
|
||||
act_set_attached->act_set_key);
|
||||
}
|
||||
|
||||
|
||||
|
@ -238,7 +239,7 @@ oxr_action_set_create(struct oxr_logger *log,
|
|||
"Failed to create loc_store hashset");
|
||||
}
|
||||
|
||||
act_set->key = key_gen++;
|
||||
act_set->act_set_key = key_gen++;
|
||||
|
||||
act_set->inst = inst;
|
||||
strncpy(act_set->name, createInfo->actionSetName,
|
||||
|
@ -308,7 +309,7 @@ oxr_action_create(struct oxr_logger *log,
|
|||
struct oxr_action *act = NULL;
|
||||
OXR_ALLOCATE_HANDLE_OR_RETURN(log, act, OXR_XR_DEBUG_ACTION,
|
||||
oxr_action_destroy_cb, &act_set->handle);
|
||||
act->key = key_gen++;
|
||||
act->act_key = key_gen++;
|
||||
act->act_set = act_set;
|
||||
act->sub_paths = sub_paths;
|
||||
act->action_type = createInfo->actionType;
|
||||
|
@ -552,7 +553,7 @@ get_matched_xrpath(struct oxr_binding *b, struct oxr_action *act)
|
|||
{
|
||||
XrPath preferred_path = XR_NULL_PATH;
|
||||
for (uint32_t i = 0; i < b->num_keys; i++) {
|
||||
if (b->keys[i] == act->key) {
|
||||
if (b->keys[i] == act->act_key) {
|
||||
uint32_t preferred_path_index = XR_NULL_PATH;
|
||||
preferred_path_index =
|
||||
b->preferred_binding_path_index[i];
|
||||
|
@ -626,7 +627,7 @@ get_binding(struct oxr_logger *log,
|
|||
oxr_slog(slog, "\t\tProfile: %s\n", profile_str);
|
||||
|
||||
size_t num = 0;
|
||||
oxr_binding_find_bindings_from_key(log, profile, act->key, bindings,
|
||||
oxr_binding_find_bindings_from_key(log, profile, act->act_key, bindings,
|
||||
&num);
|
||||
if (num == 0) {
|
||||
oxr_slog(slog, "\t\tNo bindings\n");
|
||||
|
@ -1040,15 +1041,15 @@ oxr_session_get_action_set_attachment(
|
|||
XRT_CAST_OXR_HANDLE_TO_PTR(struct oxr_action_set *, actionSet);
|
||||
|
||||
int ret = u_hashmap_int_find(sess->act_sets_attachments_by_key,
|
||||
(*act_set)->key, &ptr);
|
||||
(*act_set)->act_set_key, &ptr);
|
||||
if (ret == 0) {
|
||||
*act_set_attached = (struct oxr_action_set_attachment *)ptr;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* Given an action key, look up the @ref oxr_action_attachment of the associated
|
||||
* action in the given Session.
|
||||
* Given an action act_key, look up the @ref oxr_action_attachment of the
|
||||
* associated action in the given Session.
|
||||
*
|
||||
* @private @memberof oxr_session
|
||||
*/
|
||||
|
@ -1327,13 +1328,13 @@ get_state_from_state_vec2(struct oxr_action_state *state,
|
|||
XrResult
|
||||
oxr_action_get_boolean(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStateBoolean *data)
|
||||
{
|
||||
struct oxr_action_attachment *act_attached = NULL;
|
||||
|
||||
oxr_session_get_action_attachment(sess, key, &act_attached);
|
||||
oxr_session_get_action_attachment(sess, act_key, &act_attached);
|
||||
if (act_attached == NULL) {
|
||||
return oxr_error(
|
||||
log, XR_ERROR_ACTIONSET_NOT_ATTACHED,
|
||||
|
@ -1352,13 +1353,13 @@ oxr_action_get_boolean(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_get_vector1f(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStateFloat *data)
|
||||
{
|
||||
struct oxr_action_attachment *act_attached = NULL;
|
||||
|
||||
oxr_session_get_action_attachment(sess, key, &act_attached);
|
||||
oxr_session_get_action_attachment(sess, act_key, &act_attached);
|
||||
if (act_attached == NULL) {
|
||||
return oxr_error(
|
||||
log, XR_ERROR_ACTIONSET_NOT_ATTACHED,
|
||||
|
@ -1376,13 +1377,13 @@ oxr_action_get_vector1f(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_get_vector2f(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStateVector2f *data)
|
||||
{
|
||||
struct oxr_action_attachment *act_attached = NULL;
|
||||
|
||||
oxr_session_get_action_attachment(sess, key, &act_attached);
|
||||
oxr_session_get_action_attachment(sess, act_key, &act_attached);
|
||||
if (act_attached == NULL) {
|
||||
return oxr_error(
|
||||
log, XR_ERROR_ACTIONSET_NOT_ATTACHED,
|
||||
|
@ -1400,13 +1401,13 @@ oxr_action_get_vector2f(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_get_pose(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStatePose *data)
|
||||
{
|
||||
struct oxr_action_attachment *act_attached = NULL;
|
||||
|
||||
oxr_session_get_action_attachment(sess, key, &act_attached);
|
||||
oxr_session_get_action_attachment(sess, act_key, &act_attached);
|
||||
if (act_attached == NULL) {
|
||||
return oxr_error(
|
||||
log, XR_ERROR_ACTIONSET_NOT_ATTACHED,
|
||||
|
@ -1467,13 +1468,13 @@ set_action_output_vibration(struct oxr_session *sess,
|
|||
XrResult
|
||||
oxr_action_apply_haptic_feedback(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
const XrHapticBaseHeader *hapticEvent)
|
||||
{
|
||||
struct oxr_action_attachment *act_attached = NULL;
|
||||
|
||||
oxr_session_get_action_attachment(sess, key, &act_attached);
|
||||
oxr_session_get_action_attachment(sess, act_key, &act_attached);
|
||||
if (act_attached == NULL) {
|
||||
return oxr_error(
|
||||
log, XR_ERROR_ACTIONSET_NOT_ATTACHED,
|
||||
|
@ -1509,12 +1510,12 @@ oxr_action_apply_haptic_feedback(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_stop_haptic_feedback(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths)
|
||||
{
|
||||
struct oxr_action_attachment *act_attached = NULL;
|
||||
|
||||
oxr_session_get_action_attachment(sess, key, &act_attached);
|
||||
oxr_session_get_action_attachment(sess, act_key, &act_attached);
|
||||
if (act_attached == NULL) {
|
||||
return oxr_error(
|
||||
log, XR_ERROR_ACTIONSET_NOT_ATTACHED,
|
||||
|
|
|
@ -430,7 +430,7 @@ oxr_action_sync_data(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_get_boolean(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStateBoolean *data);
|
||||
/*!
|
||||
|
@ -439,7 +439,7 @@ oxr_action_get_boolean(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_get_vector1f(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStateFloat *data);
|
||||
|
||||
|
@ -449,7 +449,7 @@ oxr_action_get_vector1f(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_get_vector2f(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStateVector2f *data);
|
||||
/*!
|
||||
|
@ -458,7 +458,7 @@ oxr_action_get_vector2f(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_get_pose(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
XrActionStatePose *data);
|
||||
/*!
|
||||
|
@ -467,7 +467,7 @@ oxr_action_get_pose(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_apply_haptic_feedback(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths,
|
||||
const XrHapticBaseHeader *hapticEvent);
|
||||
/*!
|
||||
|
@ -476,7 +476,7 @@ oxr_action_apply_haptic_feedback(struct oxr_logger *log,
|
|||
XrResult
|
||||
oxr_action_stop_haptic_feedback(struct oxr_logger *log,
|
||||
struct oxr_session *sess,
|
||||
uint64_t key,
|
||||
uint32_t act_key,
|
||||
struct oxr_sub_paths sub_paths);
|
||||
|
||||
/*!
|
||||
|
@ -1345,7 +1345,7 @@ struct oxr_action_set_attachment
|
|||
struct oxr_session *sess;
|
||||
|
||||
//! Unique key for the session hashmap.
|
||||
uint32_t key;
|
||||
uint32_t act_set_key;
|
||||
|
||||
//! Which sub-action paths are requested on the latest sync.
|
||||
struct oxr_sub_paths requested_sub_paths;
|
||||
|
@ -1460,7 +1460,7 @@ struct oxr_action_attachment
|
|||
struct oxr_session *sess;
|
||||
|
||||
//! Unique key for the session hashmap.
|
||||
uint32_t key;
|
||||
uint32_t act_key;
|
||||
|
||||
//! Type the action this source was created from is.
|
||||
XrActionType action_type;
|
||||
|
@ -1613,7 +1613,7 @@ struct oxr_action_set
|
|||
bool attached;
|
||||
|
||||
//! Unique key for the session hashmap.
|
||||
uint32_t key;
|
||||
uint32_t act_set_key;
|
||||
|
||||
//! The item in the name hashset.
|
||||
struct u_hashset_item *name_item;
|
||||
|
@ -1651,7 +1651,7 @@ struct oxr_action
|
|||
char name[XR_MAX_ACTION_NAME_SIZE];
|
||||
|
||||
//! Unique key for the session hashmap.
|
||||
uint32_t key;
|
||||
uint32_t act_key;
|
||||
|
||||
//! Type this action was created with.
|
||||
XrActionType action_type;
|
||||
|
|
Loading…
Reference in a new issue