u/space_overseer: skip actually locating spaces in themselves

It is always going to be identity. Keep calculating the offsets though.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
This commit is contained in:
Christoph Haag authored and Marge Bot committed 2024-05-28 22:09:13 +00:00
1 parent 5ba58a5711
commit eaf747eca2
1 file changed
+7 -1
+7 -1
View File
@@ -593,7 +593,13 @@ locate_spaces(struct xrt_space_overseer *xso,
struct xrt_relation_chain xrc = {0};
m_relation_chain_push_pose_if_not_identity(&xrc, &offsets[i]);
build_relation_chain(uso, &xrc, ubase_space, uspace, at_timestamp_ns);
// crude optimization: If locating a space in itself, we don't actually need to locate the space itself.
// only the offsets need to be applied.
if (spaces[i] != base_space) {
build_relation_chain(uso, &xrc, ubase_space, uspace, at_timestamp_ns);
}
m_relation_chain_push_inverted_pose_if_not_identity(&xrc, base_offset);
// For base_space =~= space (approx equals).