Update OpenXR thirdparty library to 1.1.38, changed OpenXR init to stay on 1.0.x

This commit is contained in:
Bastiaan Olij 2024-08-07 13:58:05 +10:00
parent eabeafd8c3
commit 1371b35b6e
9 changed files with 829 additions and 81 deletions

View file

@ -525,7 +525,7 @@ bool OpenXRAPI::create_instance() {
1, // applicationVersion, we don't currently have this
"Godot Game Engine", // engineName
VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH, // engineVersion 4.0 -> 40000, 4.0.1 -> 40001, 4.1 -> 40100, etc.
XR_CURRENT_API_VERSION // apiVersion
XR_API_VERSION_1_0 // apiVersion
};
void *next_pointer = nullptr;

View file

@ -748,7 +748,7 @@ with the provided patch.
## openxr
- Upstream: https://github.com/KhronosGroup/OpenXR-SDK
- Version: 1.0.34 (288d3a7ebc1ad959f62d51da75baa3d27438c499, 2024)
- Version: 1.1.38 (f90488c4fb1537f4256d09d4a4d3ad5543ebaf24, 2024)
- License: Apache 2.0
Files extracted from upstream source:

File diff suppressed because it is too large Load diff

View file

@ -20,6 +20,7 @@ extern "C" {
// XR_LOADER_VERSION_1_0 is a preprocessor guard. Do not pass it to API calls.
#define XR_LOADER_VERSION_1_0 1
#define XR_CURRENT_LOADER_API_LAYER_VERSION 1

View file

@ -21,6 +21,7 @@ extern "C" {
#ifdef XR_USE_PLATFORM_ANDROID
// XR_KHR_android_thread_settings is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_android_thread_settings 1
#define XR_KHR_android_thread_settings_SPEC_VERSION 6
#define XR_KHR_ANDROID_THREAD_SETTINGS_EXTENSION_NAME "XR_KHR_android_thread_settings"
@ -46,6 +47,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrSetAndroidApplicationThreadKHR(
#ifdef XR_USE_PLATFORM_ANDROID
// XR_KHR_android_surface_swapchain is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_android_surface_swapchain 1
#define XR_KHR_android_surface_swapchain_SPEC_VERSION 4
#define XR_KHR_ANDROID_SURFACE_SWAPCHAIN_EXTENSION_NAME "XR_KHR_android_surface_swapchain"
@ -64,6 +66,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateSwapchainAndroidSurfaceKHR(
#ifdef XR_USE_PLATFORM_ANDROID
// XR_KHR_android_create_instance is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_android_create_instance 1
#define XR_KHR_android_create_instance_SPEC_VERSION 3
#define XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME "XR_KHR_android_create_instance"
@ -79,6 +82,7 @@ typedef struct XrInstanceCreateInfoAndroidKHR {
#ifdef XR_USE_GRAPHICS_API_VULKAN
// XR_KHR_vulkan_swapchain_format_list is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_vulkan_swapchain_format_list 1
#define XR_KHR_vulkan_swapchain_format_list_SPEC_VERSION 4
#define XR_KHR_VULKAN_SWAPCHAIN_FORMAT_LIST_EXTENSION_NAME "XR_KHR_vulkan_swapchain_format_list"
@ -93,6 +97,7 @@ typedef struct XrVulkanSwapchainFormatListCreateInfoKHR {
#ifdef XR_USE_GRAPHICS_API_OPENGL
// XR_KHR_opengl_enable is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_opengl_enable 1
#define XR_KHR_opengl_enable_SPEC_VERSION 10
#define XR_KHR_OPENGL_ENABLE_EXTENSION_NAME "XR_KHR_opengl_enable"
@ -169,6 +174,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLGraphicsRequirementsKHR(
#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
// XR_KHR_opengl_es_enable is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_opengl_es_enable 1
#define XR_KHR_opengl_es_enable_SPEC_VERSION 8
#define XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME "XR_KHR_opengl_es_enable"
@ -210,6 +216,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLESGraphicsRequirementsKHR(
#ifdef XR_USE_GRAPHICS_API_VULKAN
// XR_KHR_vulkan_enable is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_vulkan_enable 1
#define XR_KHR_vulkan_enable_SPEC_VERSION 8
#define XR_KHR_VULKAN_ENABLE_EXTENSION_NAME "XR_KHR_vulkan_enable"
@ -274,6 +281,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirementsKHR(
#ifdef XR_USE_GRAPHICS_API_D3D11
// XR_KHR_D3D11_enable is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_D3D11_enable 1
#define XR_KHR_D3D11_enable_SPEC_VERSION 9
#define XR_KHR_D3D11_ENABLE_EXTENSION_NAME "XR_KHR_D3D11_enable"
@ -311,6 +319,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D11GraphicsRequirementsKHR(
#ifdef XR_USE_GRAPHICS_API_D3D12
// XR_KHR_D3D12_enable is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_D3D12_enable 1
#define XR_KHR_D3D12_enable_SPEC_VERSION 9
#define XR_KHR_D3D12_ENABLE_EXTENSION_NAME "XR_KHR_D3D12_enable"
@ -349,6 +358,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D12GraphicsRequirementsKHR(
#ifdef XR_USE_PLATFORM_WIN32
// XR_KHR_win32_convert_performance_counter_time is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_win32_convert_performance_counter_time 1
#define XR_KHR_win32_convert_performance_counter_time_SPEC_VERSION 1
#define XR_KHR_WIN32_CONVERT_PERFORMANCE_COUNTER_TIME_EXTENSION_NAME "XR_KHR_win32_convert_performance_counter_time"
@ -372,6 +382,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToWin32PerformanceCounterKHR(
#ifdef XR_USE_TIMESPEC
// XR_KHR_convert_timespec_time is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_convert_timespec_time 1
#define XR_KHR_convert_timespec_time_SPEC_VERSION 1
#define XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME "XR_KHR_convert_timespec_time"
@ -395,6 +406,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToTimespecTimeKHR(
#ifdef XR_USE_PLATFORM_ANDROID
// XR_KHR_loader_init_android is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_loader_init_android 1
#define XR_KHR_loader_init_android_SPEC_VERSION 1
#define XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME "XR_KHR_loader_init_android"
@ -409,6 +421,7 @@ typedef struct XrLoaderInitInfoAndroidKHR {
#ifdef XR_USE_GRAPHICS_API_VULKAN
// XR_KHR_vulkan_enable2 is a preprocessor guard. Do not pass it to API calls.
#define XR_KHR_vulkan_enable2 1
#define XR_KHR_vulkan_enable2_SPEC_VERSION 2
#define XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME "XR_KHR_vulkan_enable2"
@ -488,6 +501,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirements2KHR(
#ifdef XR_USE_PLATFORM_EGL
// XR_MNDX_egl_enable is a preprocessor guard. Do not pass it to API calls.
#define XR_MNDX_egl_enable 1
#define XR_MNDX_egl_enable_SPEC_VERSION 2
#define XR_MNDX_EGL_ENABLE_EXTENSION_NAME "XR_MNDX_egl_enable"
@ -506,6 +520,7 @@ typedef struct XrGraphicsBindingEGLMNDX {
#ifdef XR_USE_PLATFORM_WIN32
// XR_MSFT_perception_anchor_interop is a preprocessor guard. Do not pass it to API calls.
#define XR_MSFT_perception_anchor_interop 1
#define XR_MSFT_perception_anchor_interop_SPEC_VERSION 1
#define XR_MSFT_PERCEPTION_ANCHOR_INTEROP_EXTENSION_NAME "XR_MSFT_perception_anchor_interop"
@ -529,6 +544,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrTryGetPerceptionAnchorFromSpatialAnchorMSFT(
#ifdef XR_USE_PLATFORM_WIN32
// XR_MSFT_holographic_window_attachment is a preprocessor guard. Do not pass it to API calls.
#define XR_MSFT_holographic_window_attachment 1
#define XR_MSFT_holographic_window_attachment_SPEC_VERSION 1
#define XR_MSFT_HOLOGRAPHIC_WINDOW_ATTACHMENT_EXTENSION_NAME "XR_MSFT_holographic_window_attachment"
@ -546,6 +562,7 @@ typedef struct XrHolographicWindowAttachmentMSFT {
#ifdef XR_USE_PLATFORM_ANDROID
// XR_FB_android_surface_swapchain_create is a preprocessor guard. Do not pass it to API calls.
#define XR_FB_android_surface_swapchain_create 1
#define XR_FB_android_surface_swapchain_create_SPEC_VERSION 1
#define XR_FB_ANDROID_SURFACE_SWAPCHAIN_CREATE_EXTENSION_NAME "XR_FB_android_surface_swapchain_create"
@ -568,6 +585,7 @@ typedef struct XrAndroidSurfaceSwapchainCreateInfoFB {
#ifdef XR_USE_PLATFORM_ML
// XR_ML_compat is a preprocessor guard. Do not pass it to API calls.
#define XR_ML_compat 1
#define XR_ML_compat_SPEC_VERSION 1
#define XR_ML_COMPAT_EXTENSION_NAME "XR_ML_compat"
@ -592,6 +610,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpaceFromCoordinateFrameUIDML(
#ifdef XR_USE_PLATFORM_WIN32
// XR_OCULUS_audio_device_guid is a preprocessor guard. Do not pass it to API calls.
#define XR_OCULUS_audio_device_guid 1
#define XR_OCULUS_audio_device_guid_SPEC_VERSION 1
#define XR_OCULUS_AUDIO_DEVICE_GUID_EXTENSION_NAME "XR_OCULUS_audio_device_guid"
@ -614,6 +633,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetAudioInputDeviceGuidOculus(
#ifdef XR_USE_GRAPHICS_API_VULKAN
// XR_FB_foveation_vulkan is a preprocessor guard. Do not pass it to API calls.
#define XR_FB_foveation_vulkan 1
#define XR_FB_foveation_vulkan_SPEC_VERSION 1
#define XR_FB_FOVEATION_VULKAN_EXTENSION_NAME "XR_FB_foveation_vulkan"
@ -630,6 +650,7 @@ typedef struct XrSwapchainImageFoveationVulkanFB {
#ifdef XR_USE_PLATFORM_ANDROID
// XR_FB_swapchain_update_state_android_surface is a preprocessor guard. Do not pass it to API calls.
#define XR_FB_swapchain_update_state_android_surface 1
#define XR_FB_swapchain_update_state_android_surface_SPEC_VERSION 1
#define XR_FB_SWAPCHAIN_UPDATE_STATE_ANDROID_SURFACE_EXTENSION_NAME "XR_FB_swapchain_update_state_android_surface"
@ -646,6 +667,7 @@ typedef struct XrSwapchainStateAndroidSurfaceDimensionsFB {
#ifdef XR_USE_GRAPHICS_API_OPENGL_ES
// XR_FB_swapchain_update_state_opengl_es is a preprocessor guard. Do not pass it to API calls.
#define XR_FB_swapchain_update_state_opengl_es 1
#define XR_FB_swapchain_update_state_opengl_es_SPEC_VERSION 1
#define XR_FB_SWAPCHAIN_UPDATE_STATE_OPENGL_ES_EXTENSION_NAME "XR_FB_swapchain_update_state_opengl_es"
@ -670,6 +692,7 @@ typedef struct XrSwapchainStateSamplerOpenGLESFB {
#ifdef XR_USE_GRAPHICS_API_VULKAN
// XR_FB_swapchain_update_state_vulkan is a preprocessor guard. Do not pass it to API calls.
#define XR_FB_swapchain_update_state_vulkan 1
#define XR_FB_swapchain_update_state_vulkan_SPEC_VERSION 1
#define XR_FB_SWAPCHAIN_UPDATE_STATE_VULKAN_EXTENSION_NAME "XR_FB_swapchain_update_state_vulkan"
@ -695,6 +718,7 @@ typedef struct XrSwapchainStateSamplerVulkanFB {
#ifdef XR_USE_GRAPHICS_API_VULKAN
// XR_META_vulkan_swapchain_create_info is a preprocessor guard. Do not pass it to API calls.
#define XR_META_vulkan_swapchain_create_info 1
#define XR_META_vulkan_swapchain_create_info_SPEC_VERSION 1
#define XR_META_VULKAN_SWAPCHAIN_CREATE_INFO_EXTENSION_NAME "XR_META_vulkan_swapchain_create_info"

View file

@ -86,6 +86,8 @@ XR_ENUM_STR(XrResult);
_(XR_ERROR_LOCALIZED_NAME_INVALID, -49) \
_(XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING, -50) \
_(XR_ERROR_RUNTIME_UNAVAILABLE, -51) \
_(XR_ERROR_EXTENSION_DEPENDENCY_NOT_ENABLED, -1000710001) \
_(XR_ERROR_PERMISSION_INSUFFICIENT, -1000710000) \
_(XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR, -1000003000) \
_(XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR, -1000003001) \
_(XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT, -1000039001) \
@ -135,10 +137,13 @@ XR_ENUM_STR(XrResult);
_(XR_ERROR_SPACE_NETWORK_REQUEST_FAILED_FB, -1000169003) \
_(XR_ERROR_SPACE_CLOUD_STORAGE_DISABLED_FB, -1000169004) \
_(XR_ERROR_PASSTHROUGH_COLOR_LUT_BUFFER_SIZE_MISMATCH_META, -1000266000) \
_(XR_ENVIRONMENT_DEPTH_NOT_AVAILABLE_META, 1000291000) \
_(XR_ERROR_HINT_ALREADY_SET_QCOM, -1000306000) \
_(XR_ERROR_NOT_AN_ANCHOR_HTC, -1000319000) \
_(XR_ERROR_SPACE_NOT_LOCATABLE_EXT, -1000429000) \
_(XR_ERROR_PLANE_DETECTION_PERMISSION_DENIED_EXT, -1000429001) \
_(XR_ERROR_FUTURE_PENDING_EXT, -1000469001) \
_(XR_ERROR_FUTURE_INVALID_EXT, -1000469002) \
_(XR_RESULT_MAX_ENUM, 0x7FFFFFFF)
#define XR_LIST_ENUM_XrStructureType(_) \
@ -192,6 +197,9 @@ XR_ENUM_STR(XrResult);
_(XR_TYPE_ACTIONS_SYNC_INFO, 61) \
_(XR_TYPE_BOUND_SOURCES_FOR_ACTION_ENUMERATE_INFO, 62) \
_(XR_TYPE_INPUT_SOURCE_LOCALIZED_NAME_GET_INFO, 63) \
_(XR_TYPE_SPACES_LOCATE_INFO, 1000471000) \
_(XR_TYPE_SPACE_LOCATIONS, 1000471001) \
_(XR_TYPE_SPACE_VELOCITIES, 1000471002) \
_(XR_TYPE_COMPOSITION_LAYER_CUBE_KHR, 1000006000) \
_(XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR, 1000008000) \
_(XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR, 1000010000) \
@ -457,6 +465,14 @@ XR_ENUM_STR(XrResult);
_(XR_TYPE_FACE_TRACKER_CREATE_INFO2_FB, 1000287014) \
_(XR_TYPE_FACE_EXPRESSION_INFO2_FB, 1000287015) \
_(XR_TYPE_FACE_EXPRESSION_WEIGHTS2_FB, 1000287016) \
_(XR_TYPE_ENVIRONMENT_DEPTH_PROVIDER_CREATE_INFO_META, 1000291000) \
_(XR_TYPE_ENVIRONMENT_DEPTH_SWAPCHAIN_CREATE_INFO_META, 1000291001) \
_(XR_TYPE_ENVIRONMENT_DEPTH_SWAPCHAIN_STATE_META, 1000291002) \
_(XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_ACQUIRE_INFO_META, 1000291003) \
_(XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_VIEW_META, 1000291004) \
_(XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_META, 1000291005) \
_(XR_TYPE_ENVIRONMENT_DEPTH_HAND_REMOVAL_SET_INFO_META, 1000291006) \
_(XR_TYPE_SYSTEM_ENVIRONMENT_DEPTH_PROPERTIES_META, 1000291007) \
_(XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC, 1000317001) \
_(XR_TYPE_PASSTHROUGH_COLOR_HTC, 1000317002) \
_(XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC, 1000317003) \
@ -478,6 +494,10 @@ XR_ENUM_STR(XrResult);
_(XR_TYPE_PLANE_DETECTOR_LOCATION_EXT, 1000429005) \
_(XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT, 1000429006) \
_(XR_TYPE_SYSTEM_PLANE_DETECTION_PROPERTIES_EXT, 1000429007) \
_(XR_TYPE_FUTURE_CANCEL_INFO_EXT, 1000469000) \
_(XR_TYPE_FUTURE_POLL_INFO_EXT, 1000469001) \
_(XR_TYPE_FUTURE_COMPLETION_EXT, 1000469002) \
_(XR_TYPE_FUTURE_POLL_RESULT_EXT, 1000469003) \
_(XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT, 1000470000) \
_(XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT, 1000470001) \
_(XR_STRUCTURE_TYPE_MAX_ENUM, 0x7FFFFFFF)
@ -490,7 +510,7 @@ XR_ENUM_STR(XrResult);
#define XR_LIST_ENUM_XrViewConfigurationType(_) \
_(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO, 1) \
_(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, 2) \
_(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_QUAD_VARJO, 1000037000) \
_(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO_WITH_FOVEATED_INSET, 1000037000) \
_(XR_VIEW_CONFIGURATION_TYPE_SECONDARY_MONO_FIRST_PERSON_OBSERVER_MSFT, 1000054000) \
_(XR_VIEW_CONFIGURATION_TYPE_MAX_ENUM, 0x7FFFFFFF)
@ -504,10 +524,10 @@ XR_ENUM_STR(XrResult);
_(XR_REFERENCE_SPACE_TYPE_VIEW, 1) \
_(XR_REFERENCE_SPACE_TYPE_LOCAL, 2) \
_(XR_REFERENCE_SPACE_TYPE_STAGE, 3) \
_(XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR, 1000426000) \
_(XR_REFERENCE_SPACE_TYPE_UNBOUNDED_MSFT, 1000038000) \
_(XR_REFERENCE_SPACE_TYPE_COMBINED_EYE_VARJO, 1000121000) \
_(XR_REFERENCE_SPACE_TYPE_LOCALIZATION_MAP_ML, 1000139000) \
_(XR_REFERENCE_SPACE_TYPE_LOCAL_FLOOR_EXT, 1000426000) \
_(XR_REFERENCE_SPACE_TYPE_MAX_ENUM, 0x7FFFFFFF)
#define XR_LIST_ENUM_XrActionType(_) \
@ -566,6 +586,8 @@ XR_ENUM_STR(XrResult);
_(XR_OBJECT_TYPE_SPACE_USER_FB, 1000241000) \
_(XR_OBJECT_TYPE_PASSTHROUGH_COLOR_LUT_META, 1000266000) \
_(XR_OBJECT_TYPE_FACE_TRACKER2_FB, 1000287012) \
_(XR_OBJECT_TYPE_ENVIRONMENT_DEPTH_PROVIDER_META, 1000291000) \
_(XR_OBJECT_TYPE_ENVIRONMENT_DEPTH_SWAPCHAIN_META, 1000291001) \
_(XR_OBJECT_TYPE_PASSTHROUGH_HTC, 1000317000) \
_(XR_OBJECT_TYPE_PLANE_DETECTOR_EXT, 1000429000) \
_(XR_OBJECT_TYPE_MAX_ENUM, 0x7FFFFFFF)
@ -1377,6 +1399,11 @@ XR_ENUM_STR(XrResult);
_(XR_PLANE_DETECTION_STATE_FATAL_EXT, 4) \
_(XR_PLANE_DETECTION_STATE_MAX_ENUM_EXT, 0x7FFFFFFF)
#define XR_LIST_ENUM_XrFutureStateEXT(_) \
_(XR_FUTURE_STATE_PENDING_EXT, 1) \
_(XR_FUTURE_STATE_READY_EXT, 2) \
_(XR_FUTURE_STATE_MAX_ENUM_EXT, 0x7FFFFFFF)
#define XR_LIST_ENUM_XrHeadsetFitStatusML(_) \
_(XR_HEADSET_FIT_STATUS_UNKNOWN_ML, 0) \
_(XR_HEADSET_FIT_STATUS_NOT_WORN_ML, 1) \
@ -1424,6 +1451,7 @@ XR_ENUM_STR(XrResult);
_(XR_COMPOSITION_LAYER_CORRECT_CHROMATIC_ABERRATION_BIT, 0x00000001) \
_(XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT, 0x00000002) \
_(XR_COMPOSITION_LAYER_UNPREMULTIPLIED_ALPHA_BIT, 0x00000004) \
_(XR_COMPOSITION_LAYER_INVERTED_ALPHA_BIT_EXT, 0x00000008) \
#define XR_LIST_BITS_XrViewStateFlags(_) \
_(XR_VIEW_STATE_ORIENTATION_VALID_BIT, 0x00000001) \
@ -1573,6 +1601,10 @@ XR_ENUM_STR(XrResult);
_(XR_PERFORMANCE_METRICS_COUNTER_UINT_VALUE_VALID_BIT_META, 0x00000002) \
_(XR_PERFORMANCE_METRICS_COUNTER_FLOAT_VALUE_VALID_BIT_META, 0x00000004) \
#define XR_LIST_BITS_XrEnvironmentDepthProviderCreateFlagsMETA(_)
#define XR_LIST_BITS_XrEnvironmentDepthSwapchainCreateFlagsMETA(_)
#define XR_LIST_BITS_XrFoveationDynamicFlagsHTC(_) \
_(XR_FOVEATION_DYNAMIC_LEVEL_ENABLED_BIT_HTC, 0x00000001) \
_(XR_FOVEATION_DYNAMIC_CLEAR_FOV_ENABLED_BIT_HTC, 0x00000002) \
@ -2152,6 +2184,73 @@ XR_ENUM_STR(XrResult);
_(getInstanceProcAddr) \
_(createApiLayerInstance) \
/// Calls your macro with the name of each member of XrColor3f, in order.
#define XR_LIST_STRUCT_XrColor3f(_) \
_(r) \
_(g) \
_(b) \
/// Calls your macro with the name of each member of XrExtent3Df, in order.
#define XR_LIST_STRUCT_XrExtent3Df(_) \
_(width) \
_(height) \
_(depth) \
/// Calls your macro with the name of each member of XrSpheref, in order.
#define XR_LIST_STRUCT_XrSpheref(_) \
_(center) \
_(radius) \
/// Calls your macro with the name of each member of XrBoxf, in order.
#define XR_LIST_STRUCT_XrBoxf(_) \
_(center) \
_(extents) \
/// Calls your macro with the name of each member of XrFrustumf, in order.
#define XR_LIST_STRUCT_XrFrustumf(_) \
_(pose) \
_(fov) \
_(nearZ) \
_(farZ) \
/// Calls your macro with the name of each member of XrUuid, in order.
#define XR_LIST_STRUCT_XrUuid(_) \
_(data) \
/// Calls your macro with the name of each member of XrSpacesLocateInfo, in order.
#define XR_LIST_STRUCT_XrSpacesLocateInfo(_) \
_(type) \
_(next) \
_(baseSpace) \
_(time) \
_(spaceCount) \
_(spaces) \
/// Calls your macro with the name of each member of XrSpaceLocationData, in order.
#define XR_LIST_STRUCT_XrSpaceLocationData(_) \
_(locationFlags) \
_(pose) \
/// Calls your macro with the name of each member of XrSpaceLocations, in order.
#define XR_LIST_STRUCT_XrSpaceLocations(_) \
_(type) \
_(next) \
_(locationCount) \
_(locations) \
/// Calls your macro with the name of each member of XrSpaceVelocityData, in order.
#define XR_LIST_STRUCT_XrSpaceVelocityData(_) \
_(velocityFlags) \
_(linearVelocity) \
_(angularVelocity) \
/// Calls your macro with the name of each member of XrSpaceVelocities, in order.
#define XR_LIST_STRUCT_XrSpaceVelocities(_) \
_(type) \
_(next) \
_(velocityCount) \
_(velocities) \
/// Calls your macro with the name of each member of XrCompositionLayerCubeKHR, in order.
#define XR_LIST_STRUCT_XrCompositionLayerCubeKHR(_) \
_(type) \
@ -3231,10 +3330,6 @@ XR_ENUM_STR(XrResult);
_(enabled) \
_(changePending) \
/// Calls your macro with the name of each member of XrUuidEXT, in order.
#define XR_LIST_STRUCT_XrUuidEXT(_) \
_(data) \
/// Calls your macro with the name of each member of XrEventDataSpatialAnchorCreateCompleteFB, in order.
#define XR_LIST_STRUCT_XrEventDataSpatialAnchorCreateCompleteFB(_) \
_(type) \
@ -3857,12 +3952,6 @@ XR_ENUM_STR(XrResult);
_(amplitudeCount) \
_(amplitudes) \
/// Calls your macro with the name of each member of XrExtent3DfFB, in order.
#define XR_LIST_STRUCT_XrExtent3DfFB(_) \
_(width) \
_(height) \
_(depth) \
/// Calls your macro with the name of each member of XrOffset3DfFB, in order.
#define XR_LIST_STRUCT_XrOffset3DfFB(_) \
_(x) \
@ -4348,6 +4437,61 @@ XR_ENUM_STR(XrResult);
_(dataSource) \
_(time) \
/// Calls your macro with the name of each member of XrEnvironmentDepthProviderCreateInfoMETA, in order.
#define XR_LIST_STRUCT_XrEnvironmentDepthProviderCreateInfoMETA(_) \
_(type) \
_(next) \
_(createFlags) \
/// Calls your macro with the name of each member of XrEnvironmentDepthSwapchainCreateInfoMETA, in order.
#define XR_LIST_STRUCT_XrEnvironmentDepthSwapchainCreateInfoMETA(_) \
_(type) \
_(next) \
_(createFlags) \
/// Calls your macro with the name of each member of XrEnvironmentDepthSwapchainStateMETA, in order.
#define XR_LIST_STRUCT_XrEnvironmentDepthSwapchainStateMETA(_) \
_(type) \
_(next) \
_(width) \
_(height) \
/// Calls your macro with the name of each member of XrEnvironmentDepthImageAcquireInfoMETA, in order.
#define XR_LIST_STRUCT_XrEnvironmentDepthImageAcquireInfoMETA(_) \
_(type) \
_(next) \
_(space) \
_(displayTime) \
/// Calls your macro with the name of each member of XrEnvironmentDepthImageViewMETA, in order.
#define XR_LIST_STRUCT_XrEnvironmentDepthImageViewMETA(_) \
_(type) \
_(next) \
_(fov) \
_(pose) \
/// Calls your macro with the name of each member of XrEnvironmentDepthImageMETA, in order.
#define XR_LIST_STRUCT_XrEnvironmentDepthImageMETA(_) \
_(type) \
_(next) \
_(swapchainIndex) \
_(nearZ) \
_(farZ) \
_(views) \
/// Calls your macro with the name of each member of XrEnvironmentDepthHandRemovalSetInfoMETA, in order.
#define XR_LIST_STRUCT_XrEnvironmentDepthHandRemovalSetInfoMETA(_) \
_(type) \
_(next) \
_(enabled) \
/// Calls your macro with the name of each member of XrSystemEnvironmentDepthPropertiesMETA, in order.
#define XR_LIST_STRUCT_XrSystemEnvironmentDepthPropertiesMETA(_) \
_(type) \
_(next) \
_(supportsEnvironmentDepth) \
_(supportsHandRemoval) \
/// Calls your macro with the name of each member of XrPassthroughCreateInfoHTC, in order.
#define XR_LIST_STRUCT_XrPassthroughCreateInfoHTC(_) \
_(type) \
@ -4483,12 +4627,6 @@ XR_ENUM_STR(XrResult);
_(next) \
_(flags) \
/// Calls your macro with the name of each member of XrExtent3DfEXT, in order.
#define XR_LIST_STRUCT_XrExtent3DfEXT(_) \
_(width) \
_(height) \
_(depth) \
/// Calls your macro with the name of each member of XrPlaneDetectorBeginInfoEXT, in order.
#define XR_LIST_STRUCT_XrPlaneDetectorBeginInfoEXT(_) \
_(type) \
@ -4539,6 +4677,36 @@ XR_ENUM_STR(XrResult);
_(vertexCountOutput) \
_(vertices) \
/// Calls your macro with the name of each member of XrFutureCancelInfoEXT, in order.
#define XR_LIST_STRUCT_XrFutureCancelInfoEXT(_) \
_(type) \
_(next) \
_(future) \
/// Calls your macro with the name of each member of XrFuturePollInfoEXT, in order.
#define XR_LIST_STRUCT_XrFuturePollInfoEXT(_) \
_(type) \
_(next) \
_(future) \
/// Calls your macro with the name of each member of XrFutureCompletionBaseHeaderEXT, in order.
#define XR_LIST_STRUCT_XrFutureCompletionBaseHeaderEXT(_) \
_(type) \
_(next) \
_(futureResult) \
/// Calls your macro with the name of each member of XrFutureCompletionEXT, in order.
#define XR_LIST_STRUCT_XrFutureCompletionEXT(_) \
_(type) \
_(next) \
_(futureResult) \
/// Calls your macro with the name of each member of XrFuturePollResultEXT, in order.
#define XR_LIST_STRUCT_XrFuturePollResultEXT(_) \
_(type) \
_(next) \
_(state) \
/// Calls your macro with the name of each member of XrEventDataUserPresenceChangedEXT, in order.
#define XR_LIST_STRUCT_XrEventDataUserPresenceChangedEXT(_) \
_(type) \
@ -4644,6 +4812,9 @@ XR_ENUM_STR(XrResult);
_(XrEventDataReferenceSpaceChangePending, XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING) \
_(XrEventDataInteractionProfileChanged, XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED) \
_(XrHapticVibration, XR_TYPE_HAPTIC_VIBRATION) \
_(XrSpacesLocateInfo, XR_TYPE_SPACES_LOCATE_INFO) \
_(XrSpaceLocations, XR_TYPE_SPACE_LOCATIONS) \
_(XrSpaceVelocities, XR_TYPE_SPACE_VELOCITIES) \
_(XrCompositionLayerCubeKHR, XR_TYPE_COMPOSITION_LAYER_CUBE_KHR) \
_(XrCompositionLayerDepthInfoKHR, XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR) \
_(XrCompositionLayerCylinderKHR, XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR) \
@ -4873,6 +5044,14 @@ XR_ENUM_STR(XrResult);
_(XrFaceTrackerCreateInfo2FB, XR_TYPE_FACE_TRACKER_CREATE_INFO2_FB) \
_(XrFaceExpressionInfo2FB, XR_TYPE_FACE_EXPRESSION_INFO2_FB) \
_(XrFaceExpressionWeights2FB, XR_TYPE_FACE_EXPRESSION_WEIGHTS2_FB) \
_(XrEnvironmentDepthProviderCreateInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_PROVIDER_CREATE_INFO_META) \
_(XrEnvironmentDepthSwapchainCreateInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_SWAPCHAIN_CREATE_INFO_META) \
_(XrEnvironmentDepthSwapchainStateMETA, XR_TYPE_ENVIRONMENT_DEPTH_SWAPCHAIN_STATE_META) \
_(XrEnvironmentDepthImageAcquireInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_ACQUIRE_INFO_META) \
_(XrEnvironmentDepthImageViewMETA, XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_VIEW_META) \
_(XrEnvironmentDepthImageMETA, XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_META) \
_(XrEnvironmentDepthHandRemovalSetInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_HAND_REMOVAL_SET_INFO_META) \
_(XrSystemEnvironmentDepthPropertiesMETA, XR_TYPE_SYSTEM_ENVIRONMENT_DEPTH_PROPERTIES_META) \
_(XrPassthroughCreateInfoHTC, XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC) \
_(XrPassthroughColorHTC, XR_TYPE_PASSTHROUGH_COLOR_HTC) \
_(XrPassthroughMeshTransformInfoHTC, XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC) \
@ -4894,6 +5073,10 @@ XR_ENUM_STR(XrResult);
_(XrPlaneDetectorLocationEXT, XR_TYPE_PLANE_DETECTOR_LOCATION_EXT) \
_(XrPlaneDetectorLocationsEXT, XR_TYPE_PLANE_DETECTOR_LOCATIONS_EXT) \
_(XrPlaneDetectorPolygonBufferEXT, XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT) \
_(XrFutureCancelInfoEXT, XR_TYPE_FUTURE_CANCEL_INFO_EXT) \
_(XrFuturePollInfoEXT, XR_TYPE_FUTURE_POLL_INFO_EXT) \
_(XrFutureCompletionEXT, XR_TYPE_FUTURE_COMPLETION_EXT) \
_(XrFuturePollResultEXT, XR_TYPE_FUTURE_POLL_RESULT_EXT) \
_(XrEventDataUserPresenceChangedEXT, XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT) \
_(XrSystemUserPresencePropertiesEXT, XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT) \
_(XrEventDataHeadsetFitChangedML, XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML) \
@ -5200,6 +5383,7 @@ XR_ENUM_STR(XrResult);
_(XR_META_automatic_layer_filter, 272) \
_(XR_META_touch_controller_plus, 280) \
_(XR_FB_face_tracking2, 288) \
_(XR_META_environment_depth, 292) \
_(XR_EXT_uuid, 300) \
_(XR_EXT_hand_interaction, 303) \
_(XR_QCOM_tracking_optimization_settings, 307) \
@ -5213,9 +5397,13 @@ XR_ENUM_STR(XrResult);
_(XR_EXT_hand_tracking_data_source, 429) \
_(XR_EXT_plane_detection, 430) \
_(XR_OPPO_controller_interaction, 454) \
_(XR_EXT_future, 470) \
_(XR_EXT_user_presence, 471) \
_(XR_KHR_locate_spaces, 472) \
_(XR_ML_user_calibration, 473) \
_(XR_YVR_controller_interaction, 498) \
_(XR_EXT_composition_layer_inverted_alpha, 555) \
_(XR_KHR_maintenance1, 711) \
@ -5291,6 +5479,14 @@ XR_ENUM_STR(XrResult);
_(NegotiateLoaderApiLayerInterface, LOADER_VERSION_1_0) \
/// For every function defined by XR_VERSION_1_1 in this version of the spec,
/// calls your macro with the function name and extension name.
/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
/// because it is easy to add back but impossible to remove with the preprocessor.
#define XR_LIST_FUNCTIONS_XR_VERSION_1_1(_) \
_(LocateSpaces, VERSION_1_1) \
/// For every function defined by XR_KHR_android_thread_settings in this version of the spec,
/// calls your macro with the function name and extension name.
/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
@ -5973,6 +6169,23 @@ XR_ENUM_STR(XrResult);
_(GetFaceExpressionWeights2FB, FB_face_tracking2) \
/// For every function defined by XR_META_environment_depth in this version of the spec,
/// calls your macro with the function name and extension name.
/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
/// because it is easy to add back but impossible to remove with the preprocessor.
#define XR_LIST_FUNCTIONS_XR_META_environment_depth(_) \
_(CreateEnvironmentDepthProviderMETA, META_environment_depth) \
_(DestroyEnvironmentDepthProviderMETA, META_environment_depth) \
_(StartEnvironmentDepthProviderMETA, META_environment_depth) \
_(StopEnvironmentDepthProviderMETA, META_environment_depth) \
_(CreateEnvironmentDepthSwapchainMETA, META_environment_depth) \
_(DestroyEnvironmentDepthSwapchainMETA, META_environment_depth) \
_(EnumerateEnvironmentDepthSwapchainImagesMETA, META_environment_depth) \
_(GetEnvironmentDepthSwapchainStateMETA, META_environment_depth) \
_(AcquireEnvironmentDepthImageMETA, META_environment_depth) \
_(SetEnvironmentDepthHandRemovalMETA, META_environment_depth) \
/// For every function defined by XR_QCOM_tracking_optimization_settings in this version of the spec,
/// calls your macro with the function name and extension name.
/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
@ -6028,6 +6241,15 @@ XR_ENUM_STR(XrResult);
_(GetPlanePolygonBufferEXT, EXT_plane_detection) \
/// For every function defined by XR_EXT_future in this version of the spec,
/// calls your macro with the function name and extension name.
/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,
/// because it is easy to add back but impossible to remove with the preprocessor.
#define XR_LIST_FUNCTIONS_XR_EXT_future(_) \
_(PollFutureEXT, EXT_future) \
_(CancelFutureEXT, EXT_future) \
/// For every function defined by XR_ML_user_calibration in this version of the spec,
/// calls your macro with the function name and extension name.
/// Trims the leading `xr` from the function name and the leading `XR_` from the feature name,

View file

@ -32,6 +32,7 @@ This file contains expansion macros (X Macros) for OpenXR structures that have a
_avail(XrCompositionLayerCylinderKHR, XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR) \
_avail(XrCompositionLayerEquirectKHR, XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR) \
_avail(XrCompositionLayerEquirect2KHR, XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR) \
_avail(XrCompositionLayerPassthroughFB, XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_FB) \
_avail(XrCompositionLayerPassthroughHTC, XR_TYPE_COMPOSITION_LAYER_PASSTHROUGH_HTC) \
@ -264,5 +265,18 @@ This file contains expansion macros (X Macros) for OpenXR structures that have a
/// Like XR_LIST_ALL_STRUCTURE_TYPES, but only includes types whose parent struct type is XrFutureCompletionBaseHeaderEXT
#define XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrFutureCompletionBaseHeaderEXT(_avail, _unavail) \
_impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrFutureCompletionBaseHeaderEXT_CORE(_avail, _unavail) \
// Implementation detail of XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrFutureCompletionBaseHeaderEXT()
#define _impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrFutureCompletionBaseHeaderEXT_CORE(_avail, _unavail) \
_avail(XrFutureCompletionEXT, XR_TYPE_FUTURE_COMPLETION_EXT) \
#endif

View file

@ -92,6 +92,9 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrEventDataReferenceSpaceChangePending, XR_TYPE_EVENT_DATA_REFERENCE_SPACE_CHANGE_PENDING) \
_avail(XrEventDataInteractionProfileChanged, XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED) \
_avail(XrHapticVibration, XR_TYPE_HAPTIC_VIBRATION) \
_avail(XrSpacesLocateInfo, XR_TYPE_SPACES_LOCATE_INFO) \
_avail(XrSpaceLocations, XR_TYPE_SPACE_LOCATIONS) \
_avail(XrSpaceVelocities, XR_TYPE_SPACE_VELOCITIES) \
_avail(XrCompositionLayerCubeKHR, XR_TYPE_COMPOSITION_LAYER_CUBE_KHR) \
_avail(XrCompositionLayerDepthInfoKHR, XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR) \
_avail(XrCompositionLayerCylinderKHR, XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR) \
@ -321,6 +324,14 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrFaceTrackerCreateInfo2FB, XR_TYPE_FACE_TRACKER_CREATE_INFO2_FB) \
_avail(XrFaceExpressionInfo2FB, XR_TYPE_FACE_EXPRESSION_INFO2_FB) \
_avail(XrFaceExpressionWeights2FB, XR_TYPE_FACE_EXPRESSION_WEIGHTS2_FB) \
_avail(XrEnvironmentDepthProviderCreateInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_PROVIDER_CREATE_INFO_META) \
_avail(XrEnvironmentDepthSwapchainCreateInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_SWAPCHAIN_CREATE_INFO_META) \
_avail(XrEnvironmentDepthSwapchainStateMETA, XR_TYPE_ENVIRONMENT_DEPTH_SWAPCHAIN_STATE_META) \
_avail(XrEnvironmentDepthImageAcquireInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_ACQUIRE_INFO_META) \
_avail(XrEnvironmentDepthImageViewMETA, XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_VIEW_META) \
_avail(XrEnvironmentDepthImageMETA, XR_TYPE_ENVIRONMENT_DEPTH_IMAGE_META) \
_avail(XrEnvironmentDepthHandRemovalSetInfoMETA, XR_TYPE_ENVIRONMENT_DEPTH_HAND_REMOVAL_SET_INFO_META) \
_avail(XrSystemEnvironmentDepthPropertiesMETA, XR_TYPE_SYSTEM_ENVIRONMENT_DEPTH_PROPERTIES_META) \
_avail(XrPassthroughCreateInfoHTC, XR_TYPE_PASSTHROUGH_CREATE_INFO_HTC) \
_avail(XrPassthroughColorHTC, XR_TYPE_PASSTHROUGH_COLOR_HTC) \
_avail(XrPassthroughMeshTransformInfoHTC, XR_TYPE_PASSTHROUGH_MESH_TRANSFORM_INFO_HTC) \
@ -342,6 +353,10 @@ This file contains expansion macros (X Macros) for OpenXR structures.
_avail(XrPlaneDetectorLocationEXT, XR_TYPE_PLANE_DETECTOR_LOCATION_EXT) \
_avail(XrPlaneDetectorLocationsEXT, XR_TYPE_PLANE_DETECTOR_LOCATIONS_EXT) \
_avail(XrPlaneDetectorPolygonBufferEXT, XR_TYPE_PLANE_DETECTOR_POLYGON_BUFFER_EXT) \
_avail(XrFutureCancelInfoEXT, XR_TYPE_FUTURE_CANCEL_INFO_EXT) \
_avail(XrFuturePollInfoEXT, XR_TYPE_FUTURE_POLL_INFO_EXT) \
_avail(XrFutureCompletionEXT, XR_TYPE_FUTURE_COMPLETION_EXT) \
_avail(XrFuturePollResultEXT, XR_TYPE_FUTURE_POLL_RESULT_EXT) \
_avail(XrEventDataUserPresenceChangedEXT, XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT) \
_avail(XrSystemUserPresencePropertiesEXT, XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT) \
_avail(XrEventDataHeadsetFitChangedML, XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML) \

View file

@ -47,7 +47,7 @@
#define XR_ARCH_ABI "aarch64"
#elif (defined(__ARM_ARCH) && __ARM_ARCH >= 7 && (defined(__ARM_PCS_VFP) || defined(__ANDROID__))) || defined(_M_ARM)
#define XR_ARCH_ABI "armv7a-vfp"
#elif defined(__ARM_ARCH_5TE__)
#elif defined(__ARM_ARCH_5TE__) || (defined(__ARM_ARCH) && __ARM_ARCH > 5)
#define XR_ARCH_ABI "armv5te"
#elif defined(__mips64)
#define XR_ARCH_ABI "mips64"
@ -91,8 +91,6 @@ namespace detail {
static inline char* ImplGetEnv(const char* name) { return getenv(name); }
static inline int ImplSetEnv(const char* name, const char* value, int overwrite) { return setenv(name, value, overwrite); }
static inline char* ImplGetSecureEnv(const char* name) {
#ifdef HAVE_SECURE_GETENV
return secure_getenv(name);
@ -162,12 +160,6 @@ static inline std::string PlatformUtilsGetSecureEnv(const char* name) {
static inline bool PlatformUtilsGetEnvSet(const char* name) { return detail::ImplGetEnv(name) != nullptr; }
static inline bool PlatformUtilsSetEnv(const char* name, const char* value) {
const int shouldOverwrite = 1;
int result = detail::ImplSetEnv(name, value, shouldOverwrite);
return (result == 0);
}
#elif defined(XR_OS_APPLE)
static inline std::string PlatformUtilsGetEnv(const char* name) {
@ -188,12 +180,6 @@ static inline std::string PlatformUtilsGetSecureEnv(const char* name) {
static inline bool PlatformUtilsGetEnvSet(const char* name) { return detail::ImplGetEnv(name) != nullptr; }
static inline bool PlatformUtilsSetEnv(const char* name, const char* value) {
const int shouldOverwrite = 1;
int result = detail::ImplSetEnv(name, value, shouldOverwrite);
return (result == 0);
}
static inline bool PlatformGetGlobalRuntimeFileName(uint16_t major_version, std::string& file_name) {
return detail::ImplTryRuntimeFilename("/usr/local/share/openxr/", major_version, file_name);
}
@ -337,19 +323,10 @@ static inline std::string PlatformUtilsGetSecureEnv(const char* name) {
return envValue;
}
// Sets an environment variable via UTF8 strings.
// The name is case-sensitive.
// Overwrites the variable if it already exists.
// Returns true if it could be set.
static inline bool PlatformUtilsSetEnv(const char* name, const char* value) {
const std::wstring wname = utf8_to_wide(name);
const std::wstring wvalue = utf8_to_wide(value);
BOOL result = ::SetEnvironmentVariableW(wname.c_str(), wvalue.c_str());
return (result != 0);
}
#elif defined(XR_OS_ANDROID)
#include <sys/system_properties.h>
static inline bool PlatformUtilsGetEnvSet(const char* /* name */) {
// Stub func
return false;
@ -365,11 +342,6 @@ static inline std::string PlatformUtilsGetSecureEnv(const char* /* name */) {
return {};
}
static inline bool PlatformUtilsSetEnv(const char* /* name */, const char* /* value */) {
// Stub func
return false;
}
// Intended to be only used as a fallback on Android, with a more open, "native" technique used in most cases
static inline bool PlatformGetGlobalRuntimeFileName(uint16_t major_version, std::string& file_name) {
// Prefix for the runtime JSON file name
@ -385,6 +357,37 @@ static inline bool PlatformGetGlobalRuntimeFileName(uint16_t major_version, std:
return false;
}
// Android system properties are sufficiently different from environment variables that we are not re-using
// PlatformUtilsGetEnv for this purpose
static inline std::string PlatformUtilsGetAndroidSystemProperty(const char* name) {
std::string result;
const prop_info* pi = __system_property_find(name);
if (pi == nullptr) {
return {};
}
#if __ANDROID_API__ >= 26
// use callback to retrieve > 92 character sys prop values, if available
__system_property_read_callback(
pi,
[](void* cookie, const char*, const char* value, uint32_t) {
auto property_value = reinterpret_cast<std::string*>(cookie);
*property_value = value;
},
reinterpret_cast<void*>(&result));
#endif // __ANDROID_API__ >= 26
// fallback to __system_property_get if no value retrieved via callback
if (result.empty()) {
char value[PROP_VALUE_MAX] = {};
if (__system_property_get(name, value) != 0) {
result = value;
}
}
return result;
}
#else // Not Linux, Apple, nor Windows
static inline bool PlatformUtilsGetEnvSet(const char* /* name */) {
@ -402,11 +405,6 @@ static inline std::string PlatformUtilsGetSecureEnv(const char* /* name */) {
return {};
}
static inline bool PlatformUtilsSetEnv(const char* /* name */, const char* /* value */) {
// Stub func
return false;
}
static inline bool PlatformGetGlobalRuntimeFileName(uint16_t /* major_version */, std::string const& /* file_name */) {
// Stub func
return false;