···1515extern "C" {
1616#endif
17171818-1818+#define XRT_MAX_CLIENT_SPACES 128
1919struct xrt_device;
20202121/*!
···106106 * Semantic spaces to be mapped to OpenXR spaces.
107107 */
108108 } semantic;
109109+110110+ //! Ptrs to the localspace
111111+ struct xrt_space *localspace[XRT_MAX_CLIENT_SPACES];
112112+ struct xrt_device *head;
109113110114 /*!
111115 * Create a space with a fixed offset to the parent space.
···235239 * @param[in] xso The space overseer.
236240 */
237241 xrt_result_t (*recenter_local_spaces)(struct xrt_space_overseer *xso);
242242+243243+ /*!
244244+ * Create a localspace.
245245+ *
246246+ * @param[in] xso Owning space overseer.
247247+ * @param[out] out_space The newly created localspace.
248248+ */
249249+ xrt_result_t (*create_local_space)(struct xrt_space_overseer *xso, struct xrt_space **out_space);
238250239251 /*!
240252 * Destroy function.
···371383xrt_space_overseer_recenter_local_spaces(struct xrt_space_overseer *xso)
372384{
373385 return xso->recenter_local_spaces(xso);
386386+}
387387+388388+/*!
389389+ * @copydoc xrt_space_overseer::create_localspace_space
390390+ *
391391+ * Helper for calling through the function pointer.
392392+ *
393393+ * @public @memberof xrt_space_overseer
394394+ */
395395+static inline xrt_result_t
396396+xrt_space_overseer_create_local_space(struct xrt_space_overseer *xso, struct xrt_space **out_space)
397397+{
398398+ return xso->create_local_space(xso, out_space);
374399}
375400376401/*!
+4
src/xrt/ipc/server/ipc_server.h
···116116117117 //! Number of spaces.
118118 uint32_t space_count;
119119+ //! Index of localspace in ipc client.
120120+ uint32_t local_space_index;
121121+ //! Index of localspace in space overseer.
122122+ uint32_t local_space_overseer_index;
119123120124 //! Ptrs to the spaces.
121125 struct xrt_space *xspcs[IPC_MAX_CLIENT_SPACES];
···6767 xrt_space_reference((struct xrt_space **)&ics->xspcs[i], NULL);
6868 }
69697070+ if (ics->local_space_overseer_index < IPC_MAX_CLIENT_SPACES && ics->local_space_overseer_index >= 0) {
7171+ struct xrt_space *xslocal = ics->server->xso->localspace[ics->local_space_overseer_index];
7272+ xrt_space_reference(&xslocal, NULL);
7373+ }
7474+7075 // Mark an still in use reference spaces as no longer used.
7176 for (uint32_t i = 0; i < ARRAY_SIZE(ics->ref_space_used); i++) {
7277 bool used = ics->ref_space_used[i];