The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: Remove unused inv_offset in end frame

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2626>

authored by

Jakob Bornecrantz and committed by
Marge Bot
d341b76f 4fc2c3b3

+17 -26
+17 -26
src/xrt/state_trackers/oxr/oxr_session_frame_end.c
··· 38 38 #include <assert.h> 39 39 40 40 41 + 41 42 /* 42 43 * 43 44 * Helper functions and defines. ··· 333 334 data->passthrough.xrt_pt.paused = passthrough_handle->paused; 334 335 #endif 335 336 } 337 + 336 338 337 339 /* 338 340 * ··· 1165 1167 #endif 1166 1168 } 1167 1169 1170 + 1168 1171 /* 1169 1172 * 1170 1173 * Submit functions. 1171 1174 * 1172 1175 */ 1173 1176 1174 - /** 1177 + /*! 1175 1178 * Turn the poses supplied with a composition layer into the poses the compositor wants. 1176 1179 * 1177 1180 * @param log logger 1178 1181 * @param sess session 1179 1182 * @param spc space that @p pose_ptr is supplied in 1180 1183 * @param pose_ptr pose supplied with layer 1181 - * @param inv_offset inverse of the tracking origin offset 1182 1184 * @param timestamp timestamp for pose 1183 1185 * @param[out] out_pose Resulting view-space pose 1184 1186 * @return true if successfully transformed into a view space pose ··· 1188 1190 struct oxr_session *sess, 1189 1191 struct oxr_space *spc, 1190 1192 const struct xrt_pose *pose_ptr, 1191 - const struct xrt_pose *inv_offset, 1192 1193 uint64_t timestamp, 1193 1194 struct xrt_pose *out_pose) 1194 1195 { ··· 1242 1243 struct oxr_logger *log, 1243 1244 XrCompositionLayerQuad *quad, 1244 1245 struct xrt_device *head, 1245 - struct xrt_pose *inv_offset, 1246 1246 uint64_t oxr_timestamp, 1247 1247 uint64_t xrt_timestamp) 1248 1248 { ··· 1254 1254 struct xrt_pose *pose_ptr = (struct xrt_pose *)&quad->pose; 1255 1255 1256 1256 struct xrt_pose pose; 1257 - if (!handle_space(log, sess, spc, pose_ptr, inv_offset, oxr_timestamp, &pose)) { 1257 + if (!handle_space(log, sess, spc, pose_ptr, oxr_timestamp, &pose)) { 1258 1258 return XR_SUCCESS; 1259 1259 } 1260 1260 ··· 1293 1293 struct oxr_logger *log, 1294 1294 XrCompositionLayerProjection *proj, 1295 1295 struct xrt_device *head, 1296 - struct xrt_pose *inv_offset, 1297 1296 uint64_t oxr_timestamp, 1298 1297 uint64_t xrt_timestamp) 1299 1298 { ··· 1317 1316 scs[i] = XRT_CAST_OXR_HANDLE_TO_PTR(struct oxr_swapchain *, proj->views[i].subImage.swapchain); 1318 1317 pose_ptr = (struct xrt_pose *)&proj->views[i].pose; 1319 1318 1320 - if (!handle_space(log, sess, spc, pose_ptr, inv_offset, oxr_timestamp, &pose[i])) { 1319 + if (!handle_space(log, sess, spc, pose_ptr, oxr_timestamp, &pose[i])) { 1321 1320 return XR_SUCCESS; 1322 1321 } 1323 1322 } ··· 1399 1398 struct oxr_logger *log, 1400 1399 const XrCompositionLayerCubeKHR *cube, 1401 1400 struct xrt_device *head, 1402 - struct xrt_pose *inv_offset, 1403 1401 uint64_t oxr_timestamp, 1404 1402 uint64_t xrt_timestamp) 1405 1403 { ··· 1438 1436 .position = XRT_VEC3_ZERO, 1439 1437 }; 1440 1438 1441 - if (!handle_space(log, sess, spc, &pose, inv_offset, oxr_timestamp, &data.cube.pose)) { 1439 + if (!handle_space(log, sess, spc, &pose, oxr_timestamp, &data.cube.pose)) { 1442 1440 return XR_SUCCESS; 1443 1441 } 1444 1442 ··· 1454 1452 struct oxr_logger *log, 1455 1453 const XrCompositionLayerCylinderKHR *cylinder, 1456 1454 struct xrt_device *head, 1457 - struct xrt_pose *inv_offset, 1458 1455 uint64_t oxr_timestamp, 1459 1456 uint64_t xrt_timestamp) 1460 1457 { ··· 1467 1464 struct xrt_pose *pose_ptr = (struct xrt_pose *)&cylinder->pose; 1468 1465 1469 1466 struct xrt_pose pose; 1470 - if (!handle_space(log, sess, spc, pose_ptr, inv_offset, oxr_timestamp, &pose)) { 1467 + if (!handle_space(log, sess, spc, pose_ptr, oxr_timestamp, &pose)) { 1471 1468 return XR_SUCCESS; 1472 1469 } 1473 1470 ··· 1506 1503 struct oxr_logger *log, 1507 1504 const XrCompositionLayerEquirectKHR *equirect, 1508 1505 struct xrt_device *head, 1509 - struct xrt_pose *inv_offset, 1510 1506 uint64_t oxr_timestamp, 1511 1507 uint64_t xrt_timestamp) 1512 1508 { ··· 1518 1514 struct xrt_pose *pose_ptr = (struct xrt_pose *)&equirect->pose; 1519 1515 1520 1516 struct xrt_pose pose; 1521 - if (!handle_space(log, sess, spc, pose_ptr, inv_offset, oxr_timestamp, &pose)) { 1517 + if (!handle_space(log, sess, spc, pose_ptr, oxr_timestamp, &pose)) { 1522 1518 return XR_SUCCESS; 1523 1519 } 1524 1520 ··· 1569 1565 struct oxr_logger *log, 1570 1566 const XrCompositionLayerEquirect2KHR *equirect, 1571 1567 struct xrt_device *head, 1572 - struct xrt_pose *inv_offset, 1573 1568 uint64_t oxr_timestamp, 1574 1569 uint64_t xrt_timestamp) 1575 1570 { ··· 1581 1576 struct xrt_pose *pose_ptr = (struct xrt_pose *)&equirect->pose; 1582 1577 1583 1578 struct xrt_pose pose; 1584 - if (!handle_space(log, sess, spc, pose_ptr, inv_offset, oxr_timestamp, &pose)) { 1579 + if (!handle_space(log, sess, spc, pose_ptr, oxr_timestamp, &pose)) { 1585 1580 return XR_SUCCESS; 1586 1581 } 1587 1582 ··· 1620 1615 struct oxr_logger *log, 1621 1616 const XrCompositionLayerPassthroughFB *passthrough, 1622 1617 struct xrt_device *head, 1623 - struct xrt_pose *inv_offset, 1624 1618 uint64_t oxr_timestamp, 1625 1619 uint64_t xrt_timestamp) 1626 1620 { ··· 1793 1787 // Do state change if needed. 1794 1788 do_synchronize_state_change(log, sess); 1795 1789 1796 - struct xrt_pose inv_offset = {0}; 1797 - math_pose_invert(&xdev->tracking_origin->initial_offset, &inv_offset); 1798 - 1799 1790 struct xrt_layer_frame_data data = { 1800 1791 .frame_id = sess->frame_id.begun, 1801 1792 .display_time_ns = xrt_display_time_ns, ··· 1812 1803 1813 1804 switch (layer->type) { 1814 1805 case XR_TYPE_COMPOSITION_LAYER_PROJECTION: 1815 - submit_projection_layer(sess, xc, log, (XrCompositionLayerProjection *)layer, xdev, &inv_offset, 1806 + submit_projection_layer(sess, xc, log, (XrCompositionLayerProjection *)layer, xdev, 1816 1807 frameEndInfo->displayTime, xrt_display_time_ns); 1817 1808 break; 1818 1809 case XR_TYPE_COMPOSITION_LAYER_QUAD: 1819 - submit_quad_layer(sess, xc, log, (XrCompositionLayerQuad *)layer, xdev, &inv_offset, 1810 + submit_quad_layer(sess, xc, log, (XrCompositionLayerQuad *)layer, xdev, 1820 1811 frameEndInfo->displayTime, xrt_display_time_ns); 1821 1812 break; 1822 1813 case XR_TYPE_COMPOSITION_LAYER_CUBE_KHR: 1823 - submit_cube_layer(sess, xc, log, (XrCompositionLayerCubeKHR *)layer, xdev, &inv_offset, 1814 + submit_cube_layer(sess, xc, log, (XrCompositionLayerCubeKHR *)layer, xdev, 1824 1815 frameEndInfo->displayTime, xrt_display_time_ns); 1825 1816 break; 1826 1817 case XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR: 1827 - submit_cylinder_layer(sess, xc, log, (XrCompositionLayerCylinderKHR *)layer, xdev, &inv_offset, 1818 + submit_cylinder_layer(sess, xc, log, (XrCompositionLayerCylinderKHR *)layer, xdev, 1828 1819 frameEndInfo->displayTime, xrt_display_time_ns); 1829 1820 break; 1830 1821 case XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR: 1831 - submit_equirect1_layer(sess, xc, log, (XrCompositionLayerEquirectKHR *)layer, xdev, &inv_offset, 1822 + submit_equirect1_layer(sess, xc, log, (XrCompositionLayerEquirectKHR *)layer, xdev, 1832 1823 frameEndInfo->displayTime, xrt_display_time_ns); 1833 1824 break; 1834 1825 case XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR: 1835 1826 submit_equirect2_layer(sess, xc, log, (XrCompositionLayerEquirect2KHR *)layer, xdev, 1836 - &inv_offset, frameEndInfo->displayTime, xrt_display_time_ns); 1827 + frameEndInfo->displayTime, xrt_display_time_ns); 1837 1828 break; 1838 1829 case XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB: 1839 1830 submit_passthrough_layer(sess, xc, log, (XrCompositionLayerPassthroughFB *)layer, xdev, 1840 - &inv_offset, frameEndInfo->displayTime, xrt_display_time_ns); 1831 + frameEndInfo->displayTime, xrt_display_time_ns); 1841 1832 break; 1842 1833 default: assert(false && "invalid layer type"); 1843 1834 }