The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipc: Implement xrt_device::compute_distortion

+56
+24
src/xrt/ipc/client/ipc_client_hmd.c
··· 136 136 } 137 137 138 138 static bool 139 + ipc_client_hmd_compute_distortion( 140 + struct xrt_device *xdev, uint32_t view, float u, float v, struct xrt_uv_triplet *out_result) 141 + { 142 + ipc_client_hmd_t *ich = ipc_client_hmd(xdev); 143 + 144 + bool ret; 145 + xrt_result_t xret = ipc_call_device_compute_distortion( // 146 + ich->ipc_c, // 147 + ich->device_id, // 148 + view, // 149 + u, // 150 + v, // 151 + &ret, // 152 + out_result); // 153 + if (xret != XRT_SUCCESS) { 154 + IPC_ERROR(ich->ipc_c, "Error calling compute distortion!"); 155 + return false; 156 + } 157 + 158 + return ret; 159 + } 160 + 161 + static bool 139 162 ipc_client_hmd_is_form_factor_available(struct xrt_device *xdev, enum xrt_form_factor form_factor) 140 163 { 141 164 ipc_client_hmd_t *ich = ipc_client_hmd(xdev); ··· 165 188 ich->base.update_inputs = ipc_client_hmd_update_inputs; 166 189 ich->base.get_tracked_pose = ipc_client_hmd_get_tracked_pose; 167 190 ich->base.get_view_poses = ipc_client_hmd_get_view_poses; 191 + ich->base.compute_distortion = ipc_client_hmd_compute_distortion; 168 192 ich->base.destroy = ipc_client_hmd_destroy; 169 193 ich->base.is_form_factor_available = ipc_client_hmd_is_form_factor_available; 170 194
+19
src/xrt/ipc/server/ipc_server_handler.c
··· 1141 1141 } 1142 1142 1143 1143 xrt_result_t 1144 + ipc_handle_device_compute_distortion(volatile struct ipc_client_state *ics, 1145 + uint32_t id, 1146 + uint32_t view, 1147 + float u, 1148 + float v, 1149 + bool *out_ret, 1150 + struct xrt_uv_triplet *out_triplet) 1151 + { 1152 + // To make the code a bit more readable. 1153 + uint32_t device_id = id; 1154 + struct xrt_device *xdev = get_xdev(ics, device_id); 1155 + 1156 + bool ret = xrt_device_compute_distortion(xdev, view, u, v, out_triplet); 1157 + *out_ret = ret; 1158 + 1159 + return XRT_SUCCESS; 1160 + } 1161 + 1162 + xrt_result_t 1144 1163 ipc_handle_device_set_output(volatile struct ipc_client_state *ics, 1145 1164 uint32_t id, 1146 1165 enum xrt_output_name name,
+13
src/xrt/ipc/shared/proto.json
··· 246 246 ] 247 247 }, 248 248 249 + "device_compute_distortion": { 250 + "in": [ 251 + {"name": "id", "type": "uint32_t"}, 252 + {"name": "view", "type": "uint32_t"}, 253 + {"name": "u", "type": "float"}, 254 + {"name": "v", "type": "float"} 255 + ], 256 + "out": [ 257 + {"name": "ret", "type": "bool"}, 258 + {"name": "triplet", "type": "struct xrt_uv_triplet"} 259 + ] 260 + }, 261 + 249 262 "device_set_output": { 250 263 "in": [ 251 264 {"name": "id", "type": "uint32_t"},