Skip to content
Snippets Groups Projects
Commit c6d25a97 authored by Christoph Haag's avatar Christoph Haag
Browse files

st/oxr: Convert action timestamp with time_state_monotonic_to_ts_ns

Action timestamps were missing this conversion to XrTime with time_state_monotonic_to_ts_ns()
which caused them to be out of sync with the predicted frame times and device "pose at" timestamps.
parent 2a9a14c6
Branches
Tags
No related merge requests found
...@@ -1333,13 +1333,15 @@ oxr_action_sync_data(struct oxr_logger *log, ...@@ -1333,13 +1333,15 @@ oxr_action_sync_data(struct oxr_logger *log,
#define OXR_ACTION_GET_XR_STATE_FROM_ACTION_STATE_COMMON(ACTION_STATE, DATA) \ #define OXR_ACTION_GET_XR_STATE_FROM_ACTION_STATE_COMMON(ACTION_STATE, DATA) \
do { \ do { \
DATA->lastChangeTime = ACTION_STATE->timestamp; \ DATA->lastChangeTime = time_state_monotonic_to_ts_ns( \
inst->timekeeping, ACTION_STATE->timestamp); \
DATA->changedSinceLastSync = ACTION_STATE->changed; \ DATA->changedSinceLastSync = ACTION_STATE->changed; \
DATA->isActive = XR_TRUE; \ DATA->isActive = XR_TRUE; \
} while (0) } while (0)
static void static void
get_xr_state_from_action_state_bool(struct oxr_action_state *state, get_xr_state_from_action_state_bool(struct oxr_instance *inst,
struct oxr_action_state *state,
XrActionStateBoolean *data) XrActionStateBoolean *data)
{ {
/* only get here if the action is active! */ /* only get here if the action is active! */
...@@ -1349,7 +1351,8 @@ get_xr_state_from_action_state_bool(struct oxr_action_state *state, ...@@ -1349,7 +1351,8 @@ get_xr_state_from_action_state_bool(struct oxr_action_state *state,
} }
static void static void
get_xr_state_from_action_state_vec1(struct oxr_action_state *state, get_xr_state_from_action_state_vec1(struct oxr_instance *inst,
struct oxr_action_state *state,
XrActionStateFloat *data) XrActionStateFloat *data)
{ {
/* only get here if the action is active! */ /* only get here if the action is active! */
...@@ -1359,7 +1362,8 @@ get_xr_state_from_action_state_vec1(struct oxr_action_state *state, ...@@ -1359,7 +1362,8 @@ get_xr_state_from_action_state_vec1(struct oxr_action_state *state,
} }
static void static void
get_xr_state_from_action_state_vec2(struct oxr_action_state *state, get_xr_state_from_action_state_vec2(struct oxr_instance *inst,
struct oxr_action_state *state,
XrActionStateVector2f *data) XrActionStateVector2f *data)
{ {
/* only get here if the action is active! */ /* only get here if the action is active! */
...@@ -1372,27 +1376,27 @@ get_xr_state_from_action_state_vec2(struct oxr_action_state *state, ...@@ -1372,27 +1376,27 @@ get_xr_state_from_action_state_vec2(struct oxr_action_state *state,
#define OXR_ACTION_GET_FILLER(TYPE) \ #define OXR_ACTION_GET_FILLER(TYPE) \
if (sub_paths.any && act_attached->any_state.active) { \ if (sub_paths.any && act_attached->any_state.active) { \
get_xr_state_from_action_state_##TYPE( \ get_xr_state_from_action_state_##TYPE( \
&act_attached->any_state, data); \ sess->sys->inst, &act_attached->any_state, data); \
} \ } \
if (sub_paths.user && act_attached->user.current.active) { \ if (sub_paths.user && act_attached->user.current.active) { \
get_xr_state_from_action_state_##TYPE( \ get_xr_state_from_action_state_##TYPE( \
&act_attached->user.current, data); \ sess->sys->inst, &act_attached->user.current, data); \
} \ } \
if (sub_paths.head && act_attached->head.current.active) { \ if (sub_paths.head && act_attached->head.current.active) { \
get_xr_state_from_action_state_##TYPE( \ get_xr_state_from_action_state_##TYPE( \
&act_attached->head.current, data); \ sess->sys->inst, &act_attached->head.current, data); \
} \ } \
if (sub_paths.left && act_attached->left.current.active) { \ if (sub_paths.left && act_attached->left.current.active) { \
get_xr_state_from_action_state_##TYPE( \ get_xr_state_from_action_state_##TYPE( \
&act_attached->left.current, data); \ sess->sys->inst, &act_attached->left.current, data); \
} \ } \
if (sub_paths.right && act_attached->right.current.active) { \ if (sub_paths.right && act_attached->right.current.active) { \
get_xr_state_from_action_state_##TYPE( \ get_xr_state_from_action_state_##TYPE( \
&act_attached->right.current, data); \ sess->sys->inst, &act_attached->right.current, data); \
} \ } \
if (sub_paths.gamepad && act_attached->gamepad.current.active) { \ if (sub_paths.gamepad && act_attached->gamepad.current.active) { \
get_xr_state_from_action_state_##TYPE( \ get_xr_state_from_action_state_##TYPE( \
&act_attached->gamepad.current, data); \ sess->sys->inst, &act_attached->gamepad.current, data); \
} }
/*! /*!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment