The open source OpenXR runtime
0
fork

Configure Feed

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

a/util: introduce u_device_get_visibility_mask

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

authored by

Simon Zeni and committed by
Marge Bot
e236a472 74b27cad

+26 -3
+14 -2
src/xrt/auxiliary/util/u_device.c
··· 1 - // Copyright 2019-2024, Collabora, Ltd. 1 + // Copyright 2019-2025, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file ··· 6 6 * @author Jakob Bornecrantz <jakob@collabora.com> 7 7 * @author Rylie Pavlik <rylie.pavlik@collabora.com> 8 8 * @author Moses Turner <moses@collabora.com> 9 + * @author Simon Zeni <simon.zeni@collabora.com> 9 10 * @ingroup aux_util 10 11 */ 11 12 12 - #include "util/u_logging.h" 13 13 #include "util/u_device.h" 14 + #include "util/u_logging.h" 14 15 #include "util/u_misc.h" 16 + #include "util/u_visibility_mask.h" 15 17 16 18 #include "math/m_mathinclude.h" 17 19 #include "math/m_api.h" ··· 469 471 } 470 472 } 471 473 474 + xrt_result_t 475 + u_device_get_visibility_mask(struct xrt_device *xdev, 476 + enum xrt_visibility_mask_type type, 477 + uint32_t view_index, 478 + struct xrt_visibility_mask **out_mask) 479 + { 480 + const struct xrt_fov fov = xdev->hmd->distortion.fov[view_index]; 481 + u_visibility_mask_get_default(type, &fov, out_mask); 482 + return XRT_SUCCESS; 483 + } 472 484 473 485 /* 474 486 *
+12 -1
src/xrt/auxiliary/util/u_device.h
··· 1 - // Copyright 2019-2023, Collabora, Ltd. 1 + // Copyright 2019-2025, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file ··· 6 6 * @author Jakob Bornecrantz <jakob@collabora.com> 7 7 * @author Rylie Pavlik <rylie.pavlik@collabora.com> 8 8 * @author Moses Turner <moses@collabora.com> 9 + * @author Simon Zeni <simon.zeni@collabora.com> 9 10 * @ingroup aux_util 10 11 */ 11 12 ··· 174 175 struct xrt_fov *out_fovs, 175 176 struct xrt_pose *out_poses); 176 177 178 + /*! 179 + * Helper function to implement @ref xrt_device::get_visibility_mask in a HMD driver. 180 + * 181 + * The field @ref xrt_device::hmd needs to be set and valid. 182 + */ 183 + xrt_result_t 184 + u_device_get_visibility_mask(struct xrt_device *xdev, 185 + enum xrt_visibility_mask_type type, 186 + uint32_t view_index, 187 + struct xrt_visibility_mask **out_mask); 177 188 178 189 /* 179 190 *