| 1 | // Copyright 2018-2024, Collabora, Ltd.cxx . . $ `<file>/src/xrt/state_trackers/oxr/oxr_system.c`/ |
| 2 | // SPDX-License-Identifier: BSL-1.0 |
| 3 | /*! |
| 4 | * @file |
| 5 | * @brief Holds system related entrypoints. |
| 6 | * @author Jakob Bornecrantz <[email protected]> |
| 7 | * @author Korcan Hussein <[email protected]> |
| 8 | * @ingroup oxr_main |
| 9 | */ |
| 10 | |
| 11 | #include <stdio.h> |
| 12 | #include <stdlib.h> |
| 13 | #include <string.h> |
| 14 | #include <assert.h> |
| 15 | |
| 16 | #include "xrt/xrt_device.h"cxx . . $ `<file>/src/xrt/include/xrt/xrt_device.h`/ |
| 17 | #include "util/u_debug.h"cxx . . $ `<file>/src/xrt/auxiliary/util/u_debug.h`/ |
| 18 | #include "util/u_verify.h"cxx . . $ `<file>/src/xrt/auxiliary/util/u_verify.h`/ |
| 19 | |
| 20 | #include "oxr_objects.h"cxx . . $ `<file>/src/xrt/state_trackers/oxr/oxr_objects.h`/ |
| 21 | #include "oxr_logger.h"cxx . . $ `<file>/src/xrt/state_trackers/oxr/oxr_logger.h`/ |
| 22 | #include "oxr_two_call.h"cxx . . $ `<file>/src/xrt/state_trackers/oxr/oxr_two_call.h`/ |
| 23 | #include "oxr_chain.h"cxx . . $ `<file>/src/xrt/state_trackers/oxr/oxr_chain.h`/ |
| 24 | #include "oxr_api_verify.h"cxx . . $ `<file>/src/xrt/state_trackers/oxr/oxr_api_verify.h`/ |
| 25 | |
| 26 | |
| 27 | DEBUG_GET_ONCE_NUM_OPTIONcxx . . $ `src/xrt/auxiliary/util/u_debug.h:132:9`!(scale_percentage, "OXR_VIEWPORT_SCALE_PERCENTAGE", 100) |
| 28 | |
| 29 | static enum xrt_form_factorcxx . . $ xrt_form_factor# |
| 30 | convert_form_factorcxx . . $ convert_form_factor(8fc694247c832b54).(XrFormFactorcxx . . $ XrFormFactor# form_factor) |
| 31 | { |
| 32 | switch (form_factor) { |
| 33 | case XR_FORM_FACTOR_HANDHELD_DISPLAYcxx . . $ XR_FORM_FACTOR_HANDHELD_DISPLAY.: return XRT_FORM_FACTOR_HANDHELDcxx . . $ XRT_FORM_FACTOR_HANDHELD.; |
| 34 | case XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAYcxx . . $ XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY.: return XRT_FORM_FACTOR_HMDcxx . . $ XRT_FORM_FACTOR_HMD.; |
| 35 | default: return XRT_FORM_FACTOR_HMDcxx . . $ XRT_FORM_FACTOR_HMD.; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 40 | oxr_system_matchescxx . . $ oxr_system_matches(67e7fcac2757a73c).(struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_systemcxx . . $ oxr_system# *sys, XrFormFactorcxx . . $ XrFormFactor# form_factor) |
| 41 | { |
| 42 | return form_factor == sys->form_factorcxx . . $ oxr_system#form_factor.; |
| 43 | } |
| 44 | |
| 45 | XrResultcxx . . $ XrResult# |
| 46 | oxr_system_selectcxx . . $ oxr_system_select(4827e7bc62e61b92).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 47 | struct oxr_systemcxx . . $ oxr_system# **systems, |
| 48 | uint32_tcxx . . $ uint32_t# system_count, |
| 49 | XrFormFactorcxx . . $ XrFormFactor# form_factor, |
| 50 | struct oxr_systemcxx . . $ oxr_system# **out_selected) |
| 51 | { |
| 52 | if (system_count == 0) { |
| 53 | return oxr_errorcxx . . $ oxr_error(1140daf53870d718).(log, XR_ERROR_FORM_FACTOR_UNSUPPORTEDcxx . . $ XR_ERROR_FORM_FACTOR_UNSUPPORTED., |
| 54 | "(getInfo->formFactor) no system available (given: %i)", form_factor); |
| 55 | } |
| 56 | |
| 57 | struct oxr_systemcxx . . $ oxr_system# *selected = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 58 | for (uint32_tcxx . . $ uint32_t# i = 0; i < system_count; i++) { |
| 59 | if (oxr_system_matchescxx . . $ oxr_system_matches(67e7fcac2757a73c).(log, systems[i], form_factor)) { |
| 60 | selected = systems[i]; |
| 61 | break; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | if (selected == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 66 | return oxr_errorcxx . . $ oxr_error(1140daf53870d718).(log, XR_ERROR_FORM_FACTOR_UNSUPPORTEDcxx . . $ XR_ERROR_FORM_FACTOR_UNSUPPORTED., |
| 67 | "(getInfo->formFactor) no matching system " |
| 68 | "(given: %i, first: %i)", |
| 69 | form_factor, systems[0]->form_factorcxx . . $ oxr_system#form_factor.); |
| 70 | } |
| 71 | |
| 72 | struct xrt_devicecxx . . $ xrt_device# *xdev = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(selected, head); |
| 73 | if (xdev->form_factor_check_supportedcxx . . $ xrt_device#form_factor_check_supported. && |
| 74 | !xrt_device_is_form_factor_availablecxx . . $ xrt_device_is_form_factor_available(b3bf06c7697eff16).(xdev, convert_form_factorcxx . . $ convert_form_factor(8fc694247c832b54).(form_factor))) { |
| 75 | return oxr_errorcxx . . $ oxr_error(1140daf53870d718).(log, XR_ERROR_FORM_FACTOR_UNAVAILABLEcxx . . $ XR_ERROR_FORM_FACTOR_UNAVAILABLE., "request form factor %i is unavailable now", |
| 76 | form_factor); |
| 77 | } |
| 78 | |
| 79 | *out_selected = selected; |
| 80 | |
| 81 | return XR_SUCCESScxx . . $ XR_SUCCESS.; |
| 82 | } |
| 83 | |
| 84 | XrResultcxx . . $ XrResult# |
| 85 | oxr_system_verify_idcxx . . $ oxr_system_verify_id(c4660e4a84290254).(struct oxr_loggercxx . . $ oxr_logger# *log, const struct oxr_instancecxx . . $ oxr_instance# *inst, XrSystemIdcxx . . $ XrSystemId# systemId) |
| 86 | { |
| 87 | if (systemId != XRT_SYSTEM_IDcxx . . $ `src/xrt/include/xrt/xrt_system.h:37:9`!) { |
| 88 | return oxr_errorcxx . . $ oxr_error(1140daf53870d718).(log, XR_ERROR_SYSTEM_INVALIDcxx . . $ XR_ERROR_SYSTEM_INVALID., "Invalid system %" PRIu64cxx . . $ `<external>/15933738808807975373/inttypes.h:105:10`!, systemId); |
| 89 | } |
| 90 | return XR_SUCCESScxx . . $ XR_SUCCESS.; |
| 91 | } |
| 92 | |
| 93 | XrResultcxx . . $ XrResult# |
| 94 | oxr_system_get_by_idcxx . . $ oxr_system_get_by_id(79622fdc4379176b).(struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_instancecxx . . $ oxr_instance# *inst, XrSystemIdcxx . . $ XrSystemId# systemId, struct oxr_systemcxx . . $ oxr_system# **system) |
| 95 | { |
| 96 | XrResultcxx . . $ XrResult# result = oxr_system_verify_idcxx . . $ oxr_system_verify_id(c4660e4a84290254).(log, inst, systemId); |
| 97 | if (result != XR_SUCCESScxx . . $ XR_SUCCESS.) { |
| 98 | return result; |
| 99 | } |
| 100 | |
| 101 | /* right now only have one system. */ |
| 102 | *system = &inst->systemcxx . . $ oxr_instance#system.; |
| 103 | |
| 104 | return XR_SUCCESScxx . . $ XR_SUCCESS.; |
| 105 | } |
| 106 | |
| 107 | |
| 108 | |
| 109 | XrResultcxx . . $ XrResult# |
| 110 | oxr_system_fill_incxx . . $ oxr_system_fill_in(3bce98f7ece3a1fb).( |
| 111 | struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_instancecxx . . $ oxr_instance# *inst, XrSystemIdcxx . . $ XrSystemId# systemId, uint32_tcxx . . $ uint32_t# view_count, struct oxr_systemcxx . . $ oxr_system# *sys) |
| 112 | { |
| 113 | //! @todo handle other subaction paths? |
| 114 | |
| 115 | sys->instcxx . . $ oxr_system#inst. = inst; |
| 116 | sys->systemIdcxx . . $ oxr_system#systemId. = systemId; |
| 117 | sys->form_factorcxx . . $ oxr_system#form_factor. = XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAYcxx . . $ XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY.; |
| 118 | if (view_count == 1) { |
| 119 | sys->view_config_typecxx . . $ oxr_system#view_config_type. = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONOcxx . . $ XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO.; |
| 120 | } else if (view_count == 2) { |
| 121 | sys->view_config_typecxx . . $ oxr_system#view_config_type. = XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREOcxx . . $ XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO.; |
| 122 | } else { |
| 123 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`! && "view_count must be 1 or 2"); |
| 124 | } |
| 125 | U_LOG_Dcxx . . $ `src/xrt/auxiliary/util/u_logging.h:295:9`!("sys->view_config_type = %d", sys->view_config_type); |
| 126 | sys->dynamic_roles_cachecxx . . $ oxr_system#dynamic_roles_cache. = (struct xrt_system_rolescxx . . $ xrt_system_roles#)XRT_SYSTEM_ROLES_INITcxx . . $ `src/xrt/include/xrt/xrt_system.h:209:9`!; |
| 127 | |
| 128 | #ifdef XR_USE_GRAPHICS_API_VULKANcxx . . $ `build/src/xrt/include/xrt/xrt_openxr_config.h:12:9`! |
| 129 | sys->vulkan_enable2_instancecxx . . $ oxr_system#vulkan_enable2_instance. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!; |
| 130 | sys->suggested_vulkan_physical_devicecxx . . $ oxr_system#suggested_vulkan_physical_device. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!; |
| 131 | #endif |
| 132 | #if defined(XR_USE_GRAPHICS_API_D3D11) || defined(XR_USE_GRAPHICS_API_D3D12) |
| 133 | U_ZERO(&(sys->suggested_d3d_luid)); |
| 134 | sys->suggested_d3d_luid_valid = false; |
| 135 | #endif |
| 136 | |
| 137 | // Headless. |
| 138 | if (sys->xsysccxx . . $ oxr_system#xsysc. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 139 | sys->blend_modescxx . . $ oxr_system#blend_modes.[0] = XR_ENVIRONMENT_BLEND_MODE_OPAQUEcxx . . $ XR_ENVIRONMENT_BLEND_MODE_OPAQUE.; |
| 140 | sys->blend_mode_countcxx . . $ oxr_system#blend_mode_count. = 1; |
| 141 | return XR_SUCCESScxx . . $ XR_SUCCESS.; |
| 142 | } |
| 143 | |
| 144 | double scale = debug_get_num_option_scale_percentagecxx . . $ debug_get_num_option_scale_percentage(da6335ded91d79c2).() / 100.0; |
| 145 | if (scale > 2.0) { |
| 146 | scale = 2.0; |
| 147 | oxr_logcxx . . $ oxr_log(53d77e502024c659).(log, "Clamped scale to 200%%\n"); |
| 148 | } |
| 149 | |
| 150 | struct xrt_system_compositor_infocxx . . $ xrt_system_compositor_info# *info = &sys->xsysccxx . . $ oxr_system#xsysc.->infocxx . . $ xrt_system_compositor#info.; |
| 151 | |
| 152 | #define imincxx . . $ `src/xrt/state_trackers/oxr/oxr_system.c:152:9`!(a, b) (a < b ? a : b) |
| 153 | for (uint32_tcxx . . $ uint32_t# i = 0; i < view_count; ++i) { |
| 154 | uint32_tcxx . . $ uint32_t# w = (uint32_tcxx . . $ uint32_t#)(info->viewscxx . . $ xrt_system_compositor_info#views.[i].recommendedcxx . . $ xrt_system_compositor_info#$anonymous_type_1#recommended..width_pixelscxx . . $ xrt_system_compositor_info#$anonymous_type_1#$anonymous_type_2#width_pixels. * scale); |
| 155 | uint32_tcxx . . $ uint32_t# h = (uint32_tcxx . . $ uint32_t#)(info->viewscxx . . $ xrt_system_compositor_info#views.[i].recommendedcxx . . $ xrt_system_compositor_info#$anonymous_type_1#recommended..height_pixelscxx . . $ xrt_system_compositor_info#$anonymous_type_1#$anonymous_type_2#height_pixels. * scale); |
| 156 | uint32_tcxx . . $ uint32_t# w_2 = info->viewscxx . . $ xrt_system_compositor_info#views.[i].maxcxx . . $ xrt_system_compositor_info#$anonymous_type_1#max..width_pixelscxx . . $ xrt_system_compositor_info#$anonymous_type_1#$anonymous_type_3#width_pixels.; |
| 157 | uint32_tcxx . . $ uint32_t# h_2 = info->viewscxx . . $ xrt_system_compositor_info#views.[i].maxcxx . . $ xrt_system_compositor_info#$anonymous_type_1#max..height_pixelscxx . . $ xrt_system_compositor_info#$anonymous_type_1#$anonymous_type_3#height_pixels.; |
| 158 | |
| 159 | w = imincxx . . $ `src/xrt/state_trackers/oxr/oxr_system.c:152:9`!(w, w_2); |
| 160 | h = imincxx . . $ `src/xrt/state_trackers/oxr/oxr_system.c:152:9`!(h, h_2); |
| 161 | |
| 162 | sys->viewscxx . . $ oxr_system#views.[i].recommendedImageRectWidthcxx . . $ XrViewConfigurationView#recommendedImageRectWidth. = w; |
| 163 | sys->viewscxx . . $ oxr_system#views.[i].maxImageRectWidthcxx . . $ XrViewConfigurationView#maxImageRectWidth. = w_2; |
| 164 | sys->viewscxx . . $ oxr_system#views.[i].recommendedImageRectHeightcxx . . $ XrViewConfigurationView#recommendedImageRectHeight. = h; |
| 165 | sys->viewscxx . . $ oxr_system#views.[i].maxImageRectHeightcxx . . $ XrViewConfigurationView#maxImageRectHeight. = h_2; |
| 166 | sys->viewscxx . . $ oxr_system#views.[i].recommendedSwapchainSampleCountcxx . . $ XrViewConfigurationView#recommendedSwapchainSampleCount. = info->viewscxx . . $ xrt_system_compositor_info#views.[i].recommendedcxx . . $ xrt_system_compositor_info#$anonymous_type_1#recommended..sample_countcxx . . $ xrt_system_compositor_info#$anonymous_type_1#$anonymous_type_2#sample_count.; |
| 167 | sys->viewscxx . . $ oxr_system#views.[i].maxSwapchainSampleCountcxx . . $ XrViewConfigurationView#maxSwapchainSampleCount. = info->viewscxx . . $ xrt_system_compositor_info#views.[i].maxcxx . . $ xrt_system_compositor_info#$anonymous_type_1#max..sample_countcxx . . $ xrt_system_compositor_info#$anonymous_type_1#$anonymous_type_3#sample_count.; |
| 168 | } |
| 169 | |
| 170 | #undef imincxx . . $ `src/xrt/state_trackers/oxr/oxr_system.c:152:9`! |
| 171 | |
| 172 | |
| 173 | /* |
| 174 | * Blend mode support. |
| 175 | */ |
| 176 | |
| 177 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(info->supported_blend_mode_count <= ARRAY_SIZEcxx . . $ `src/xrt/include/xrt/xrt_compiler.h:30:9`!(sys->blend_modes)); |
| 178 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(info->supported_blend_mode_count != 0); |
| 179 | |
| 180 | for (uint8_tcxx . . $ uint8_t# i = 0; i < info->supported_blend_mode_countcxx . . $ xrt_system_compositor_info#supported_blend_mode_count.; i++) { |
| 181 | assertcxx . . $ `<external>/4398592474888995393/assert.h:118:11`!(u_verify_blend_mode_valid(info->supported_blend_modes[i])); |
| 182 | sys->blend_modescxx . . $ oxr_system#blend_modes.[i] = (XrEnvironmentBlendModecxx . . $ XrEnvironmentBlendMode#)info->supported_blend_modescxx . . $ xrt_system_compositor_info#supported_blend_modes.[i]; |
| 183 | } |
| 184 | sys->blend_mode_countcxx . . $ oxr_system#blend_mode_count. = (uint32_tcxx . . $ uint32_t#)info->supported_blend_mode_countcxx . . $ xrt_system_compositor_info#supported_blend_mode_count.; |
| 185 | |
| 186 | |
| 187 | /* |
| 188 | * Reference space support. |
| 189 | */ |
| 190 | |
| 191 | static_assertcxx . . $ `<external>/4398592474888995393/assert.h:158:10`!(5 <= ARRAY_SIZEcxx . . $ `src/xrt/include/xrt/xrt_compiler.h:30:9`!(sys->reference_spaces), "Not enough space in array"); |
| 192 | |
| 193 | if (sys->xsocxx . . $ oxr_system#xso.->semanticcxx . . $ xrt_space_overseer#semantic..viewcxx . . $ xrt_space_overseer#$anonymous_type_0#view. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 194 | sys->reference_spacescxx . . $ oxr_system#reference_spaces.[sys->reference_space_countcxx . . $ oxr_system#reference_space_count.++] = XR_REFERENCE_SPACE_TYPE_VIEWcxx . . $ XR_REFERENCE_SPACE_TYPE_VIEW.; |
| 195 | } |
| 196 | |
| 197 | if (sys->xsocxx . . $ oxr_system#xso.->semanticcxx . . $ xrt_space_overseer#semantic..localcxx . . $ xrt_space_overseer#$anonymous_type_0#local. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 198 | sys->reference_spacescxx . . $ oxr_system#reference_spaces.[sys->reference_space_countcxx . . $ oxr_system#reference_space_count.++] = XR_REFERENCE_SPACE_TYPE_LOCALcxx . . $ XR_REFERENCE_SPACE_TYPE_LOCAL.; |
| 199 | } |
| 200 | |
| 201 | if (OXR_API_VERSION_AT_LEASTcxx . . $ `src/xrt/state_trackers/oxr/oxr_api_verify.h:134:9`!(sys->inst, 1, 1)) { |
| 202 | if (sys->xsocxx . . $ oxr_system#xso.->semanticcxx . . $ xrt_space_overseer#semantic..local_floorcxx . . $ xrt_space_overseer#$anonymous_type_0#local_floor. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 203 | sys->reference_spacescxx . . $ oxr_system#reference_spaces.[sys->reference_space_countcxx . . $ oxr_system#reference_space_count.++] = XR_REFERENCE_SPACE_TYPE_LOCAL_FLOORcxx . . $ XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR.; |
| 204 | } else { |
| 205 | oxr_warncxx . . $ oxr_warn(53d77e502024c659).(log, |
| 206 | "OpenXR 1.1 used but system doesn't support local_floor," |
| 207 | " breaking spec by not exposing the reference space."); |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | #ifdef OXR_HAVE_EXT_local_floorcxx . . $ `src/xrt/state_trackers/oxr/oxr_extension_support.h:379:9`! |
| 212 | // If OpenXR 1.1 and the extension is enabled, don't add a second reference. |
| 213 | // Note that XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR is aliased to XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR_EXT. |
| 214 | if (!OXR_API_VERSION_AT_LEASTcxx . . $ `src/xrt/state_trackers/oxr/oxr_api_verify.h:134:9`!(sys->inst, 1, 1)) { |
| 215 | if (sys->instcxx . . $ oxr_system#inst.->extensionscxx . . $ oxr_instance#extensions..EXT_local_floorcxx . . $ oxr_extension_status#EXT_local_floor.) { |
| 216 | if (sys->xsocxx . . $ oxr_system#xso.->semanticcxx . . $ xrt_space_overseer#semantic..local_floorcxx . . $ xrt_space_overseer#$anonymous_type_0#local_floor. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 217 | sys->reference_spacescxx . . $ oxr_system#reference_spaces.[sys->reference_space_countcxx . . $ oxr_system#reference_space_count.++] = |
| 218 | XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR_EXTcxx . . $ XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR_EXT.; |
| 219 | } else { |
| 220 | oxr_warncxx . . $ oxr_warn(53d77e502024c659).(log, |
| 221 | "XR_EXT_local_floor enabled but system doesn't support local_floor," |
| 222 | " breaking spec by not exposing the reference space."); |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | #endif |
| 227 | |
| 228 | if (sys->xsocxx . . $ oxr_system#xso.->semanticcxx . . $ xrt_space_overseer#semantic..stagecxx . . $ xrt_space_overseer#$anonymous_type_0#stage. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 229 | sys->reference_spacescxx . . $ oxr_system#reference_spaces.[sys->reference_space_countcxx . . $ oxr_system#reference_space_count.++] = XR_REFERENCE_SPACE_TYPE_STAGEcxx . . $ XR_REFERENCE_SPACE_TYPE_STAGE.; |
| 230 | } |
| 231 | |
| 232 | #ifdef OXR_HAVE_MSFT_unbounded_reference_spacecxx . . $ `src/xrt/state_trackers/oxr/oxr_extension_support.h:618:9`! |
| 233 | if (sys->instcxx . . $ oxr_system#inst.->extensionscxx . . $ oxr_instance#extensions..MSFT_unbounded_reference_spacecxx . . $ oxr_extension_status#MSFT_unbounded_reference_space. && sys->xsocxx . . $ oxr_system#xso.->semanticcxx . . $ xrt_space_overseer#semantic..unboundedcxx . . $ xrt_space_overseer#$anonymous_type_0#unbounded. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 234 | sys->reference_spacescxx . . $ oxr_system#reference_spaces.[sys->reference_space_countcxx . . $ oxr_system#reference_space_count.++] = XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFTcxx . . $ XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFT.; |
| 235 | } |
| 236 | #endif |
| 237 | |
| 238 | |
| 239 | /* |
| 240 | * Misc |
| 241 | */ |
| 242 | |
| 243 | #ifdef OXR_HAVE_MNDX_xdev_spacecxx . . $ `src/xrt/state_trackers/oxr/oxr_extension_support.h:744:9`! |
| 244 | // By default xdev_space is implemented in the state tracker and does not need explicit system support. |
| 245 | sys->supports_xdev_spacecxx . . $ oxr_system#supports_xdev_space. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 246 | #endif |
| 247 | |
| 248 | /* |
| 249 | * Done. |
| 250 | */ |
| 251 | |
| 252 | return XR_SUCCESScxx . . $ XR_SUCCESS.; |
| 253 | } |
| 254 | |
| 255 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 256 | oxr_system_get_hand_tracking_supportcxx . . $ oxr_system_get_hand_tracking_support(98bb97ffe1c1348d).(struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_instancecxx . . $ oxr_instance# *inst) |
| 257 | { |
| 258 | struct oxr_systemcxx . . $ oxr_system# *sys = &inst->systemcxx . . $ oxr_instance#system.; |
| 259 | struct xrt_devicecxx . . $ xrt_device# *ht_left = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, hand_tracking_left); |
| 260 | struct xrt_devicecxx . . $ xrt_device# *ht_right = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, hand_tracking_right); |
| 261 | |
| 262 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! left_supported = ht_left && ht_left->hand_tracking_supportedcxx . . $ xrt_device#hand_tracking_supported.; |
| 263 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! right_supported = ht_right && ht_right->hand_tracking_supportedcxx . . $ xrt_device#hand_tracking_supported.; |
| 264 | |
| 265 | return left_supported || right_supported; |
| 266 | } |
| 267 | |
| 268 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 269 | oxr_system_get_eye_gaze_supportcxx . . $ oxr_system_get_eye_gaze_support(98bb97ffe1c1348d).(struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_instancecxx . . $ oxr_instance# *inst) |
| 270 | { |
| 271 | struct oxr_systemcxx . . $ oxr_system# *sys = &inst->systemcxx . . $ oxr_instance#system.; |
| 272 | struct xrt_devicecxx . . $ xrt_device# *eyes = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, eyes); |
| 273 | |
| 274 | return eyes && eyes->eye_gaze_supportedcxx . . $ xrt_device#eye_gaze_supported.; |
| 275 | } |
| 276 | |
| 277 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 278 | oxr_system_get_force_feedback_supportcxx . . $ oxr_system_get_force_feedback_support(98bb97ffe1c1348d).(struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_instancecxx . . $ oxr_instance# *inst) |
| 279 | { |
| 280 | struct oxr_systemcxx . . $ oxr_system# *sys = &inst->systemcxx . . $ oxr_instance#system.; |
| 281 | struct xrt_devicecxx . . $ xrt_device# *ffb_left = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, hand_tracking_left); |
| 282 | struct xrt_devicecxx . . $ xrt_device# *ffb_right = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, hand_tracking_right); |
| 283 | |
| 284 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! left_supported = ffb_left && ffb_left->force_feedback_supportedcxx . . $ xrt_device#force_feedback_supported.; |
| 285 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! right_supported = ffb_right && ffb_right->force_feedback_supportedcxx . . $ xrt_device#force_feedback_supported.; |
| 286 | |
| 287 | return left_supported || right_supported; |
| 288 | } |
| 289 | |
| 290 | void |
| 291 | oxr_system_get_face_tracking_htc_supportcxx . . $ oxr_system_get_face_tracking_htc_support(6b08216297e85478).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 292 | struct oxr_instancecxx . . $ oxr_instance# *inst, |
| 293 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! *supports_eye, |
| 294 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! *supports_lip) |
| 295 | { |
| 296 | struct oxr_systemcxx . . $ oxr_system# *sys = &inst->systemcxx . . $ oxr_instance#system.; |
| 297 | struct xrt_devicecxx . . $ xrt_device# *face_xdev = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, face); |
| 298 | |
| 299 | if (supports_eye) |
| 300 | *supports_eye = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 301 | if (supports_lip) |
| 302 | *supports_lip = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 303 | |
| 304 | if (face_xdev == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || !face_xdev->face_tracking_supportedcxx . . $ xrt_device#face_tracking_supported. || face_xdev->inputscxx . . $ xrt_device#inputs. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 305 | return; |
| 306 | } |
| 307 | |
| 308 | for (size_t input_idx = 0; input_idx < face_xdev->input_countcxx . . $ xrt_device#input_count.; ++input_idx) { |
| 309 | const struct xrt_inputcxx . . $ xrt_input# *input = &face_xdev->inputscxx . . $ xrt_device#inputs.[input_idx]; |
| 310 | if (supports_eye != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && input->namecxx . . $ xrt_input#name. == XRT_INPUT_HTC_EYE_FACE_TRACKINGcxx . . $ XRT_INPUT_HTC_EYE_FACE_TRACKING.) { |
| 311 | *supports_eye = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 312 | } |
| 313 | if (supports_lip != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && input->namecxx . . $ xrt_input#name. == XRT_INPUT_HTC_LIP_FACE_TRACKINGcxx . . $ XRT_INPUT_HTC_LIP_FACE_TRACKING.) { |
| 314 | *supports_lip = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 315 | } |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | void |
| 320 | oxr_system_get_face_tracking2_fb_supportcxx . . $ oxr_system_get_face_tracking2_fb_support(6b08216297e85478).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 321 | struct oxr_instancecxx . . $ oxr_instance# *inst, |
| 322 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! *supports_audio, |
| 323 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! *supports_visual) |
| 324 | { |
| 325 | if (supports_audio != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 326 | *supports_audio = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 327 | |
| 328 | if (supports_visual != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 329 | *supports_visual = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 330 | |
| 331 | struct oxr_systemcxx . . $ oxr_system# *sys = &inst->systemcxx . . $ oxr_instance#system.; |
| 332 | struct xrt_devicecxx . . $ xrt_device# *face_xdev = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, face); |
| 333 | |
| 334 | if (face_xdev == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || !face_xdev->face_tracking_supportedcxx . . $ xrt_device#face_tracking_supported. || face_xdev->inputscxx . . $ xrt_device#inputs. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 335 | return; |
| 336 | } |
| 337 | |
| 338 | for (size_t input_idx = 0; input_idx < face_xdev->input_countcxx . . $ xrt_device#input_count.; ++input_idx) { |
| 339 | const struct xrt_inputcxx . . $ xrt_input# *input = &face_xdev->inputscxx . . $ xrt_device#inputs.[input_idx]; |
| 340 | if (input->namecxx . . $ xrt_input#name. == XRT_INPUT_FB_FACE_TRACKING2_AUDIOcxx . . $ XRT_INPUT_FB_FACE_TRACKING2_AUDIO. && supports_audio != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 341 | *supports_audio = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 342 | } else if (input->namecxx . . $ xrt_input#name. == XRT_INPUT_FB_FACE_TRACKING2_VISUALcxx . . $ XRT_INPUT_FB_FACE_TRACKING2_VISUAL. && supports_visual != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 343 | *supports_visual = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 344 | } |
| 345 | } |
| 346 | return; |
| 347 | } |
| 348 | |
| 349 | static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 350 | oxr_system_get_body_tracking_supportcxx . . $ oxr_system_get_body_tracking_support(a639fe9ae143f904).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 351 | struct oxr_instancecxx . . $ oxr_instance# *inst, |
| 352 | const enum xrt_input_namecxx . . $ xrt_input_name# body_tracking_name) |
| 353 | { |
| 354 | struct oxr_systemcxx . . $ oxr_system# *sys = &inst->systemcxx . . $ oxr_instance#system.; |
| 355 | const struct xrt_devicecxx . . $ xrt_device# *body = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, body); |
| 356 | if (body == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || !body->body_tracking_supportedcxx . . $ xrt_device#body_tracking_supported. || body->inputscxx . . $ xrt_device#inputs. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 357 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 358 | } |
| 359 | |
| 360 | for (size_t input_idx = 0; input_idx < body->input_countcxx . . $ xrt_device#input_count.; ++input_idx) { |
| 361 | const struct xrt_inputcxx . . $ xrt_input# *input = &body->inputscxx . . $ xrt_device#inputs.[input_idx]; |
| 362 | if (input->namecxx . . $ xrt_input#name. == body_tracking_name) { |
| 363 | return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 364 | } |
| 365 | } |
| 366 | return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 367 | } |
| 368 | |
| 369 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! |
| 370 | oxr_system_get_body_tracking_fb_supportcxx . . $ oxr_system_get_body_tracking_fb_support(98bb97ffe1c1348d).(struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_instancecxx . . $ oxr_instance# *inst) |
| 371 | { |
| 372 | return oxr_system_get_body_tracking_supportcxx . . $ oxr_system_get_body_tracking_support(a639fe9ae143f904).(log, inst, XRT_INPUT_FB_BODY_TRACKINGcxx . . $ XRT_INPUT_FB_BODY_TRACKING.); |
| 373 | } |
| 374 | |
| 375 | XrResultcxx . . $ XrResult# |
| 376 | oxr_system_get_propertiescxx . . $ oxr_system_get_properties(eb0d857ab3b129a7).(struct oxr_loggercxx . . $ oxr_logger# *log, struct oxr_systemcxx . . $ oxr_system# *sys, XrSystemPropertiescxx . . $ XrSystemProperties# *properties) |
| 377 | { |
| 378 | properties->systemIdcxx . . $ XrSystemProperties#systemId. = sys->systemIdcxx . . $ oxr_system#systemId.; |
| 379 | properties->vendorIdcxx . . $ XrSystemProperties#vendorId. = sys->xsyscxx . . $ oxr_system#xsys.->propertiescxx . . $ xrt_system#properties..vendor_idcxx . . $ xrt_system_properties#vendor_id.; |
| 380 | memcpycxx . . $ memcpy(cc817cb175f282d).(properties->systemNamecxx . . $ XrSystemProperties#systemName., sys->xsyscxx . . $ oxr_system#xsys.->propertiescxx . . $ xrt_system#properties..namecxx . . $ xrt_system_properties#name., sizeof(properties->systemNamecxx . . $ XrSystemProperties#systemName.)); |
| 381 | |
| 382 | struct xrt_devicecxx . . $ xrt_device# *xdev = GET_XDEV_BY_ROLEcxx . . $ `src/xrt/state_trackers/oxr/oxr_objects.h:1551:9`!(sys, head); |
| 383 | |
| 384 | // Get from compositor. |
| 385 | struct xrt_system_compositor_infocxx . . $ xrt_system_compositor_info# *info = sys->xsysccxx . . $ oxr_system#xsysc. ? &sys->xsysccxx . . $ oxr_system#xsysc.->infocxx . . $ xrt_system_compositor#info. : NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 386 | |
| 387 | if (info) { |
| 388 | properties->graphicsPropertiescxx . . $ XrSystemProperties#graphicsProperties..maxLayerCountcxx . . $ XrSystemGraphicsProperties#maxLayerCount. = info->max_layerscxx . . $ xrt_system_compositor_info#max_layers.; |
| 389 | } else { |
| 390 | // probably using the headless extension, but the extension does not modify the 16 layer minimum. |
| 391 | properties->graphicsPropertiescxx . . $ XrSystemProperties#graphicsProperties..maxLayerCountcxx . . $ XrSystemGraphicsProperties#maxLayerCount. = XRT_MAX_LAYERScxx . . $ `src/xrt/include/xrt/xrt_limits.h:54:9`!; |
| 392 | } |
| 393 | properties->graphicsPropertiescxx . . $ XrSystemProperties#graphicsProperties..maxSwapchainImageWidthcxx . . $ XrSystemGraphicsProperties#maxSwapchainImageWidth. = 1024 * 16; |
| 394 | properties->graphicsPropertiescxx . . $ XrSystemProperties#graphicsProperties..maxSwapchainImageHeightcxx . . $ XrSystemGraphicsProperties#maxSwapchainImageHeight. = 1024 * 16; |
| 395 | properties->trackingPropertiescxx . . $ XrSystemProperties#trackingProperties..orientationTrackingcxx . . $ XrSystemTrackingProperties#orientationTracking. = xdev->orientation_tracking_supportedcxx . . $ xrt_device#orientation_tracking_supported.; |
| 396 | properties->trackingPropertiescxx . . $ XrSystemProperties#trackingProperties..positionTrackingcxx . . $ XrSystemTrackingProperties#positionTracking. = xdev->position_tracking_supportedcxx . . $ xrt_device#position_tracking_supported.; |
| 397 | |
| 398 | #ifdef OXR_HAVE_EXT_hand_trackingcxx . . $ `src/xrt/state_trackers/oxr/oxr_extension_support.h:356:9`! |
| 399 | XrSystemHandTrackingPropertiesEXTcxx . . $ XrSystemHandTrackingPropertiesEXT# *hand_tracking_props = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 400 | // We should only be looking for extension structs if the extension has been enabled. |
| 401 | if (sys->instcxx . . $ oxr_system#inst.->extensionscxx . . $ oxr_instance#extensions..EXT_hand_trackingcxx . . $ oxr_extension_status#EXT_hand_tracking.) { |
| 402 | hand_tracking_props = OXR_GET_OUTPUT_FROM_CHAINcxx . . $ `src/xrt/state_trackers/oxr/oxr_chain.h:85:9`!(properties, XR_TYPE_SYSTEM_HAND_TRACKING_PROPERTIES_EXT, |
| 403 | XrSystemHandTrackingPropertiesEXT); |
| 404 | } |
| 405 | |
| 406 | if (hand_tracking_props) { |
| 407 | hand_tracking_props->supportsHandTrackingcxx . . $ XrSystemHandTrackingPropertiesEXT#supportsHandTracking. = oxr_system_get_hand_tracking_supportcxx . . $ oxr_system_get_hand_tracking_support(98bb97ffe1c1348d).(log, sys->instcxx . . $ oxr_system#inst.); |
| 408 | } |
| 409 | #endif |
| 410 | |
| 411 | #ifdef OXR_HAVE_EXT_eye_gaze_interactioncxx . . $ `src/xrt/state_trackers/oxr/oxr_extension_support.h:334:9`! |
| 412 | XrSystemEyeGazeInteractionPropertiesEXTcxx . . $ XrSystemEyeGazeInteractionPropertiesEXT# *eye_gaze_props = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 413 | if (sys->instcxx . . $ oxr_system#inst.->extensionscxx . . $ oxr_instance#extensions..EXT_eye_gaze_interactioncxx . . $ oxr_extension_status#EXT_eye_gaze_interaction.) { |
| 414 | eye_gaze_props = |
| 415 | OXR_GET_OUTPUT_FROM_CHAINcxx . . $ `src/xrt/state_trackers/oxr/oxr_chain.h:85:9`!(properties, XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT, |
| 416 | XrSystemEyeGazeInteractionPropertiesEXT); |
| 417 | } |
| 418 | |
| 419 | if (eye_gaze_props) { |
| 420 | eye_gaze_props->supportsEyeGazeInteractioncxx . . $ XrSystemEyeGazeInteractionPropertiesEXT#supportsEyeGazeInteraction. = oxr_system_get_eye_gaze_supportcxx . . $ oxr_system_get_eye_gaze_support(98bb97ffe1c1348d).(log, sys->instcxx . . $ oxr_system#inst.); |
| 421 | } |
| 422 | #endif |
| 423 | |
| 424 | #ifdef OXR_HAVE_MNDX_force_feedback_curlcxx . . $ `src/xrt/state_trackers/oxr/oxr_extension_support.h:711:9`! |
| 425 | XrSystemForceFeedbackCurlPropertiesMNDXcxx . . $ XrSystemForceFeedbackCurlPropertiesMNDX# *force_feedback_props = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 426 | if (sys->instcxx . . $ oxr_system#inst.->extensionscxx . . $ oxr_instance#extensions..MNDX_force_feedback_curlcxx . . $ oxr_extension_status#MNDX_force_feedback_curl.) { |
| 427 | force_feedback_props = |
| 428 | OXR_GET_OUTPUT_FROM_CHAINcxx . . $ `src/xrt/state_trackers/oxr/oxr_chain.h:85:9`!(properties, XR_TYPE_SYSTEM_FORCE_FEEDBACK_CURL_PROPERTIES_MNDX, |
| 429 | XrSystemForceFeedbackCurlPropertiesMNDX); |
| 430 | } |
| 431 | |
| 432 | if (force_feedback_props) { |
| 433 | force_feedback_props->supportsForceFeedbackCurlcxx . . $ XrSystemForceFeedbackCurlPropertiesMNDX#supportsForceFeedbackCurl. = oxr_system_get_force_feedback_supportcxx . . $ oxr_system_get_force_feedback_support(98bb97ffe1c1348d).(log, sys->instcxx . . $ oxr_system#inst.); |
| 434 | } |
| 435 | #endif |
| 436 | |
| 437 | #ifdef OXR_HAVE_FB_passthrough |
| 438 | XrSystemPassthroughPropertiesFB *passthrough_props = NULL; |
| 439 | XrSystemPassthroughProperties2FB *passthrough_props2 = NULL; |
| 440 | if (sys->inst->extensions.FB_passthrough) { |
| 441 | passthrough_props = OXR_GET_OUTPUT_FROM_CHAIN(properties, XR_TYPE_SYSTEM_PASSTHROUGH_PROPERTIES_FB, |
| 442 | XrSystemPassthroughPropertiesFB); |
| 443 | if (passthrough_props) { |
| 444 | passthrough_props->supportsPassthrough = true; |
| 445 | } |
| 446 | |
| 447 | passthrough_props2 = OXR_GET_OUTPUT_FROM_CHAIN(properties, XR_TYPE_SYSTEM_PASSTHROUGH_PROPERTIES2_FB, |
| 448 | XrSystemPassthroughProperties2FB); |
| 449 | if (passthrough_props2) { |
| 450 | passthrough_props2->capabilities = XR_PASSTHROUGH_CAPABILITY_BIT_FB; |
| 451 | } |
| 452 | } |
| 453 | #endif |
| 454 | |
| 455 | #ifdef OXR_HAVE_HTC_facial_tracking |
| 456 | XrSystemFacialTrackingPropertiesHTC *htc_facial_tracking_props = NULL; |
| 457 | if (sys->inst->extensions.HTC_facial_tracking) { |
| 458 | htc_facial_tracking_props = OXR_GET_OUTPUT_FROM_CHAIN( |
| 459 | properties, XR_TYPE_SYSTEM_FACIAL_TRACKING_PROPERTIES_HTC, XrSystemFacialTrackingPropertiesHTC); |
| 460 | } |
| 461 | |
| 462 | if (htc_facial_tracking_props) { |
| 463 | bool supports_eye = false; |
| 464 | bool supports_lip = false; |
| 465 | oxr_system_get_face_tracking_htc_support(log, sys->inst, &supports_eye, &supports_lip); |
| 466 | htc_facial_tracking_props->supportEyeFacialTracking = supports_eye; |
| 467 | htc_facial_tracking_props->supportLipFacialTracking = supports_lip; |
| 468 | } |
| 469 | #endif // OXR_HAVE_HTC_facial_tracking |
| 470 | |
| 471 | #ifdef OXR_HAVE_FB_body_tracking |
| 472 | XrSystemBodyTrackingPropertiesFB *body_tracking_fb_props = NULL; |
| 473 | if (sys->inst->extensions.FB_body_tracking) { |
| 474 | body_tracking_fb_props = OXR_GET_OUTPUT_FROM_CHAIN( |
| 475 | properties, XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_FB, XrSystemBodyTrackingPropertiesFB); |
| 476 | } |
| 477 | |
| 478 | if (body_tracking_fb_props) { |
| 479 | body_tracking_fb_props->supportsBodyTracking = oxr_system_get_body_tracking_fb_support(log, sys->inst); |
| 480 | } |
| 481 | #endif // OXR_HAVE_FB_body_tracking |
| 482 | |
| 483 | #ifdef OXR_HAVE_FB_face_tracking2 |
| 484 | XrSystemFaceTrackingProperties2FB *face_tracking2_fb_props = NULL; |
| 485 | if (sys->inst->extensions.FB_face_tracking2) { |
| 486 | face_tracking2_fb_props = OXR_GET_OUTPUT_FROM_CHAIN( |
| 487 | properties, XR_TYPE_SYSTEM_FACE_TRACKING_PROPERTIES2_FB, XrSystemFaceTrackingProperties2FB); |
| 488 | } |
| 489 | |
| 490 | if (face_tracking2_fb_props) { |
| 491 | bool supports_audio, supports_visual; |
| 492 | oxr_system_get_face_tracking2_fb_support(log, sys->inst, &supports_audio, &supports_visual); |
| 493 | face_tracking2_fb_props->supportsAudioFaceTracking = supports_audio; |
| 494 | face_tracking2_fb_props->supportsVisualFaceTracking = supports_visual; |
| 495 | } |
| 496 | #endif // OXR_HAVE_FB_face_tracking2 |
| 497 | |
| 498 | |
| 499 | #ifdef OXR_HAVE_MNDX_xdev_spacecxx . . $ `src/xrt/state_trackers/oxr/oxr_extension_support.h:744:9`! |
| 500 | XrSystemXDevSpacePropertiesMNDXcxx . . $ XrSystemXDevSpacePropertiesMNDX# *xdev_space_props = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 501 | if (sys->instcxx . . $ oxr_system#inst.->extensionscxx . . $ oxr_instance#extensions..MNDX_xdev_spacecxx . . $ oxr_extension_status#MNDX_xdev_space.) { |
| 502 | xdev_space_props = OXR_GET_OUTPUT_FROM_CHAINcxx . . $ `src/xrt/state_trackers/oxr/oxr_chain.h:85:9`!(properties, XR_TYPE_SYSTEM_XDEV_SPACE_PROPERTIES_MNDX, |
| 503 | XrSystemXDevSpacePropertiesMNDX); |
| 504 | } |
| 505 | |
| 506 | if (xdev_space_props) { |
| 507 | xdev_space_props->supportsXDevSpacecxx . . $ XrSystemXDevSpacePropertiesMNDX#supportsXDevSpace. = sys->supports_xdev_spacecxx . . $ oxr_system#supports_xdev_space.; |
| 508 | } |
| 509 | #endif // OXR_HAVE_MNDX_xdev_space |
| 510 | |
| 511 | return XR_SUCCESScxx . . $ XR_SUCCESS.; |
| 512 | } |
| 513 | |
| 514 | XrResultcxx . . $ XrResult# |
| 515 | oxr_system_enumerate_view_confscxx . . $ oxr_system_enumerate_view_confs(dc788a1f79445976).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 516 | struct oxr_systemcxx . . $ oxr_system# *sys, |
| 517 | uint32_tcxx . . $ uint32_t# viewConfigurationTypeCapacityInput, |
| 518 | uint32_tcxx . . $ uint32_t# *viewConfigurationTypeCountOutput, |
| 519 | XrViewConfigurationTypecxx . . $ XrViewConfigurationType# *viewConfigurationTypes) |
| 520 | { |
| 521 | OXR_TWO_CALL_HELPERcxx . . $ `src/xrt/state_trackers/oxr/oxr_two_call.h:18:9`!(log, viewConfigurationTypeCapacityInput, viewConfigurationTypeCountOutput, |
| 522 | viewConfigurationTypes, 1, &sys->view_config_type, XR_SUCCESS); |
| 523 | } |
| 524 | |
| 525 | XrResultcxx . . $ XrResult# |
| 526 | oxr_system_enumerate_blend_modescxx . . $ oxr_system_enumerate_blend_modes(16b7964f8a33aee3).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 527 | struct oxr_systemcxx . . $ oxr_system# *sys, |
| 528 | XrViewConfigurationTypecxx . . $ XrViewConfigurationType# viewConfigurationType, |
| 529 | uint32_tcxx . . $ uint32_t# environmentBlendModeCapacityInput, |
| 530 | uint32_tcxx . . $ uint32_t# *environmentBlendModeCountOutput, |
| 531 | XrEnvironmentBlendModecxx . . $ XrEnvironmentBlendMode# *environmentBlendModes) |
| 532 | { |
| 533 | //! @todo Take into account viewConfigurationType |
| 534 | OXR_TWO_CALL_HELPERcxx . . $ `src/xrt/state_trackers/oxr/oxr_two_call.h:18:9`!(log, environmentBlendModeCapacityInput, environmentBlendModeCountOutput, |
| 535 | environmentBlendModes, sys->blend_mode_count, sys->blend_modes, XR_SUCCESS); |
| 536 | } |
| 537 | |
| 538 | XrResultcxx . . $ XrResult# |
| 539 | oxr_system_get_view_conf_propertiescxx . . $ oxr_system_get_view_conf_properties(845ace39dba3501c).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 540 | struct oxr_systemcxx . . $ oxr_system# *sys, |
| 541 | XrViewConfigurationTypecxx . . $ XrViewConfigurationType# viewConfigurationType, |
| 542 | XrViewConfigurationPropertiescxx . . $ XrViewConfigurationProperties# *configurationProperties) |
| 543 | { |
| 544 | if (viewConfigurationType != sys->view_config_typecxx . . $ oxr_system#view_config_type.) { |
| 545 | return oxr_errorcxx . . $ oxr_error(1140daf53870d718).(log, XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTEDcxx . . $ XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED., "Invalid view configuration type"); |
| 546 | } |
| 547 | |
| 548 | configurationProperties->viewConfigurationTypecxx . . $ XrViewConfigurationProperties#viewConfigurationType. = sys->view_config_typecxx . . $ oxr_system#view_config_type.; |
| 549 | configurationProperties->fovMutablecxx . . $ XrViewConfigurationProperties#fovMutable. = XR_FALSEcxx . . $ `src/external/openxr_includes/openxr/openxr.h:131:9`!; |
| 550 | |
| 551 | return XR_SUCCESScxx . . $ XR_SUCCESS.; |
| 552 | } |
| 553 | |
| 554 | static void |
| 555 | view_configuration_view_fill_incxx . . $ view_configuration_view_fill_in(83d67a4a43d9b5f2).(XrViewConfigurationViewcxx . . $ XrViewConfigurationView# *target_view, XrViewConfigurationViewcxx . . $ XrViewConfigurationView# *source_view) |
| 556 | { |
| 557 | // clang-format off |
| 558 | target_view->recommendedImageRectWidthcxx . . $ XrViewConfigurationView#recommendedImageRectWidth. = source_view->recommendedImageRectWidthcxx . . $ XrViewConfigurationView#recommendedImageRectWidth.; |
| 559 | target_view->maxImageRectWidthcxx . . $ XrViewConfigurationView#maxImageRectWidth. = source_view->maxImageRectWidthcxx . . $ XrViewConfigurationView#maxImageRectWidth.; |
| 560 | target_view->recommendedImageRectHeightcxx . . $ XrViewConfigurationView#recommendedImageRectHeight. = source_view->recommendedImageRectHeightcxx . . $ XrViewConfigurationView#recommendedImageRectHeight.; |
| 561 | target_view->maxImageRectHeightcxx . . $ XrViewConfigurationView#maxImageRectHeight. = source_view->maxImageRectHeightcxx . . $ XrViewConfigurationView#maxImageRectHeight.; |
| 562 | target_view->recommendedSwapchainSampleCountcxx . . $ XrViewConfigurationView#recommendedSwapchainSampleCount. = source_view->recommendedSwapchainSampleCountcxx . . $ XrViewConfigurationView#recommendedSwapchainSampleCount.; |
| 563 | target_view->maxSwapchainSampleCountcxx . . $ XrViewConfigurationView#maxSwapchainSampleCount. = source_view->maxSwapchainSampleCountcxx . . $ XrViewConfigurationView#maxSwapchainSampleCount.; |
| 564 | // clang-format on |
| 565 | } |
| 566 | |
| 567 | XrResultcxx . . $ XrResult# |
| 568 | oxr_system_enumerate_view_conf_viewscxx . . $ oxr_system_enumerate_view_conf_views(d099fd45cdd7ef84).(struct oxr_loggercxx . . $ oxr_logger# *log, |
| 569 | struct oxr_systemcxx . . $ oxr_system# *sys, |
| 570 | XrViewConfigurationTypecxx . . $ XrViewConfigurationType# viewConfigurationType, |
| 571 | uint32_tcxx . . $ uint32_t# viewCapacityInput, |
| 572 | uint32_tcxx . . $ uint32_t# *viewCountOutput, |
| 573 | XrViewConfigurationViewcxx . . $ XrViewConfigurationView# *views) |
| 574 | { |
| 575 | if (viewConfigurationType != sys->view_config_typecxx . . $ oxr_system#view_config_type.) { |
| 576 | return oxr_errorcxx . . $ oxr_error(1140daf53870d718).(log, XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTEDcxx . . $ XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED., "Invalid view configuration type"); |
| 577 | } |
| 578 | if (sys->view_config_typecxx . . $ oxr_system#view_config_type. == XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONOcxx . . $ XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO.) { |
| 579 | OXR_TWO_CALL_FILL_IN_HELPERcxx . . $ `src/xrt/state_trackers/oxr/oxr_two_call.h:38:9`!(log, viewCapacityInput, viewCountOutput, views, 1, |
| 580 | view_configuration_view_fill_in, sys->views, XR_SUCCESS); |
| 581 | } else { |
| 582 | OXR_TWO_CALL_FILL_IN_HELPERcxx . . $ `src/xrt/state_trackers/oxr/oxr_two_call.h:38:9`!(log, viewCapacityInput, viewCountOutput, views, 2, |
| 583 | view_configuration_view_fill_in, sys->views, XR_SUCCESS); |
| 584 | } |
| 585 | } |