From e0478fe3a3d3a28330e051bd065776e13efb4691 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Fri, 27 Sep 2024 14:34:43 +1000 Subject: [PATCH] Update thirdparty OpenXR to 1.1.41 --- thirdparty/README.md | 2 +- thirdparty/openxr/COPYING.adoc | 4 +- thirdparty/openxr/include/openxr/openxr.h | 644 +++++++++++++++++- .../openxr/include/openxr/openxr_platform.h | 37 + .../openxr/include/openxr/openxr_reflection.h | 549 +++++++++++++++ .../openxr/openxr_reflection_parent_structs.h | 60 +- .../openxr/openxr_reflection_structs.h | 49 ++ .../openxr/src/common/platform_utils.hpp | 5 +- thirdparty/openxr/src/common/xr_linear.h | 2 +- .../openxr/src/loader/android_utilities.cpp | 50 +- thirdparty/openxr/src/loader/loader_core.cpp | 16 +- .../openxr/src/loader/loader_instance.cpp | 4 +- .../openxr/src/loader/loader_instance.hpp | 6 +- .../openxr/src/loader/manifest_file.cpp | 27 +- .../openxr/src/loader/runtime_interface.cpp | 14 +- .../openxr/src/loader/runtime_interface.hpp | 8 +- .../openxr/src/loader/xr_generated_loader.cpp | 13 + .../openxr/src/loader/xr_generated_loader.hpp | 4 + .../src/xr_generated_dispatch_table_core.c | 5 +- .../src/xr_generated_dispatch_table_core.h | 7 +- 20 files changed, 1435 insertions(+), 71 deletions(-) diff --git a/thirdparty/README.md b/thirdparty/README.md index 4c47b91c8cd..b3de2564053 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -757,7 +757,7 @@ with the provided patch. ## openxr - Upstream: https://github.com/KhronosGroup/OpenXR-SDK -- Version: 1.1.38 (f90488c4fb1537f4256d09d4a4d3ad5543ebaf24, 2024) +- Version: 1.1.41 (7d1c0961351bac61fd7bb72d402649d5ac3f2935, 2024) - License: Apache 2.0 Files extracted from upstream source: diff --git a/thirdparty/openxr/COPYING.adoc b/thirdparty/openxr/COPYING.adoc index 18c85fa6c7e..d700a19d7b4 100644 --- a/thirdparty/openxr/COPYING.adoc +++ b/thirdparty/openxr/COPYING.adoc @@ -6,7 +6,7 @@ This document is shared across a number of OpenXR GitHub projects, as the set of files in those projects is partially overlapping. -(There is a single "source of truth" internal Khronos GitLab repo these +(There is a single "source of truth" internal Khronos GitLab monorepo these GitHub repositories interact with.) == Licenses @@ -17,7 +17,7 @@ https://reuse.software/spec/[REUSE 3.0 specification] with clear copyright holders and license identifier listed for each file, preferably in each file. Where this is not possible, or e.g. when we are using files unmodified from -other open-source projects, license data is listed: +other open source projects, license data is listed: * in an adjacent file of the same name, with the additional extension "`.license`" diff --git a/thirdparty/openxr/include/openxr/openxr.h b/thirdparty/openxr/include/openxr/openxr.h index 9ac66d8c690..f094b0f72b3 100644 --- a/thirdparty/openxr/include/openxr/openxr.h +++ b/thirdparty/openxr/include/openxr/openxr.h @@ -26,7 +26,7 @@ extern "C" { ((((major) & 0xffffULL) << 48) | (((minor) & 0xffffULL) << 32) | ((patch) & 0xffffffffULL)) // OpenXR current version number. -#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 1, 38) +#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 1, 41) // OpenXR 1.0 version number #define XR_API_VERSION_1_0 XR_MAKE_VERSION(1, 0, XR_VERSION_PATCH(XR_CURRENT_API_VERSION)) @@ -242,6 +242,11 @@ typedef enum XrResult { XR_ERROR_LOCALIZATION_MAP_PERMISSION_DENIED_ML = -1000139004, XR_ERROR_LOCALIZATION_MAP_ALREADY_EXISTS_ML = -1000139005, XR_ERROR_LOCALIZATION_MAP_CANNOT_EXPORT_CLOUD_MAP_ML = -1000139006, + XR_ERROR_SPATIAL_ANCHORS_PERMISSION_DENIED_ML = -1000140000, + XR_ERROR_SPATIAL_ANCHORS_NOT_LOCALIZED_ML = -1000140001, + XR_ERROR_SPATIAL_ANCHORS_OUT_OF_MAP_BOUNDS_ML = -1000140002, + XR_ERROR_SPATIAL_ANCHORS_SPACE_NOT_LOCATABLE_ML = -1000140003, + XR_ERROR_SPATIAL_ANCHORS_ANCHOR_NOT_FOUND_ML = -1000141000, XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT = -1000142001, XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFT = -1000142002, XR_SCENE_MARKER_DATA_NOT_STRING_MSFT = 1000147000, @@ -258,6 +263,10 @@ typedef enum XrResult { XR_ERROR_PLANE_DETECTION_PERMISSION_DENIED_EXT = -1000429001, XR_ERROR_FUTURE_PENDING_EXT = -1000469001, XR_ERROR_FUTURE_INVALID_EXT = -1000469002, + XR_ERROR_SYSTEM_NOTIFICATION_PERMISSION_DENIED_ML = -1000473000, + XR_ERROR_SYSTEM_NOTIFICATION_INCOMPATIBLE_SKU_ML = -1000473001, + XR_ERROR_WORLD_MESH_DETECTOR_PERMISSION_DENIED_ML = -1000474000, + XR_ERROR_WORLD_MESH_DETECTOR_SPACE_NOT_LOCATABLE_ML = -1000474001, XR_ERROR_EXTENSION_DEPENDENCY_NOT_ENABLED_KHR = XR_ERROR_EXTENSION_DEPENDENCY_NOT_ENABLED, XR_ERROR_PERMISSION_INSUFFICIENT_KHR = XR_ERROR_PERMISSION_INSUFFICIENT, XR_RESULT_MAX_ENUM = 0x7FFFFFFF @@ -346,6 +355,9 @@ typedef enum XrStructureType { XR_TYPE_GRAPHICS_BINDING_D3D12_KHR = 1000028000, XR_TYPE_SWAPCHAIN_IMAGE_D3D12_KHR = 1000028001, XR_TYPE_GRAPHICS_REQUIREMENTS_D3D12_KHR = 1000028002, + XR_TYPE_GRAPHICS_BINDING_METAL_KHR = 1000029000, + XR_TYPE_SWAPCHAIN_IMAGE_METAL_KHR = 1000029001, + XR_TYPE_GRAPHICS_REQUIREMENTS_METAL_KHR = 1000029002, XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT = 1000030000, XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT = 1000030001, XR_TYPE_VISIBILITY_MASK_KHR = 1000031000, @@ -492,6 +504,22 @@ typedef enum XrStructureType { XR_TYPE_MAP_LOCALIZATION_REQUEST_INFO_ML = 1000139002, XR_TYPE_LOCALIZATION_MAP_IMPORT_INFO_ML = 1000139003, XR_TYPE_LOCALIZATION_ENABLE_EVENTS_INFO_ML = 1000139004, + XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_POSE_ML = 1000140000, + XR_TYPE_CREATE_SPATIAL_ANCHORS_COMPLETION_ML = 1000140001, + XR_TYPE_SPATIAL_ANCHOR_STATE_ML = 1000140002, + XR_TYPE_SPATIAL_ANCHORS_CREATE_STORAGE_INFO_ML = 1000141000, + XR_TYPE_SPATIAL_ANCHORS_QUERY_INFO_RADIUS_ML = 1000141001, + XR_TYPE_SPATIAL_ANCHORS_QUERY_COMPLETION_ML = 1000141002, + XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_UUIDS_ML = 1000141003, + XR_TYPE_SPATIAL_ANCHORS_PUBLISH_INFO_ML = 1000141004, + XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_ML = 1000141005, + XR_TYPE_SPATIAL_ANCHORS_DELETE_INFO_ML = 1000141006, + XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_ML = 1000141007, + XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_INFO_ML = 1000141008, + XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_ML = 1000141009, + XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_DETAILS_ML = 1000141010, + XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_DETAILS_ML = 1000141011, + XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_DETAILS_ML = 1000141012, XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML = 1000472000, XR_TYPE_EVENT_DATA_EYE_CALIBRATION_CHANGED_ML = 1000472001, XR_TYPE_USER_CALIBRATION_ENABLE_EVENTS_INFO_ML = 1000472002, @@ -599,6 +627,11 @@ typedef enum XrStructureType { XR_TYPE_FOVEATION_CUSTOM_MODE_INFO_HTC = 1000318002, XR_TYPE_SYSTEM_ANCHOR_PROPERTIES_HTC = 1000319000, XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_HTC = 1000319001, + XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_HTC = 1000320000, + XR_TYPE_BODY_TRACKER_CREATE_INFO_HTC = 1000320001, + XR_TYPE_BODY_JOINTS_LOCATE_INFO_HTC = 1000320002, + XR_TYPE_BODY_JOINT_LOCATIONS_HTC = 1000320003, + XR_TYPE_BODY_SKELETON_HTC = 1000320004, XR_TYPE_ACTIVE_ACTION_SET_PRIORITIES_EXT = 1000373000, XR_TYPE_SYSTEM_FORCE_FEEDBACK_CURL_PROPERTIES_MNDX = 1000375000, XR_TYPE_FORCE_FEEDBACK_CURL_APPLY_LOCATIONS_MNDX = 1000375001, @@ -617,6 +650,19 @@ typedef enum XrStructureType { 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_TYPE_SYSTEM_NOTIFICATIONS_SET_INFO_ML = 1000473000, + XR_TYPE_WORLD_MESH_DETECTOR_CREATE_INFO_ML = 1000474001, + XR_TYPE_WORLD_MESH_STATE_REQUEST_INFO_ML = 1000474002, + XR_TYPE_WORLD_MESH_BLOCK_STATE_ML = 1000474003, + XR_TYPE_WORLD_MESH_STATE_REQUEST_COMPLETION_ML = 1000474004, + XR_TYPE_WORLD_MESH_BUFFER_RECOMMENDED_SIZE_INFO_ML = 1000474005, + XR_TYPE_WORLD_MESH_BUFFER_SIZE_ML = 1000474006, + XR_TYPE_WORLD_MESH_BUFFER_ML = 1000474007, + XR_TYPE_WORLD_MESH_BLOCK_REQUEST_ML = 1000474008, + XR_TYPE_WORLD_MESH_GET_INFO_ML = 1000474009, + XR_TYPE_WORLD_MESH_BLOCK_ML = 1000474010, + XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_ML = 1000474011, + XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_INFO_ML = 1000474012, XR_TYPE_GRAPHICS_BINDING_VULKAN2_KHR = XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR, XR_TYPE_SWAPCHAIN_IMAGE_VULKAN2_KHR = XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR, XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN2_KHR = XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR, @@ -713,6 +759,7 @@ typedef enum XrObjectType { XR_OBJECT_TYPE_GEOMETRY_INSTANCE_FB = 1000118004, XR_OBJECT_TYPE_MARKER_DETECTOR_ML = 1000138000, XR_OBJECT_TYPE_EXPORTED_LOCALIZATION_MAP_ML = 1000139000, + XR_OBJECT_TYPE_SPATIAL_ANCHORS_STORAGE_ML = 1000141000, XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFT = 1000142000, XR_OBJECT_TYPE_FACE_TRACKER_FB = 1000201000, XR_OBJECT_TYPE_EYE_TRACKER_FB = 1000202000, @@ -723,7 +770,9 @@ typedef enum XrObjectType { 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_BODY_TRACKER_HTC = 1000320000, XR_OBJECT_TYPE_PLANE_DETECTOR_EXT = 1000429000, + XR_OBJECT_TYPE_WORLD_MESH_DETECTOR_ML = 1000474000, XR_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF } XrObjectType; typedef XrFlags64 XrInstanceCreateFlags; @@ -2184,7 +2233,7 @@ typedef struct XrEventDataMainSessionVisibilityChangedEXTX { // XR_VARJO_quad_views is a preprocessor guard. Do not pass it to API calls. #define XR_VARJO_quad_views 1 -#define XR_VARJO_quad_views_SPEC_VERSION 1 +#define XR_VARJO_quad_views_SPEC_VERSION 2 #define XR_VARJO_QUAD_VIEWS_EXTENSION_NAME "XR_VARJO_quad_views" @@ -4982,6 +5031,245 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetExportedLocalizationMapDataML( #endif /* !XR_NO_PROTOTYPES */ +// XR_ML_spatial_anchors is a preprocessor guard. Do not pass it to API calls. +#define XR_ML_spatial_anchors 1 +XR_DEFINE_OPAQUE_64(XrFutureEXT) +#define XR_ML_spatial_anchors_SPEC_VERSION 1 +#define XR_ML_SPATIAL_ANCHORS_EXTENSION_NAME "XR_ML_spatial_anchors" + +typedef enum XrSpatialAnchorConfidenceML { + XR_SPATIAL_ANCHOR_CONFIDENCE_LOW_ML = 0, + XR_SPATIAL_ANCHOR_CONFIDENCE_MEDIUM_ML = 1, + XR_SPATIAL_ANCHOR_CONFIDENCE_HIGH_ML = 2, + XR_SPATIAL_ANCHOR_CONFIDENCE_MAX_ENUM_ML = 0x7FFFFFFF +} XrSpatialAnchorConfidenceML; +typedef struct XR_MAY_ALIAS XrSpatialAnchorsCreateInfoBaseHeaderML { + XrStructureType type; + const void* XR_MAY_ALIAS next; +} XrSpatialAnchorsCreateInfoBaseHeaderML; + +typedef struct XrSpatialAnchorsCreateInfoFromPoseML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSpace baseSpace; + XrPosef poseInBaseSpace; + XrTime time; +} XrSpatialAnchorsCreateInfoFromPoseML; + +typedef struct XrCreateSpatialAnchorsCompletionML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrResult futureResult; + uint32_t spaceCount; + XrSpace* spaces; +} XrCreateSpatialAnchorsCompletionML; + +typedef struct XrSpatialAnchorStateML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrSpatialAnchorConfidenceML confidence; +} XrSpatialAnchorStateML; + +typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorsAsyncML)(XrSession session, const XrSpatialAnchorsCreateInfoBaseHeaderML* createInfo, XrFutureEXT* future); +typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorsCompleteML)(XrSession session, XrFutureEXT future, XrCreateSpatialAnchorsCompletionML* completion); +typedef XrResult (XRAPI_PTR *PFN_xrGetSpatialAnchorStateML)(XrSpace anchor, XrSpatialAnchorStateML* state); + +#ifndef XR_NO_PROTOTYPES +#ifdef XR_EXTENSION_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorsAsyncML( + XrSession session, + const XrSpatialAnchorsCreateInfoBaseHeaderML* createInfo, + XrFutureEXT* future); + +XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorsCompleteML( + XrSession session, + XrFutureEXT future, + XrCreateSpatialAnchorsCompletionML* completion); + +XRAPI_ATTR XrResult XRAPI_CALL xrGetSpatialAnchorStateML( + XrSpace anchor, + XrSpatialAnchorStateML* state); +#endif /* XR_EXTENSION_PROTOTYPES */ +#endif /* !XR_NO_PROTOTYPES */ + + +// XR_ML_spatial_anchors_storage is a preprocessor guard. Do not pass it to API calls. +#define XR_ML_spatial_anchors_storage 1 +XR_DEFINE_HANDLE(XrSpatialAnchorsStorageML) +#define XR_ML_spatial_anchors_storage_SPEC_VERSION 1 +#define XR_ML_SPATIAL_ANCHORS_STORAGE_EXTENSION_NAME "XR_ML_spatial_anchors_storage" +typedef struct XrSpatialAnchorsCreateStorageInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; +} XrSpatialAnchorsCreateStorageInfoML; + +typedef struct XR_MAY_ALIAS XrSpatialAnchorsQueryInfoBaseHeaderML { + XrStructureType type; + const void* XR_MAY_ALIAS next; +} XrSpatialAnchorsQueryInfoBaseHeaderML; + +typedef struct XrSpatialAnchorsQueryInfoRadiusML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSpace baseSpace; + XrVector3f center; + XrTime time; + float radius; +} XrSpatialAnchorsQueryInfoRadiusML; + +typedef struct XrSpatialAnchorsQueryCompletionML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrResult futureResult; + uint32_t uuidCapacityInput; + uint32_t uuidCountOutput; + XrUuidEXT* uuids; +} XrSpatialAnchorsQueryCompletionML; + +typedef struct XrSpatialAnchorsCreateInfoFromUuidsML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSpatialAnchorsStorageML storage; + uint32_t uuidCount; + const XrUuidEXT* uuids; +} XrSpatialAnchorsCreateInfoFromUuidsML; + +typedef struct XrSpatialAnchorsPublishInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + uint32_t anchorCount; + const XrSpace* anchors; + uint64_t expiration; +} XrSpatialAnchorsPublishInfoML; + +typedef struct XrSpatialAnchorsPublishCompletionML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrResult futureResult; + uint32_t uuidCount; + XrUuidEXT* uuids; +} XrSpatialAnchorsPublishCompletionML; + +typedef struct XrSpatialAnchorsDeleteInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + uint32_t uuidCount; + const XrUuidEXT* uuids; +} XrSpatialAnchorsDeleteInfoML; + +typedef struct XrSpatialAnchorsDeleteCompletionML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrResult futureResult; +} XrSpatialAnchorsDeleteCompletionML; + +typedef struct XrSpatialAnchorsUpdateExpirationInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + uint32_t uuidCount; + const XrUuidEXT* uuids; + uint64_t expiration; +} XrSpatialAnchorsUpdateExpirationInfoML; + +typedef struct XrSpatialAnchorsUpdateExpirationCompletionML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrResult futureResult; +} XrSpatialAnchorsUpdateExpirationCompletionML; + +typedef struct XrSpatialAnchorCompletionResultML { + XrUuidEXT uuid; + XrResult result; +} XrSpatialAnchorCompletionResultML; + +// XrSpatialAnchorsPublishCompletionDetailsML extends XrSpatialAnchorsPublishCompletionML +typedef struct XrSpatialAnchorsPublishCompletionDetailsML { + XrStructureType type; + void* XR_MAY_ALIAS next; + uint32_t resultCount; + XrSpatialAnchorCompletionResultML* results; +} XrSpatialAnchorsPublishCompletionDetailsML; + +// XrSpatialAnchorsDeleteCompletionDetailsML extends XrSpatialAnchorsDeleteCompletionML +typedef struct XrSpatialAnchorsDeleteCompletionDetailsML { + XrStructureType type; + void* XR_MAY_ALIAS next; + uint32_t resultCount; + XrSpatialAnchorCompletionResultML* results; +} XrSpatialAnchorsDeleteCompletionDetailsML; + +// XrSpatialAnchorsUpdateExpirationCompletionDetailsML extends XrSpatialAnchorsUpdateExpirationCompletionML +typedef struct XrSpatialAnchorsUpdateExpirationCompletionDetailsML { + XrStructureType type; + void* XR_MAY_ALIAS next; + uint32_t resultCount; + XrSpatialAnchorCompletionResultML* results; +} XrSpatialAnchorsUpdateExpirationCompletionDetailsML; + +typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorsStorageML)(XrSession session, const XrSpatialAnchorsCreateStorageInfoML* createInfo, XrSpatialAnchorsStorageML* storage); +typedef XrResult (XRAPI_PTR *PFN_xrDestroySpatialAnchorsStorageML)(XrSpatialAnchorsStorageML storage); +typedef XrResult (XRAPI_PTR *PFN_xrQuerySpatialAnchorsAsyncML)(XrSpatialAnchorsStorageML storage, const XrSpatialAnchorsQueryInfoBaseHeaderML* queryInfo, XrFutureEXT* future); +typedef XrResult (XRAPI_PTR *PFN_xrQuerySpatialAnchorsCompleteML)(XrSpatialAnchorsStorageML storage, XrFutureEXT future, XrSpatialAnchorsQueryCompletionML* completion); +typedef XrResult (XRAPI_PTR *PFN_xrPublishSpatialAnchorsAsyncML)(XrSpatialAnchorsStorageML storage, const XrSpatialAnchorsPublishInfoML* publishInfo, XrFutureEXT* future); +typedef XrResult (XRAPI_PTR *PFN_xrPublishSpatialAnchorsCompleteML)(XrSpatialAnchorsStorageML storage, XrFutureEXT future, XrSpatialAnchorsPublishCompletionML* completion); +typedef XrResult (XRAPI_PTR *PFN_xrDeleteSpatialAnchorsAsyncML)(XrSpatialAnchorsStorageML storage, const XrSpatialAnchorsDeleteInfoML* deleteInfo, XrFutureEXT* future); +typedef XrResult (XRAPI_PTR *PFN_xrDeleteSpatialAnchorsCompleteML)(XrSpatialAnchorsStorageML storage, XrFutureEXT future, XrSpatialAnchorsDeleteCompletionML* completion); +typedef XrResult (XRAPI_PTR *PFN_xrUpdateSpatialAnchorsExpirationAsyncML)(XrSpatialAnchorsStorageML storage, const XrSpatialAnchorsUpdateExpirationInfoML* updateInfo, XrFutureEXT* future); +typedef XrResult (XRAPI_PTR *PFN_xrUpdateSpatialAnchorsExpirationCompleteML)(XrSpatialAnchorsStorageML storage, XrFutureEXT future, XrSpatialAnchorsUpdateExpirationCompletionML* completion); + +#ifndef XR_NO_PROTOTYPES +#ifdef XR_EXTENSION_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorsStorageML( + XrSession session, + const XrSpatialAnchorsCreateStorageInfoML* createInfo, + XrSpatialAnchorsStorageML* storage); + +XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpatialAnchorsStorageML( + XrSpatialAnchorsStorageML storage); + +XRAPI_ATTR XrResult XRAPI_CALL xrQuerySpatialAnchorsAsyncML( + XrSpatialAnchorsStorageML storage, + const XrSpatialAnchorsQueryInfoBaseHeaderML* queryInfo, + XrFutureEXT* future); + +XRAPI_ATTR XrResult XRAPI_CALL xrQuerySpatialAnchorsCompleteML( + XrSpatialAnchorsStorageML storage, + XrFutureEXT future, + XrSpatialAnchorsQueryCompletionML* completion); + +XRAPI_ATTR XrResult XRAPI_CALL xrPublishSpatialAnchorsAsyncML( + XrSpatialAnchorsStorageML storage, + const XrSpatialAnchorsPublishInfoML* publishInfo, + XrFutureEXT* future); + +XRAPI_ATTR XrResult XRAPI_CALL xrPublishSpatialAnchorsCompleteML( + XrSpatialAnchorsStorageML storage, + XrFutureEXT future, + XrSpatialAnchorsPublishCompletionML* completion); + +XRAPI_ATTR XrResult XRAPI_CALL xrDeleteSpatialAnchorsAsyncML( + XrSpatialAnchorsStorageML storage, + const XrSpatialAnchorsDeleteInfoML* deleteInfo, + XrFutureEXT* future); + +XRAPI_ATTR XrResult XRAPI_CALL xrDeleteSpatialAnchorsCompleteML( + XrSpatialAnchorsStorageML storage, + XrFutureEXT future, + XrSpatialAnchorsDeleteCompletionML* completion); + +XRAPI_ATTR XrResult XRAPI_CALL xrUpdateSpatialAnchorsExpirationAsyncML( + XrSpatialAnchorsStorageML storage, + const XrSpatialAnchorsUpdateExpirationInfoML* updateInfo, + XrFutureEXT* future); + +XRAPI_ATTR XrResult XRAPI_CALL xrUpdateSpatialAnchorsExpirationCompleteML( + XrSpatialAnchorsStorageML storage, + XrFutureEXT future, + XrSpatialAnchorsUpdateExpirationCompletionML* completion); +#endif /* XR_EXTENSION_PROTOTYPES */ +#endif /* !XR_NO_PROTOTYPES */ + + // XR_MSFT_spatial_anchor_persistence is a preprocessor guard. Do not pass it to API calls. #define XR_MSFT_spatial_anchor_persistence 1 XR_DEFINE_HANDLE(XrSpatialAnchorStoreConnectionMSFT) @@ -7052,6 +7340,131 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetSpatialAnchorNameHTC( #endif /* !XR_NO_PROTOTYPES */ +// XR_HTC_body_tracking is a preprocessor guard. Do not pass it to API calls. +#define XR_HTC_body_tracking 1 + +#define XR_BODY_JOINT_COUNT_HTC 26 + +XR_DEFINE_HANDLE(XrBodyTrackerHTC) +#define XR_HTC_body_tracking_SPEC_VERSION 1 +#define XR_HTC_BODY_TRACKING_EXTENSION_NAME "XR_HTC_body_tracking" + +typedef enum XrBodyJointHTC { + XR_BODY_JOINT_PELVIS_HTC = 0, + XR_BODY_JOINT_LEFT_HIP_HTC = 1, + XR_BODY_JOINT_LEFT_KNEE_HTC = 2, + XR_BODY_JOINT_LEFT_ANKLE_HTC = 3, + XR_BODY_JOINT_LEFT_FEET_HTC = 4, + XR_BODY_JOINT_RIGHT_HIP_HTC = 5, + XR_BODY_JOINT_RIGHT_KNEE_HTC = 6, + XR_BODY_JOINT_RIGHT_ANKLE_HTC = 7, + XR_BODY_JOINT_RIGHT_FEET_HTC = 8, + XR_BODY_JOINT_WAIST_HTC = 9, + XR_BODY_JOINT_SPINE_LOWER_HTC = 10, + XR_BODY_JOINT_SPINE_MIDDLE_HTC = 11, + XR_BODY_JOINT_SPINE_HIGH_HTC = 12, + XR_BODY_JOINT_CHEST_HTC = 13, + XR_BODY_JOINT_NECK_HTC = 14, + XR_BODY_JOINT_HEAD_HTC = 15, + XR_BODY_JOINT_LEFT_CLAVICLE_HTC = 16, + XR_BODY_JOINT_LEFT_SCAPULA_HTC = 17, + XR_BODY_JOINT_LEFT_ARM_HTC = 18, + XR_BODY_JOINT_LEFT_ELBOW_HTC = 19, + XR_BODY_JOINT_LEFT_WRIST_HTC = 20, + XR_BODY_JOINT_RIGHT_CLAVICLE_HTC = 21, + XR_BODY_JOINT_RIGHT_SCAPULA_HTC = 22, + XR_BODY_JOINT_RIGHT_ARM_HTC = 23, + XR_BODY_JOINT_RIGHT_ELBOW_HTC = 24, + XR_BODY_JOINT_RIGHT_WRIST_HTC = 25, + XR_BODY_JOINT_MAX_ENUM_HTC = 0x7FFFFFFF +} XrBodyJointHTC; + +typedef enum XrBodyJointSetHTC { + XR_BODY_JOINT_SET_FULL_HTC = 0, + XR_BODY_JOINT_SET_MAX_ENUM_HTC = 0x7FFFFFFF +} XrBodyJointSetHTC; + +typedef enum XrBodyJointConfidenceHTC { + XR_BODY_JOINT_CONFIDENCE_NONE_HTC = 0, + XR_BODY_JOINT_CONFIDENCE_LOW_HTC = 1, + XR_BODY_JOINT_CONFIDENCE_HIGH_HTC = 2, + XR_BODY_JOINT_CONFIDENCE_MAX_ENUM_HTC = 0x7FFFFFFF +} XrBodyJointConfidenceHTC; +// XrSystemBodyTrackingPropertiesHTC extends XrSystemProperties +typedef struct XrSystemBodyTrackingPropertiesHTC { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrBool32 supportsBodyTracking; +} XrSystemBodyTrackingPropertiesHTC; + +typedef struct XrBodyTrackerCreateInfoHTC { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrBodyJointSetHTC bodyJointSet; +} XrBodyTrackerCreateInfoHTC; + +typedef struct XrBodyJointsLocateInfoHTC { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSpace baseSpace; + XrTime time; +} XrBodyJointsLocateInfoHTC; + +typedef struct XrBodyJointLocationHTC { + XrSpaceLocationFlags locationFlags; + XrPosef pose; +} XrBodyJointLocationHTC; + +typedef struct XrBodyJointLocationsHTC { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrSpaceLocationFlags combinedLocationFlags; + XrBodyJointConfidenceHTC confidenceLevel; + uint32_t jointLocationCount; + XrBodyJointLocationHTC* jointLocations; + uint32_t skeletonGenerationId; +} XrBodyJointLocationsHTC; + +typedef struct XrBodySkeletonJointHTC { + XrPosef pose; +} XrBodySkeletonJointHTC; + +typedef struct XrBodySkeletonHTC { + XrStructureType type; + void* XR_MAY_ALIAS next; + uint32_t jointCount; + XrBodySkeletonJointHTC* joints; +} XrBodySkeletonHTC; + +typedef XrResult (XRAPI_PTR *PFN_xrCreateBodyTrackerHTC)(XrSession session, const XrBodyTrackerCreateInfoHTC* createInfo, XrBodyTrackerHTC* bodyTracker); +typedef XrResult (XRAPI_PTR *PFN_xrDestroyBodyTrackerHTC)(XrBodyTrackerHTC bodyTracker); +typedef XrResult (XRAPI_PTR *PFN_xrLocateBodyJointsHTC)(XrBodyTrackerHTC bodyTracker, const XrBodyJointsLocateInfoHTC* locateInfo, XrBodyJointLocationsHTC* locations); +typedef XrResult (XRAPI_PTR *PFN_xrGetBodySkeletonHTC)(XrBodyTrackerHTC bodyTracker, XrSpace baseSpace, uint32_t skeletonGenerationId, XrBodySkeletonHTC* skeleton); + +#ifndef XR_NO_PROTOTYPES +#ifdef XR_EXTENSION_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrCreateBodyTrackerHTC( + XrSession session, + const XrBodyTrackerCreateInfoHTC* createInfo, + XrBodyTrackerHTC* bodyTracker); + +XRAPI_ATTR XrResult XRAPI_CALL xrDestroyBodyTrackerHTC( + XrBodyTrackerHTC bodyTracker); + +XRAPI_ATTR XrResult XRAPI_CALL xrLocateBodyJointsHTC( + XrBodyTrackerHTC bodyTracker, + const XrBodyJointsLocateInfoHTC* locateInfo, + XrBodyJointLocationsHTC* locations); + +XRAPI_ATTR XrResult XRAPI_CALL xrGetBodySkeletonHTC( + XrBodyTrackerHTC bodyTracker, + XrSpace baseSpace, + uint32_t skeletonGenerationId, + XrBodySkeletonHTC* skeleton); +#endif /* XR_EXTENSION_PROTOTYPES */ +#endif /* !XR_NO_PROTOTYPES */ + + // XR_EXT_active_action_set_priority is a preprocessor guard. Do not pass it to API calls. #define XR_EXT_active_action_set_priority 1 #define XR_EXT_active_action_set_priority_SPEC_VERSION 1 @@ -7313,7 +7726,6 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetPlanePolygonBufferEXT( // XR_EXT_future is a preprocessor guard. Do not pass it to API calls. #define XR_EXT_future 1 -XR_DEFINE_OPAQUE_64(XrFutureEXT) #define XR_EXT_future_SPEC_VERSION 1 #define XR_EXT_FUTURE_EXTENSION_NAME "XR_EXT_future" #define XR_NULL_FUTURE_EXT 0 @@ -7440,6 +7852,232 @@ XRAPI_ATTR XrResult XRAPI_CALL xrEnableUserCalibrationEventsML( #endif /* !XR_NO_PROTOTYPES */ +// XR_ML_system_notifications is a preprocessor guard. Do not pass it to API calls. +#define XR_ML_system_notifications 1 +#define XR_ML_system_notifications_SPEC_VERSION 1 +#define XR_ML_SYSTEM_NOTIFICATIONS_EXTENSION_NAME "XR_ML_system_notifications" +typedef struct XrSystemNotificationsSetInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrBool32 suppressNotifications; +} XrSystemNotificationsSetInfoML; + +typedef XrResult (XRAPI_PTR *PFN_xrSetSystemNotificationsML)(XrInstance instance, const XrSystemNotificationsSetInfoML* info); + +#ifndef XR_NO_PROTOTYPES +#ifdef XR_EXTENSION_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrSetSystemNotificationsML( + XrInstance instance, + const XrSystemNotificationsSetInfoML* info); +#endif /* XR_EXTENSION_PROTOTYPES */ +#endif /* !XR_NO_PROTOTYPES */ + + +// XR_ML_world_mesh_detection is a preprocessor guard. Do not pass it to API calls. +#define XR_ML_world_mesh_detection 1 +XR_DEFINE_HANDLE(XrWorldMeshDetectorML) +#define XR_ML_world_mesh_detection_SPEC_VERSION 1 +#define XR_ML_WORLD_MESH_DETECTION_EXTENSION_NAME "XR_ML_world_mesh_detection" + +typedef enum XrWorldMeshDetectorLodML { + XR_WORLD_MESH_DETECTOR_LOD_MINIMUM_ML = 0, + XR_WORLD_MESH_DETECTOR_LOD_MEDIUM_ML = 1, + XR_WORLD_MESH_DETECTOR_LOD_MAXIMUM_ML = 2, + XR_WORLD_MESH_DETECTOR_LOD_MAX_ENUM_ML = 0x7FFFFFFF +} XrWorldMeshDetectorLodML; + +typedef enum XrWorldMeshBlockStatusML { + XR_WORLD_MESH_BLOCK_STATUS_NEW_ML = 0, + XR_WORLD_MESH_BLOCK_STATUS_UPDATED_ML = 1, + XR_WORLD_MESH_BLOCK_STATUS_DELETED_ML = 2, + XR_WORLD_MESH_BLOCK_STATUS_UNCHANGED_ML = 3, + XR_WORLD_MESH_BLOCK_STATUS_MAX_ENUM_ML = 0x7FFFFFFF +} XrWorldMeshBlockStatusML; + +typedef enum XrWorldMeshBlockResultML { + XR_WORLD_MESH_BLOCK_RESULT_SUCCESS_ML = 0, + XR_WORLD_MESH_BLOCK_RESULT_FAILED_ML = 1, + XR_WORLD_MESH_BLOCK_RESULT_PENDING_ML = 2, + XR_WORLD_MESH_BLOCK_RESULT_PARTIAL_UPDATE_ML = 3, + XR_WORLD_MESH_BLOCK_RESULT_MAX_ENUM_ML = 0x7FFFFFFF +} XrWorldMeshBlockResultML; +typedef XrFlags64 XrWorldMeshDetectorFlagsML; + +// Flag bits for XrWorldMeshDetectorFlagsML +static const XrWorldMeshDetectorFlagsML XR_WORLD_MESH_DETECTOR_POINT_CLOUD_BIT_ML = 0x00000001; +static const XrWorldMeshDetectorFlagsML XR_WORLD_MESH_DETECTOR_COMPUTE_NORMALS_BIT_ML = 0x00000002; +static const XrWorldMeshDetectorFlagsML XR_WORLD_MESH_DETECTOR_COMPUTE_CONFIDENCE_BIT_ML = 0x00000004; +static const XrWorldMeshDetectorFlagsML XR_WORLD_MESH_DETECTOR_PLANARIZE_BIT_ML = 0x00000008; +static const XrWorldMeshDetectorFlagsML XR_WORLD_MESH_DETECTOR_REMOVE_MESH_SKIRT_BIT_ML = 0x00000010; +static const XrWorldMeshDetectorFlagsML XR_WORLD_MESH_DETECTOR_INDEX_ORDER_CW_BIT_ML = 0x00000020; + +typedef struct XrWorldMeshDetectorCreateInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; +} XrWorldMeshDetectorCreateInfoML; + +typedef struct XrWorldMeshBlockStateML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrUuidEXT uuid; + XrPosef meshBoundingBoxCenter; + XrExtent3DfEXT meshBoundingBoxExtents; + XrTime lastUpdateTime; + XrWorldMeshBlockStatusML status; +} XrWorldMeshBlockStateML; + +typedef struct XrWorldMeshStateRequestInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSpace baseSpace; + XrTime time; + XrPosef boundingBoxCenter; + XrExtent3DfEXT boundingBoxExtents; +} XrWorldMeshStateRequestInfoML; + +typedef struct XrWorldMeshStateRequestCompletionML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrResult futureResult; + XrTime timestamp; + uint32_t meshBlockStateCapacityInput; + uint32_t meshBlockStateCountOutput; + XrWorldMeshBlockStateML* meshBlockStates; +} XrWorldMeshStateRequestCompletionML; + +typedef struct XrWorldMeshBufferRecommendedSizeInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + uint32_t maxBlockCount; +} XrWorldMeshBufferRecommendedSizeInfoML; + +typedef struct XrWorldMeshBufferSizeML { + XrStructureType type; + void* XR_MAY_ALIAS next; + uint32_t size; +} XrWorldMeshBufferSizeML; + +typedef struct XrWorldMeshBufferML { + XrStructureType type; + void* XR_MAY_ALIAS next; + uint32_t bufferSize; + void* XR_MAY_ALIAS buffer; +} XrWorldMeshBufferML; + +typedef struct XrWorldMeshBlockRequestML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrUuidEXT uuid; + XrWorldMeshDetectorLodML lod; +} XrWorldMeshBlockRequestML; + +typedef struct XrWorldMeshGetInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrWorldMeshDetectorFlagsML flags; + float fillHoleLength; + float disconnectedComponentArea; + uint32_t blockCount; + XrWorldMeshBlockRequestML* blocks; +} XrWorldMeshGetInfoML; + +typedef struct XrWorldMeshBlockML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrUuidEXT uuid; + XrWorldMeshBlockResultML blockResult; + XrWorldMeshDetectorLodML lod; + XrWorldMeshDetectorFlagsML flags; + uint32_t indexCount; + uint16_t* indexBuffer; + uint32_t vertexCount; + XrVector3f* vertexBuffer; + uint32_t normalCount; + XrVector3f* normalBuffer; + uint32_t confidenceCount; + float* confidenceBuffer; +} XrWorldMeshBlockML; + +typedef struct XrWorldMeshRequestCompletionInfoML { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSpace meshSpace; + XrTime meshSpaceLocateTime; +} XrWorldMeshRequestCompletionInfoML; + +typedef struct XrWorldMeshRequestCompletionML { + XrStructureType type; + void* XR_MAY_ALIAS next; + XrResult futureResult; + uint32_t blockCount; + XrWorldMeshBlockML* blocks; +} XrWorldMeshRequestCompletionML; + +typedef XrResult (XRAPI_PTR *PFN_xrCreateWorldMeshDetectorML)(XrSession session, const XrWorldMeshDetectorCreateInfoML* createInfo, XrWorldMeshDetectorML* detector); +typedef XrResult (XRAPI_PTR *PFN_xrDestroyWorldMeshDetectorML)(XrWorldMeshDetectorML detector); +typedef XrResult (XRAPI_PTR *PFN_xrRequestWorldMeshStateAsyncML)(XrWorldMeshDetectorML detector, const XrWorldMeshStateRequestInfoML* stateRequest, XrFutureEXT* future); +typedef XrResult (XRAPI_PTR *PFN_xrRequestWorldMeshStateCompleteML)(XrWorldMeshDetectorML detector, XrFutureEXT future, XrWorldMeshStateRequestCompletionML* completion); +typedef XrResult (XRAPI_PTR *PFN_xrGetWorldMeshBufferRecommendSizeML)(XrWorldMeshDetectorML detector, const XrWorldMeshBufferRecommendedSizeInfoML* sizeInfo, XrWorldMeshBufferSizeML* size); +typedef XrResult (XRAPI_PTR *PFN_xrAllocateWorldMeshBufferML)(XrWorldMeshDetectorML detector, const XrWorldMeshBufferSizeML* size, XrWorldMeshBufferML* buffer); +typedef XrResult (XRAPI_PTR *PFN_xrFreeWorldMeshBufferML)(XrWorldMeshDetectorML detector, const XrWorldMeshBufferML* buffer); +typedef XrResult (XRAPI_PTR *PFN_xrRequestWorldMeshAsyncML)(XrWorldMeshDetectorML detector, const XrWorldMeshGetInfoML* getInfo, XrWorldMeshBufferML* buffer, XrFutureEXT* future); +typedef XrResult (XRAPI_PTR *PFN_xrRequestWorldMeshCompleteML)(XrWorldMeshDetectorML detector, const XrWorldMeshRequestCompletionInfoML* completionInfo, XrFutureEXT future, XrWorldMeshRequestCompletionML* completion); + +#ifndef XR_NO_PROTOTYPES +#ifdef XR_EXTENSION_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrCreateWorldMeshDetectorML( + XrSession session, + const XrWorldMeshDetectorCreateInfoML* createInfo, + XrWorldMeshDetectorML* detector); + +XRAPI_ATTR XrResult XRAPI_CALL xrDestroyWorldMeshDetectorML( + XrWorldMeshDetectorML detector); + +XRAPI_ATTR XrResult XRAPI_CALL xrRequestWorldMeshStateAsyncML( + XrWorldMeshDetectorML detector, + const XrWorldMeshStateRequestInfoML* stateRequest, + XrFutureEXT* future); + +XRAPI_ATTR XrResult XRAPI_CALL xrRequestWorldMeshStateCompleteML( + XrWorldMeshDetectorML detector, + XrFutureEXT future, + XrWorldMeshStateRequestCompletionML* completion); + +XRAPI_ATTR XrResult XRAPI_CALL xrGetWorldMeshBufferRecommendSizeML( + XrWorldMeshDetectorML detector, + const XrWorldMeshBufferRecommendedSizeInfoML* sizeInfo, + XrWorldMeshBufferSizeML* size); + +XRAPI_ATTR XrResult XRAPI_CALL xrAllocateWorldMeshBufferML( + XrWorldMeshDetectorML detector, + const XrWorldMeshBufferSizeML* size, + XrWorldMeshBufferML* buffer); + +XRAPI_ATTR XrResult XRAPI_CALL xrFreeWorldMeshBufferML( + XrWorldMeshDetectorML detector, + const XrWorldMeshBufferML* buffer); + +XRAPI_ATTR XrResult XRAPI_CALL xrRequestWorldMeshAsyncML( + XrWorldMeshDetectorML detector, + const XrWorldMeshGetInfoML* getInfo, + XrWorldMeshBufferML* buffer, + XrFutureEXT* future); + +XRAPI_ATTR XrResult XRAPI_CALL xrRequestWorldMeshCompleteML( + XrWorldMeshDetectorML detector, + const XrWorldMeshRequestCompletionInfoML* completionInfo, + XrFutureEXT future, + XrWorldMeshRequestCompletionML* completion); +#endif /* XR_EXTENSION_PROTOTYPES */ +#endif /* !XR_NO_PROTOTYPES */ + + +// XR_ML_view_configuration_depth_range_change is a preprocessor guard. Do not pass it to API calls. +#define XR_ML_view_configuration_depth_range_change 1 +#define XR_ML_view_configuration_depth_range_change_SPEC_VERSION 1 +#define XR_ML_VIEW_CONFIGURATION_DEPTH_RANGE_CHANGE_EXTENSION_NAME "XR_ML_view_configuration_depth_range_change" + + // XR_YVR_controller_interaction is a preprocessor guard. Do not pass it to API calls. #define XR_YVR_controller_interaction 1 #define XR_YVR_controller_interaction_SPEC_VERSION 1 diff --git a/thirdparty/openxr/include/openxr/openxr_platform.h b/thirdparty/openxr/include/openxr/openxr_platform.h index cbe10089065..dfd74aa5d2d 100644 --- a/thirdparty/openxr/include/openxr/openxr_platform.h +++ b/thirdparty/openxr/include/openxr/openxr_platform.h @@ -356,6 +356,43 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D12GraphicsRequirementsKHR( #endif /* !XR_NO_PROTOTYPES */ #endif /* XR_USE_GRAPHICS_API_D3D12 */ +#ifdef XR_USE_GRAPHICS_API_METAL + +// XR_KHR_metal_enable is a preprocessor guard. Do not pass it to API calls. +#define XR_KHR_metal_enable 1 +#define XR_KHR_metal_enable_SPEC_VERSION 1 +#define XR_KHR_METAL_ENABLE_EXTENSION_NAME "XR_KHR_metal_enable" +// XrGraphicsBindingMetalKHR extends XrSessionCreateInfo +typedef struct XrGraphicsBindingMetalKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + void* XR_MAY_ALIAS commandQueue; +} XrGraphicsBindingMetalKHR; + +typedef struct XrSwapchainImageMetalKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + void* XR_MAY_ALIAS texture; +} XrSwapchainImageMetalKHR; + +typedef struct XrGraphicsRequirementsMetalKHR { + XrStructureType type; + void* XR_MAY_ALIAS next; + void* XR_MAY_ALIAS metalDevice; +} XrGraphicsRequirementsMetalKHR; + +typedef XrResult (XRAPI_PTR *PFN_xrGetMetalGraphicsRequirementsKHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsMetalKHR* graphicsRequirements); + +#ifndef XR_NO_PROTOTYPES +#ifdef XR_EXTENSION_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrGetMetalGraphicsRequirementsKHR( + XrInstance instance, + XrSystemId systemId, + XrGraphicsRequirementsMetalKHR* graphicsRequirements); +#endif /* XR_EXTENSION_PROTOTYPES */ +#endif /* !XR_NO_PROTOTYPES */ +#endif /* XR_USE_GRAPHICS_API_METAL */ + #ifdef XR_USE_PLATFORM_WIN32 // XR_KHR_win32_convert_performance_counter_time is a preprocessor guard. Do not pass it to API calls. diff --git a/thirdparty/openxr/include/openxr/openxr_reflection.h b/thirdparty/openxr/include/openxr/openxr_reflection.h index b9d45689a72..4bea81c2367 100644 --- a/thirdparty/openxr/include/openxr/openxr_reflection.h +++ b/thirdparty/openxr/include/openxr/openxr_reflection.h @@ -128,6 +128,11 @@ XR_ENUM_STR(XrResult); _(XR_ERROR_LOCALIZATION_MAP_PERMISSION_DENIED_ML, -1000139004) \ _(XR_ERROR_LOCALIZATION_MAP_ALREADY_EXISTS_ML, -1000139005) \ _(XR_ERROR_LOCALIZATION_MAP_CANNOT_EXPORT_CLOUD_MAP_ML, -1000139006) \ + _(XR_ERROR_SPATIAL_ANCHORS_PERMISSION_DENIED_ML, -1000140000) \ + _(XR_ERROR_SPATIAL_ANCHORS_NOT_LOCALIZED_ML, -1000140001) \ + _(XR_ERROR_SPATIAL_ANCHORS_OUT_OF_MAP_BOUNDS_ML, -1000140002) \ + _(XR_ERROR_SPATIAL_ANCHORS_SPACE_NOT_LOCATABLE_ML, -1000140003) \ + _(XR_ERROR_SPATIAL_ANCHORS_ANCHOR_NOT_FOUND_ML, -1000141000) \ _(XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT, -1000142001) \ _(XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFT, -1000142002) \ _(XR_SCENE_MARKER_DATA_NOT_STRING_MSFT, 1000147000) \ @@ -144,6 +149,10 @@ XR_ENUM_STR(XrResult); _(XR_ERROR_PLANE_DETECTION_PERMISSION_DENIED_EXT, -1000429001) \ _(XR_ERROR_FUTURE_PENDING_EXT, -1000469001) \ _(XR_ERROR_FUTURE_INVALID_EXT, -1000469002) \ + _(XR_ERROR_SYSTEM_NOTIFICATION_PERMISSION_DENIED_ML, -1000473000) \ + _(XR_ERROR_SYSTEM_NOTIFICATION_INCOMPATIBLE_SKU_ML, -1000473001) \ + _(XR_ERROR_WORLD_MESH_DETECTOR_PERMISSION_DENIED_ML, -1000474000) \ + _(XR_ERROR_WORLD_MESH_DETECTOR_SPACE_NOT_LOCATABLE_ML, -1000474001) \ _(XR_RESULT_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrStructureType(_) \ @@ -229,6 +238,9 @@ XR_ENUM_STR(XrResult); _(XR_TYPE_GRAPHICS_BINDING_D3D12_KHR, 1000028000) \ _(XR_TYPE_SWAPCHAIN_IMAGE_D3D12_KHR, 1000028001) \ _(XR_TYPE_GRAPHICS_REQUIREMENTS_D3D12_KHR, 1000028002) \ + _(XR_TYPE_GRAPHICS_BINDING_METAL_KHR, 1000029000) \ + _(XR_TYPE_SWAPCHAIN_IMAGE_METAL_KHR, 1000029001) \ + _(XR_TYPE_GRAPHICS_REQUIREMENTS_METAL_KHR, 1000029002) \ _(XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT, 1000030000) \ _(XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT, 1000030001) \ _(XR_TYPE_VISIBILITY_MASK_KHR, 1000031000) \ @@ -375,6 +387,22 @@ XR_ENUM_STR(XrResult); _(XR_TYPE_MAP_LOCALIZATION_REQUEST_INFO_ML, 1000139002) \ _(XR_TYPE_LOCALIZATION_MAP_IMPORT_INFO_ML, 1000139003) \ _(XR_TYPE_LOCALIZATION_ENABLE_EVENTS_INFO_ML, 1000139004) \ + _(XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_POSE_ML, 1000140000) \ + _(XR_TYPE_CREATE_SPATIAL_ANCHORS_COMPLETION_ML, 1000140001) \ + _(XR_TYPE_SPATIAL_ANCHOR_STATE_ML, 1000140002) \ + _(XR_TYPE_SPATIAL_ANCHORS_CREATE_STORAGE_INFO_ML, 1000141000) \ + _(XR_TYPE_SPATIAL_ANCHORS_QUERY_INFO_RADIUS_ML, 1000141001) \ + _(XR_TYPE_SPATIAL_ANCHORS_QUERY_COMPLETION_ML, 1000141002) \ + _(XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_UUIDS_ML, 1000141003) \ + _(XR_TYPE_SPATIAL_ANCHORS_PUBLISH_INFO_ML, 1000141004) \ + _(XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_ML, 1000141005) \ + _(XR_TYPE_SPATIAL_ANCHORS_DELETE_INFO_ML, 1000141006) \ + _(XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_ML, 1000141007) \ + _(XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_INFO_ML, 1000141008) \ + _(XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_ML, 1000141009) \ + _(XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_DETAILS_ML, 1000141010) \ + _(XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_DETAILS_ML, 1000141011) \ + _(XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_DETAILS_ML, 1000141012) \ _(XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML, 1000472000) \ _(XR_TYPE_EVENT_DATA_EYE_CALIBRATION_CHANGED_ML, 1000472001) \ _(XR_TYPE_USER_CALIBRATION_ENABLE_EVENTS_INFO_ML, 1000472002) \ @@ -482,6 +510,11 @@ XR_ENUM_STR(XrResult); _(XR_TYPE_FOVEATION_CUSTOM_MODE_INFO_HTC, 1000318002) \ _(XR_TYPE_SYSTEM_ANCHOR_PROPERTIES_HTC, 1000319000) \ _(XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_HTC, 1000319001) \ + _(XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_HTC, 1000320000) \ + _(XR_TYPE_BODY_TRACKER_CREATE_INFO_HTC, 1000320001) \ + _(XR_TYPE_BODY_JOINTS_LOCATE_INFO_HTC, 1000320002) \ + _(XR_TYPE_BODY_JOINT_LOCATIONS_HTC, 1000320003) \ + _(XR_TYPE_BODY_SKELETON_HTC, 1000320004) \ _(XR_TYPE_ACTIVE_ACTION_SET_PRIORITIES_EXT, 1000373000) \ _(XR_TYPE_SYSTEM_FORCE_FEEDBACK_CURL_PROPERTIES_MNDX, 1000375000) \ _(XR_TYPE_FORCE_FEEDBACK_CURL_APPLY_LOCATIONS_MNDX, 1000375001) \ @@ -500,6 +533,19 @@ XR_ENUM_STR(XrResult); _(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_TYPE_SYSTEM_NOTIFICATIONS_SET_INFO_ML, 1000473000) \ + _(XR_TYPE_WORLD_MESH_DETECTOR_CREATE_INFO_ML, 1000474001) \ + _(XR_TYPE_WORLD_MESH_STATE_REQUEST_INFO_ML, 1000474002) \ + _(XR_TYPE_WORLD_MESH_BLOCK_STATE_ML, 1000474003) \ + _(XR_TYPE_WORLD_MESH_STATE_REQUEST_COMPLETION_ML, 1000474004) \ + _(XR_TYPE_WORLD_MESH_BUFFER_RECOMMENDED_SIZE_INFO_ML, 1000474005) \ + _(XR_TYPE_WORLD_MESH_BUFFER_SIZE_ML, 1000474006) \ + _(XR_TYPE_WORLD_MESH_BUFFER_ML, 1000474007) \ + _(XR_TYPE_WORLD_MESH_BLOCK_REQUEST_ML, 1000474008) \ + _(XR_TYPE_WORLD_MESH_GET_INFO_ML, 1000474009) \ + _(XR_TYPE_WORLD_MESH_BLOCK_ML, 1000474010) \ + _(XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_ML, 1000474011) \ + _(XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_INFO_ML, 1000474012) \ _(XR_STRUCTURE_TYPE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrFormFactor(_) \ @@ -579,6 +625,7 @@ XR_ENUM_STR(XrResult); _(XR_OBJECT_TYPE_GEOMETRY_INSTANCE_FB, 1000118004) \ _(XR_OBJECT_TYPE_MARKER_DETECTOR_ML, 1000138000) \ _(XR_OBJECT_TYPE_EXPORTED_LOCALIZATION_MAP_ML, 1000139000) \ + _(XR_OBJECT_TYPE_SPATIAL_ANCHORS_STORAGE_ML, 1000141000) \ _(XR_OBJECT_TYPE_SPATIAL_ANCHOR_STORE_CONNECTION_MSFT, 1000142000) \ _(XR_OBJECT_TYPE_FACE_TRACKER_FB, 1000201000) \ _(XR_OBJECT_TYPE_EYE_TRACKER_FB, 1000202000) \ @@ -589,7 +636,9 @@ XR_ENUM_STR(XrResult); _(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_BODY_TRACKER_HTC, 1000320000) \ _(XR_OBJECT_TYPE_PLANE_DETECTOR_EXT, 1000429000) \ + _(XR_OBJECT_TYPE_WORLD_MESH_DETECTOR_ML, 1000474000) \ _(XR_OBJECT_TYPE_MAX_ENUM, 0x7FFFFFFF) #define XR_LIST_ENUM_XrLoaderInterfaceStructs(_) \ @@ -1053,6 +1102,12 @@ XR_ENUM_STR(XrResult); _(XR_LOCALIZATION_MAP_CONFIDENCE_EXCELLENT_ML, 3) \ _(XR_LOCALIZATION_MAP_CONFIDENCE_MAX_ENUM_ML, 0x7FFFFFFF) +#define XR_LIST_ENUM_XrSpatialAnchorConfidenceML(_) \ + _(XR_SPATIAL_ANCHOR_CONFIDENCE_LOW_ML, 0) \ + _(XR_SPATIAL_ANCHOR_CONFIDENCE_MEDIUM_ML, 1) \ + _(XR_SPATIAL_ANCHOR_CONFIDENCE_HIGH_ML, 2) \ + _(XR_SPATIAL_ANCHOR_CONFIDENCE_MAX_ENUM_ML, 0x7FFFFFFF) + #define XR_LIST_ENUM_XrSceneMarkerTypeMSFT(_) \ _(XR_SCENE_MARKER_TYPE_QR_CODE_MSFT, 1) \ _(XR_SCENE_MARKER_TYPE_MAX_ENUM_MSFT, 0x7FFFFFFF) @@ -1363,6 +1418,45 @@ XR_ENUM_STR(XrResult); _(XR_FOVEATION_LEVEL_HIGH_HTC, 3) \ _(XR_FOVEATION_LEVEL_MAX_ENUM_HTC, 0x7FFFFFFF) +#define XR_LIST_ENUM_XrBodyJointHTC(_) \ + _(XR_BODY_JOINT_PELVIS_HTC, 0) \ + _(XR_BODY_JOINT_LEFT_HIP_HTC, 1) \ + _(XR_BODY_JOINT_LEFT_KNEE_HTC, 2) \ + _(XR_BODY_JOINT_LEFT_ANKLE_HTC, 3) \ + _(XR_BODY_JOINT_LEFT_FEET_HTC, 4) \ + _(XR_BODY_JOINT_RIGHT_HIP_HTC, 5) \ + _(XR_BODY_JOINT_RIGHT_KNEE_HTC, 6) \ + _(XR_BODY_JOINT_RIGHT_ANKLE_HTC, 7) \ + _(XR_BODY_JOINT_RIGHT_FEET_HTC, 8) \ + _(XR_BODY_JOINT_WAIST_HTC, 9) \ + _(XR_BODY_JOINT_SPINE_LOWER_HTC, 10) \ + _(XR_BODY_JOINT_SPINE_MIDDLE_HTC, 11) \ + _(XR_BODY_JOINT_SPINE_HIGH_HTC, 12) \ + _(XR_BODY_JOINT_CHEST_HTC, 13) \ + _(XR_BODY_JOINT_NECK_HTC, 14) \ + _(XR_BODY_JOINT_HEAD_HTC, 15) \ + _(XR_BODY_JOINT_LEFT_CLAVICLE_HTC, 16) \ + _(XR_BODY_JOINT_LEFT_SCAPULA_HTC, 17) \ + _(XR_BODY_JOINT_LEFT_ARM_HTC, 18) \ + _(XR_BODY_JOINT_LEFT_ELBOW_HTC, 19) \ + _(XR_BODY_JOINT_LEFT_WRIST_HTC, 20) \ + _(XR_BODY_JOINT_RIGHT_CLAVICLE_HTC, 21) \ + _(XR_BODY_JOINT_RIGHT_SCAPULA_HTC, 22) \ + _(XR_BODY_JOINT_RIGHT_ARM_HTC, 23) \ + _(XR_BODY_JOINT_RIGHT_ELBOW_HTC, 24) \ + _(XR_BODY_JOINT_RIGHT_WRIST_HTC, 25) \ + _(XR_BODY_JOINT_MAX_ENUM_HTC, 0x7FFFFFFF) + +#define XR_LIST_ENUM_XrBodyJointSetHTC(_) \ + _(XR_BODY_JOINT_SET_FULL_HTC, 0) \ + _(XR_BODY_JOINT_SET_MAX_ENUM_HTC, 0x7FFFFFFF) + +#define XR_LIST_ENUM_XrBodyJointConfidenceHTC(_) \ + _(XR_BODY_JOINT_CONFIDENCE_NONE_HTC, 0) \ + _(XR_BODY_JOINT_CONFIDENCE_LOW_HTC, 1) \ + _(XR_BODY_JOINT_CONFIDENCE_HIGH_HTC, 2) \ + _(XR_BODY_JOINT_CONFIDENCE_MAX_ENUM_HTC, 0x7FFFFFFF) + #define XR_LIST_ENUM_XrForceFeedbackCurlLocationMNDX(_) \ _(XR_FORCE_FEEDBACK_CURL_LOCATION_THUMB_CURL_MNDX, 0) \ _(XR_FORCE_FEEDBACK_CURL_LOCATION_INDEX_CURL_MNDX, 1) \ @@ -1418,6 +1512,26 @@ XR_ENUM_STR(XrResult); _(XR_EYE_CALIBRATION_STATUS_FINE_ML, 3) \ _(XR_EYE_CALIBRATION_STATUS_MAX_ENUM_ML, 0x7FFFFFFF) +#define XR_LIST_ENUM_XrWorldMeshDetectorLodML(_) \ + _(XR_WORLD_MESH_DETECTOR_LOD_MINIMUM_ML, 0) \ + _(XR_WORLD_MESH_DETECTOR_LOD_MEDIUM_ML, 1) \ + _(XR_WORLD_MESH_DETECTOR_LOD_MAXIMUM_ML, 2) \ + _(XR_WORLD_MESH_DETECTOR_LOD_MAX_ENUM_ML, 0x7FFFFFFF) + +#define XR_LIST_ENUM_XrWorldMeshBlockStatusML(_) \ + _(XR_WORLD_MESH_BLOCK_STATUS_NEW_ML, 0) \ + _(XR_WORLD_MESH_BLOCK_STATUS_UPDATED_ML, 1) \ + _(XR_WORLD_MESH_BLOCK_STATUS_DELETED_ML, 2) \ + _(XR_WORLD_MESH_BLOCK_STATUS_UNCHANGED_ML, 3) \ + _(XR_WORLD_MESH_BLOCK_STATUS_MAX_ENUM_ML, 0x7FFFFFFF) + +#define XR_LIST_ENUM_XrWorldMeshBlockResultML(_) \ + _(XR_WORLD_MESH_BLOCK_RESULT_SUCCESS_ML, 0) \ + _(XR_WORLD_MESH_BLOCK_RESULT_FAILED_ML, 1) \ + _(XR_WORLD_MESH_BLOCK_RESULT_PENDING_ML, 2) \ + _(XR_WORLD_MESH_BLOCK_RESULT_PARTIAL_UPDATE_ML, 3) \ + _(XR_WORLD_MESH_BLOCK_RESULT_MAX_ENUM_ML, 0x7FFFFFFF) + #define XR_LIST_BITS_XrInstanceCreateFlags(_) #define XR_LIST_BITS_XrSessionCreateFlags(_) @@ -1622,6 +1736,14 @@ XR_ENUM_STR(XrResult); #define XR_LIST_BITS_XrPlaneDetectorFlagsEXT(_) \ _(XR_PLANE_DETECTOR_ENABLE_CONTOUR_BIT_EXT, 0x00000001) \ +#define XR_LIST_BITS_XrWorldMeshDetectorFlagsML(_) \ + _(XR_WORLD_MESH_DETECTOR_POINT_CLOUD_BIT_ML, 0x00000001) \ + _(XR_WORLD_MESH_DETECTOR_COMPUTE_NORMALS_BIT_ML, 0x00000002) \ + _(XR_WORLD_MESH_DETECTOR_COMPUTE_CONFIDENCE_BIT_ML, 0x00000004) \ + _(XR_WORLD_MESH_DETECTOR_PLANARIZE_BIT_ML, 0x00000008) \ + _(XR_WORLD_MESH_DETECTOR_REMOVE_MESH_SKIRT_BIT_ML, 0x00000010) \ + _(XR_WORLD_MESH_DETECTOR_INDEX_ORDER_CW_BIT_ML, 0x00000020) \ + /// Calls your macro with the name of each member of XrApiLayerProperties, in order. #define XR_LIST_STRUCT_XrApiLayerProperties(_) \ _(type) \ @@ -2442,6 +2564,24 @@ XR_ENUM_STR(XrResult); _(adapterLuid) \ _(minFeatureLevel) \ +/// Calls your macro with the name of each member of XrGraphicsBindingMetalKHR, in order. +#define XR_LIST_STRUCT_XrGraphicsBindingMetalKHR(_) \ + _(type) \ + _(next) \ + _(commandQueue) \ + +/// Calls your macro with the name of each member of XrSwapchainImageMetalKHR, in order. +#define XR_LIST_STRUCT_XrSwapchainImageMetalKHR(_) \ + _(type) \ + _(next) \ + _(texture) \ + +/// Calls your macro with the name of each member of XrGraphicsRequirementsMetalKHR, in order. +#define XR_LIST_STRUCT_XrGraphicsRequirementsMetalKHR(_) \ + _(type) \ + _(next) \ + _(metalDevice) \ + /// Calls your macro with the name of each member of XrVisibilityMaskKHR, in order. #define XR_LIST_STRUCT_XrVisibilityMaskKHR(_) \ _(type) \ @@ -3711,6 +3851,138 @@ XR_ENUM_STR(XrResult); _(next) \ _(enabled) \ +/// Calls your macro with the name of each member of XrSpatialAnchorsCreateInfoBaseHeaderML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsCreateInfoBaseHeaderML(_) \ + _(type) \ + _(next) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsCreateInfoFromPoseML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsCreateInfoFromPoseML(_) \ + _(type) \ + _(next) \ + _(baseSpace) \ + _(poseInBaseSpace) \ + _(time) \ + +/// Calls your macro with the name of each member of XrCreateSpatialAnchorsCompletionML, in order. +#define XR_LIST_STRUCT_XrCreateSpatialAnchorsCompletionML(_) \ + _(type) \ + _(next) \ + _(futureResult) \ + _(spaceCount) \ + _(spaces) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorStateML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorStateML(_) \ + _(type) \ + _(next) \ + _(confidence) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsCreateStorageInfoML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsCreateStorageInfoML(_) \ + _(type) \ + _(next) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsQueryInfoBaseHeaderML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsQueryInfoBaseHeaderML(_) \ + _(type) \ + _(next) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsQueryInfoRadiusML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsQueryInfoRadiusML(_) \ + _(type) \ + _(next) \ + _(baseSpace) \ + _(center) \ + _(time) \ + _(radius) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsQueryCompletionML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsQueryCompletionML(_) \ + _(type) \ + _(next) \ + _(futureResult) \ + _(uuidCapacityInput) \ + _(uuidCountOutput) \ + _(uuids) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsCreateInfoFromUuidsML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsCreateInfoFromUuidsML(_) \ + _(type) \ + _(next) \ + _(storage) \ + _(uuidCount) \ + _(uuids) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsPublishInfoML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsPublishInfoML(_) \ + _(type) \ + _(next) \ + _(anchorCount) \ + _(anchors) \ + _(expiration) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsPublishCompletionML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsPublishCompletionML(_) \ + _(type) \ + _(next) \ + _(futureResult) \ + _(uuidCount) \ + _(uuids) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsDeleteInfoML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsDeleteInfoML(_) \ + _(type) \ + _(next) \ + _(uuidCount) \ + _(uuids) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsDeleteCompletionML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsDeleteCompletionML(_) \ + _(type) \ + _(next) \ + _(futureResult) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsUpdateExpirationInfoML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsUpdateExpirationInfoML(_) \ + _(type) \ + _(next) \ + _(uuidCount) \ + _(uuids) \ + _(expiration) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsUpdateExpirationCompletionML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsUpdateExpirationCompletionML(_) \ + _(type) \ + _(next) \ + _(futureResult) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorCompletionResultML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorCompletionResultML(_) \ + _(uuid) \ + _(result) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsPublishCompletionDetailsML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsPublishCompletionDetailsML(_) \ + _(type) \ + _(next) \ + _(resultCount) \ + _(results) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsDeleteCompletionDetailsML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsDeleteCompletionDetailsML(_) \ + _(type) \ + _(next) \ + _(resultCount) \ + _(results) \ + +/// Calls your macro with the name of each member of XrSpatialAnchorsUpdateExpirationCompletionDetailsML, in order. +#define XR_LIST_STRUCT_XrSpatialAnchorsUpdateExpirationCompletionDetailsML(_) \ + _(type) \ + _(next) \ + _(resultCount) \ + _(results) \ + /// Calls your macro with the name of each member of XrSpatialAnchorPersistenceNameMSFT, in order. #define XR_LIST_STRUCT_XrSpatialAnchorPersistenceNameMSFT(_) \ _(name) \ @@ -4571,6 +4843,51 @@ XR_ENUM_STR(XrResult); _(poseInSpace) \ _(name) \ +/// Calls your macro with the name of each member of XrSystemBodyTrackingPropertiesHTC, in order. +#define XR_LIST_STRUCT_XrSystemBodyTrackingPropertiesHTC(_) \ + _(type) \ + _(next) \ + _(supportsBodyTracking) \ + +/// Calls your macro with the name of each member of XrBodyTrackerCreateInfoHTC, in order. +#define XR_LIST_STRUCT_XrBodyTrackerCreateInfoHTC(_) \ + _(type) \ + _(next) \ + _(bodyJointSet) \ + +/// Calls your macro with the name of each member of XrBodyJointsLocateInfoHTC, in order. +#define XR_LIST_STRUCT_XrBodyJointsLocateInfoHTC(_) \ + _(type) \ + _(next) \ + _(baseSpace) \ + _(time) \ + +/// Calls your macro with the name of each member of XrBodyJointLocationHTC, in order. +#define XR_LIST_STRUCT_XrBodyJointLocationHTC(_) \ + _(locationFlags) \ + _(pose) \ + +/// Calls your macro with the name of each member of XrBodyJointLocationsHTC, in order. +#define XR_LIST_STRUCT_XrBodyJointLocationsHTC(_) \ + _(type) \ + _(next) \ + _(combinedLocationFlags) \ + _(confidenceLevel) \ + _(jointLocationCount) \ + _(jointLocations) \ + _(skeletonGenerationId) \ + +/// Calls your macro with the name of each member of XrBodySkeletonJointHTC, in order. +#define XR_LIST_STRUCT_XrBodySkeletonJointHTC(_) \ + _(pose) \ + +/// Calls your macro with the name of each member of XrBodySkeletonHTC, in order. +#define XR_LIST_STRUCT_XrBodySkeletonHTC(_) \ + _(type) \ + _(next) \ + _(jointCount) \ + _(joints) \ + /// Calls your macro with the name of each member of XrActiveActionSetPriorityEXT, in order. #define XR_LIST_STRUCT_XrActiveActionSetPriorityEXT(_) \ _(actionSet) \ @@ -4739,6 +5056,114 @@ XR_ENUM_STR(XrResult); _(next) \ _(enabled) \ +/// Calls your macro with the name of each member of XrSystemNotificationsSetInfoML, in order. +#define XR_LIST_STRUCT_XrSystemNotificationsSetInfoML(_) \ + _(type) \ + _(next) \ + _(suppressNotifications) \ + +/// Calls your macro with the name of each member of XrWorldMeshDetectorCreateInfoML, in order. +#define XR_LIST_STRUCT_XrWorldMeshDetectorCreateInfoML(_) \ + _(type) \ + _(next) \ + +/// Calls your macro with the name of each member of XrWorldMeshBlockStateML, in order. +#define XR_LIST_STRUCT_XrWorldMeshBlockStateML(_) \ + _(type) \ + _(next) \ + _(uuid) \ + _(meshBoundingBoxCenter) \ + _(meshBoundingBoxExtents) \ + _(lastUpdateTime) \ + _(status) \ + +/// Calls your macro with the name of each member of XrWorldMeshStateRequestInfoML, in order. +#define XR_LIST_STRUCT_XrWorldMeshStateRequestInfoML(_) \ + _(type) \ + _(next) \ + _(baseSpace) \ + _(time) \ + _(boundingBoxCenter) \ + _(boundingBoxExtents) \ + +/// Calls your macro with the name of each member of XrWorldMeshStateRequestCompletionML, in order. +#define XR_LIST_STRUCT_XrWorldMeshStateRequestCompletionML(_) \ + _(type) \ + _(next) \ + _(futureResult) \ + _(timestamp) \ + _(meshBlockStateCapacityInput) \ + _(meshBlockStateCountOutput) \ + _(meshBlockStates) \ + +/// Calls your macro with the name of each member of XrWorldMeshBufferRecommendedSizeInfoML, in order. +#define XR_LIST_STRUCT_XrWorldMeshBufferRecommendedSizeInfoML(_) \ + _(type) \ + _(next) \ + _(maxBlockCount) \ + +/// Calls your macro with the name of each member of XrWorldMeshBufferSizeML, in order. +#define XR_LIST_STRUCT_XrWorldMeshBufferSizeML(_) \ + _(type) \ + _(next) \ + _(size) \ + +/// Calls your macro with the name of each member of XrWorldMeshBufferML, in order. +#define XR_LIST_STRUCT_XrWorldMeshBufferML(_) \ + _(type) \ + _(next) \ + _(bufferSize) \ + _(buffer) \ + +/// Calls your macro with the name of each member of XrWorldMeshBlockRequestML, in order. +#define XR_LIST_STRUCT_XrWorldMeshBlockRequestML(_) \ + _(type) \ + _(next) \ + _(uuid) \ + _(lod) \ + +/// Calls your macro with the name of each member of XrWorldMeshGetInfoML, in order. +#define XR_LIST_STRUCT_XrWorldMeshGetInfoML(_) \ + _(type) \ + _(next) \ + _(flags) \ + _(fillHoleLength) \ + _(disconnectedComponentArea) \ + _(blockCount) \ + _(blocks) \ + +/// Calls your macro with the name of each member of XrWorldMeshBlockML, in order. +#define XR_LIST_STRUCT_XrWorldMeshBlockML(_) \ + _(type) \ + _(next) \ + _(uuid) \ + _(blockResult) \ + _(lod) \ + _(flags) \ + _(indexCount) \ + _(indexBuffer) \ + _(vertexCount) \ + _(vertexBuffer) \ + _(normalCount) \ + _(normalBuffer) \ + _(confidenceCount) \ + _(confidenceBuffer) \ + +/// Calls your macro with the name of each member of XrWorldMeshRequestCompletionInfoML, in order. +#define XR_LIST_STRUCT_XrWorldMeshRequestCompletionInfoML(_) \ + _(type) \ + _(next) \ + _(meshSpace) \ + _(meshSpaceLocateTime) \ + +/// Calls your macro with the name of each member of XrWorldMeshRequestCompletionML, in order. +#define XR_LIST_STRUCT_XrWorldMeshRequestCompletionML(_) \ + _(type) \ + _(next) \ + _(futureResult) \ + _(blockCount) \ + _(blocks) \ + /// Calls your macro with the structure type name and the XrStructureType constant for @@ -4747,6 +5172,7 @@ XR_ENUM_STR(XrResult); XR_LIST_STRUCTURE_TYPES_CORE(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D11(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D12(_) \ + XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_METAL(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WAYLAND(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WIN32(_) \ @@ -4962,6 +5388,22 @@ XR_ENUM_STR(XrResult); _(XrMapLocalizationRequestInfoML, XR_TYPE_MAP_LOCALIZATION_REQUEST_INFO_ML) \ _(XrLocalizationMapImportInfoML, XR_TYPE_LOCALIZATION_MAP_IMPORT_INFO_ML) \ _(XrLocalizationEnableEventsInfoML, XR_TYPE_LOCALIZATION_ENABLE_EVENTS_INFO_ML) \ + _(XrSpatialAnchorsCreateInfoFromPoseML, XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_POSE_ML) \ + _(XrCreateSpatialAnchorsCompletionML, XR_TYPE_CREATE_SPATIAL_ANCHORS_COMPLETION_ML) \ + _(XrSpatialAnchorStateML, XR_TYPE_SPATIAL_ANCHOR_STATE_ML) \ + _(XrSpatialAnchorsCreateStorageInfoML, XR_TYPE_SPATIAL_ANCHORS_CREATE_STORAGE_INFO_ML) \ + _(XrSpatialAnchorsQueryInfoRadiusML, XR_TYPE_SPATIAL_ANCHORS_QUERY_INFO_RADIUS_ML) \ + _(XrSpatialAnchorsQueryCompletionML, XR_TYPE_SPATIAL_ANCHORS_QUERY_COMPLETION_ML) \ + _(XrSpatialAnchorsCreateInfoFromUuidsML, XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_UUIDS_ML) \ + _(XrSpatialAnchorsPublishInfoML, XR_TYPE_SPATIAL_ANCHORS_PUBLISH_INFO_ML) \ + _(XrSpatialAnchorsPublishCompletionML, XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_ML) \ + _(XrSpatialAnchorsDeleteInfoML, XR_TYPE_SPATIAL_ANCHORS_DELETE_INFO_ML) \ + _(XrSpatialAnchorsDeleteCompletionML, XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_ML) \ + _(XrSpatialAnchorsUpdateExpirationInfoML, XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_INFO_ML) \ + _(XrSpatialAnchorsUpdateExpirationCompletionML, XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_ML) \ + _(XrSpatialAnchorsPublishCompletionDetailsML, XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_DETAILS_ML) \ + _(XrSpatialAnchorsDeleteCompletionDetailsML, XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_DETAILS_ML) \ + _(XrSpatialAnchorsUpdateExpirationCompletionDetailsML, XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_DETAILS_ML) \ _(XrSpatialAnchorPersistenceInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT) \ _(XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT) \ _(XrSceneMarkersMSFT, XR_TYPE_SCENE_MARKERS_MSFT) \ @@ -5061,6 +5503,11 @@ XR_ENUM_STR(XrResult); _(XrFoveationCustomModeInfoHTC, XR_TYPE_FOVEATION_CUSTOM_MODE_INFO_HTC) \ _(XrSystemAnchorPropertiesHTC, XR_TYPE_SYSTEM_ANCHOR_PROPERTIES_HTC) \ _(XrSpatialAnchorCreateInfoHTC, XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_HTC) \ + _(XrSystemBodyTrackingPropertiesHTC, XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_HTC) \ + _(XrBodyTrackerCreateInfoHTC, XR_TYPE_BODY_TRACKER_CREATE_INFO_HTC) \ + _(XrBodyJointsLocateInfoHTC, XR_TYPE_BODY_JOINTS_LOCATE_INFO_HTC) \ + _(XrBodyJointLocationsHTC, XR_TYPE_BODY_JOINT_LOCATIONS_HTC) \ + _(XrBodySkeletonHTC, XR_TYPE_BODY_SKELETON_HTC) \ _(XrActiveActionSetPrioritiesEXT, XR_TYPE_ACTIVE_ACTION_SET_PRIORITIES_EXT) \ _(XrSystemForceFeedbackCurlPropertiesMNDX, XR_TYPE_SYSTEM_FORCE_FEEDBACK_CURL_PROPERTIES_MNDX) \ _(XrForceFeedbackCurlApplyLocationsMNDX, XR_TYPE_FORCE_FEEDBACK_CURL_APPLY_LOCATIONS_MNDX) \ @@ -5082,6 +5529,19 @@ XR_ENUM_STR(XrResult); _(XrEventDataHeadsetFitChangedML, XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML) \ _(XrEventDataEyeCalibrationChangedML, XR_TYPE_EVENT_DATA_EYE_CALIBRATION_CHANGED_ML) \ _(XrUserCalibrationEnableEventsInfoML, XR_TYPE_USER_CALIBRATION_ENABLE_EVENTS_INFO_ML) \ + _(XrSystemNotificationsSetInfoML, XR_TYPE_SYSTEM_NOTIFICATIONS_SET_INFO_ML) \ + _(XrWorldMeshDetectorCreateInfoML, XR_TYPE_WORLD_MESH_DETECTOR_CREATE_INFO_ML) \ + _(XrWorldMeshBlockStateML, XR_TYPE_WORLD_MESH_BLOCK_STATE_ML) \ + _(XrWorldMeshStateRequestInfoML, XR_TYPE_WORLD_MESH_STATE_REQUEST_INFO_ML) \ + _(XrWorldMeshStateRequestCompletionML, XR_TYPE_WORLD_MESH_STATE_REQUEST_COMPLETION_ML) \ + _(XrWorldMeshBufferRecommendedSizeInfoML, XR_TYPE_WORLD_MESH_BUFFER_RECOMMENDED_SIZE_INFO_ML) \ + _(XrWorldMeshBufferSizeML, XR_TYPE_WORLD_MESH_BUFFER_SIZE_ML) \ + _(XrWorldMeshBufferML, XR_TYPE_WORLD_MESH_BUFFER_ML) \ + _(XrWorldMeshBlockRequestML, XR_TYPE_WORLD_MESH_BLOCK_REQUEST_ML) \ + _(XrWorldMeshGetInfoML, XR_TYPE_WORLD_MESH_GET_INFO_ML) \ + _(XrWorldMeshBlockML, XR_TYPE_WORLD_MESH_BLOCK_ML) \ + _(XrWorldMeshRequestCompletionInfoML, XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_INFO_ML) \ + _(XrWorldMeshRequestCompletionML, XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_ML) \ #if defined(XR_USE_GRAPHICS_API_D3D11) @@ -5108,6 +5568,18 @@ XR_ENUM_STR(XrResult); #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D12(_) #endif +#if defined(XR_USE_GRAPHICS_API_METAL) +/// Implementation detail of XR_LIST_STRUCTURE_TYPES() +/// Structure types available only when XR_USE_GRAPHICS_API_METAL is defined +#define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_METAL(_) \ + _(XrGraphicsBindingMetalKHR, XR_TYPE_GRAPHICS_BINDING_METAL_KHR) \ + _(XrSwapchainImageMetalKHR, XR_TYPE_SWAPCHAIN_IMAGE_METAL_KHR) \ + _(XrGraphicsRequirementsMetalKHR, XR_TYPE_GRAPHICS_REQUIREMENTS_METAL_KHR) \ + +#else +#define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_METAL(_) +#endif + #if defined(XR_USE_GRAPHICS_API_OPENGL) /// Implementation detail of XR_LIST_STRUCTURE_TYPES() /// Structure types available only when XR_USE_GRAPHICS_API_OPENGL is defined @@ -5264,6 +5736,7 @@ XR_ENUM_STR(XrResult); _(XR_KHR_vulkan_enable, 26) \ _(XR_KHR_D3D11_enable, 28) \ _(XR_KHR_D3D12_enable, 29) \ + _(XR_KHR_metal_enable, 30) \ _(XR_EXT_eye_gaze_interaction, 31) \ _(XR_KHR_visibility_mask, 32) \ _(XR_EXTX_overlay, 34) \ @@ -5340,6 +5813,8 @@ XR_ENUM_STR(XrResult); _(XR_ML_compat, 138) \ _(XR_ML_marker_understanding, 139) \ _(XR_ML_localization_map, 140) \ + _(XR_ML_spatial_anchors, 141) \ + _(XR_ML_spatial_anchors_storage, 142) \ _(XR_MSFT_spatial_anchor_persistence, 143) \ _(XR_MSFT_scene_marker, 148) \ _(XR_ULTRALEAP_hand_tracking_forearm, 150) \ @@ -5390,6 +5865,7 @@ XR_ENUM_STR(XrResult); _(XR_HTC_passthrough, 318) \ _(XR_HTC_foveation, 319) \ _(XR_HTC_anchor, 320) \ + _(XR_HTC_body_tracking, 321) \ _(XR_EXT_active_action_set_priority, 374) \ _(XR_MNDX_force_feedback_curl, 376) \ _(XR_BD_controller_interaction, 385) \ @@ -5401,6 +5877,9 @@ XR_ENUM_STR(XrResult); _(XR_EXT_user_presence, 471) \ _(XR_KHR_locate_spaces, 472) \ _(XR_ML_user_calibration, 473) \ + _(XR_ML_system_notifications, 474) \ + _(XR_ML_world_mesh_detection, 475) \ + _(XR_ML_view_configuration_depth_range_change, 484) \ _(XR_YVR_controller_interaction, 498) \ _(XR_EXT_composition_layer_inverted_alpha, 555) \ _(XR_KHR_maintenance1, 711) \ @@ -5546,6 +6025,14 @@ XR_ENUM_STR(XrResult); _(GetD3D12GraphicsRequirementsKHR, KHR_D3D12_enable) \ +/// For every function defined by XR_KHR_metal_enable 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_KHR_metal_enable(_) \ + _(GetMetalGraphicsRequirementsKHR, KHR_metal_enable) \ + + /// For every function defined by XR_KHR_visibility_mask 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, @@ -5932,6 +6419,33 @@ XR_ENUM_STR(XrResult); _(GetExportedLocalizationMapDataML, ML_localization_map) \ +/// For every function defined by XR_ML_spatial_anchors 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_ML_spatial_anchors(_) \ + _(CreateSpatialAnchorsAsyncML, ML_spatial_anchors) \ + _(CreateSpatialAnchorsCompleteML, ML_spatial_anchors) \ + _(GetSpatialAnchorStateML, ML_spatial_anchors) \ + + +/// For every function defined by XR_ML_spatial_anchors_storage 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_ML_spatial_anchors_storage(_) \ + _(CreateSpatialAnchorsStorageML, ML_spatial_anchors_storage) \ + _(DestroySpatialAnchorsStorageML, ML_spatial_anchors_storage) \ + _(QuerySpatialAnchorsAsyncML, ML_spatial_anchors_storage) \ + _(QuerySpatialAnchorsCompleteML, ML_spatial_anchors_storage) \ + _(PublishSpatialAnchorsAsyncML, ML_spatial_anchors_storage) \ + _(PublishSpatialAnchorsCompleteML, ML_spatial_anchors_storage) \ + _(DeleteSpatialAnchorsAsyncML, ML_spatial_anchors_storage) \ + _(DeleteSpatialAnchorsCompleteML, ML_spatial_anchors_storage) \ + _(UpdateSpatialAnchorsExpirationAsyncML, ML_spatial_anchors_storage) \ + _(UpdateSpatialAnchorsExpirationCompleteML, ML_spatial_anchors_storage) \ + + /// For every function defined by XR_MSFT_spatial_anchor_persistence 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, @@ -6220,6 +6734,17 @@ XR_ENUM_STR(XrResult); _(GetSpatialAnchorNameHTC, HTC_anchor) \ +/// For every function defined by XR_HTC_body_tracking 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_HTC_body_tracking(_) \ + _(CreateBodyTrackerHTC, HTC_body_tracking) \ + _(DestroyBodyTrackerHTC, HTC_body_tracking) \ + _(LocateBodyJointsHTC, HTC_body_tracking) \ + _(GetBodySkeletonHTC, HTC_body_tracking) \ + + /// For every function defined by XR_MNDX_force_feedback_curl 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, @@ -6258,6 +6783,30 @@ XR_ENUM_STR(XrResult); _(EnableUserCalibrationEventsML, ML_user_calibration) \ +/// For every function defined by XR_ML_system_notifications 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_ML_system_notifications(_) \ + _(SetSystemNotificationsML, ML_system_notifications) \ + + +/// For every function defined by XR_ML_world_mesh_detection 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_ML_world_mesh_detection(_) \ + _(CreateWorldMeshDetectorML, ML_world_mesh_detection) \ + _(DestroyWorldMeshDetectorML, ML_world_mesh_detection) \ + _(RequestWorldMeshStateAsyncML, ML_world_mesh_detection) \ + _(RequestWorldMeshStateCompleteML, ML_world_mesh_detection) \ + _(GetWorldMeshBufferRecommendSizeML, ML_world_mesh_detection) \ + _(AllocateWorldMeshBufferML, ML_world_mesh_detection) \ + _(FreeWorldMeshBufferML, ML_world_mesh_detection) \ + _(RequestWorldMeshAsyncML, ML_world_mesh_detection) \ + _(RequestWorldMeshCompleteML, ML_world_mesh_detection) \ + + #endif diff --git a/thirdparty/openxr/include/openxr/openxr_reflection_parent_structs.h b/thirdparty/openxr/include/openxr/openxr_reflection_parent_structs.h index 50466abc1bb..bffab47cc57 100644 --- a/thirdparty/openxr/include/openxr/openxr_reflection_parent_structs.h +++ b/thirdparty/openxr/include/openxr/openxr_reflection_parent_structs.h @@ -238,6 +238,53 @@ 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 XrSpatialAnchorsCreateInfoBaseHeaderML +#define XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsCreateInfoBaseHeaderML(_avail, _unavail) \ + _impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsCreateInfoBaseHeaderML_CORE(_avail, _unavail) \ + + +// Implementation detail of XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsCreateInfoBaseHeaderML() +#define _impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsCreateInfoBaseHeaderML_CORE(_avail, _unavail) \ + _avail(XrSpatialAnchorsCreateInfoFromPoseML, XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_POSE_ML) \ + _avail(XrSpatialAnchorsCreateInfoFromUuidsML, XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_UUIDS_ML) \ + + + + + +/// 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(XrCreateSpatialAnchorsCompletionML, XR_TYPE_CREATE_SPATIAL_ANCHORS_COMPLETION_ML) \ + _avail(XrSpatialAnchorsQueryCompletionML, XR_TYPE_SPATIAL_ANCHORS_QUERY_COMPLETION_ML) \ + _avail(XrSpatialAnchorsPublishCompletionML, XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_ML) \ + _avail(XrSpatialAnchorsDeleteCompletionML, XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_ML) \ + _avail(XrSpatialAnchorsUpdateExpirationCompletionML, XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_ML) \ + _avail(XrFutureCompletionEXT, XR_TYPE_FUTURE_COMPLETION_EXT) \ + _avail(XrWorldMeshStateRequestCompletionML, XR_TYPE_WORLD_MESH_STATE_REQUEST_COMPLETION_ML) \ + _avail(XrWorldMeshRequestCompletionML, XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_ML) \ + + + + + +/// Like XR_LIST_ALL_STRUCTURE_TYPES, but only includes types whose parent struct type is XrSpatialAnchorsQueryInfoBaseHeaderML +#define XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsQueryInfoBaseHeaderML(_avail, _unavail) \ + _impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsQueryInfoBaseHeaderML_CORE(_avail, _unavail) \ + + +// Implementation detail of XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsQueryInfoBaseHeaderML() +#define _impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpatialAnchorsQueryInfoBaseHeaderML_CORE(_avail, _unavail) \ + _avail(XrSpatialAnchorsQueryInfoRadiusML, XR_TYPE_SPATIAL_ANCHORS_QUERY_INFO_RADIUS_ML) \ + + + + + /// Like XR_LIST_ALL_STRUCTURE_TYPES, but only includes types whose parent struct type is XrSpaceQueryInfoBaseHeaderFB #define XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpaceQueryInfoBaseHeaderFB(_avail, _unavail) \ _impl_XR_LIST_ALL_CHILD_STRUCTURE_TYPES_XrSpaceQueryInfoBaseHeaderFB_CORE(_avail, _unavail) \ @@ -265,18 +312,5 @@ 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 diff --git a/thirdparty/openxr/include/openxr/openxr_reflection_structs.h b/thirdparty/openxr/include/openxr/openxr_reflection_structs.h index e87e55b5600..b1ab8e7779c 100644 --- a/thirdparty/openxr/include/openxr/openxr_reflection_structs.h +++ b/thirdparty/openxr/include/openxr/openxr_reflection_structs.h @@ -27,6 +27,7 @@ This file contains expansion macros (X Macros) for OpenXR structures. _impl_XR_LIST_ALL_STRUCTURE_TYPES_CORE(_avail, _unavail) \ _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D11(_avail, _unavail) \ _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D12(_avail, _unavail) \ + _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_METAL(_avail, _unavail) \ _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL(_avail, _unavail) \ _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WAYLAND(_avail, _unavail) \ _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_WIN32(_avail, _unavail) \ @@ -242,6 +243,22 @@ This file contains expansion macros (X Macros) for OpenXR structures. _avail(XrMapLocalizationRequestInfoML, XR_TYPE_MAP_LOCALIZATION_REQUEST_INFO_ML) \ _avail(XrLocalizationMapImportInfoML, XR_TYPE_LOCALIZATION_MAP_IMPORT_INFO_ML) \ _avail(XrLocalizationEnableEventsInfoML, XR_TYPE_LOCALIZATION_ENABLE_EVENTS_INFO_ML) \ + _avail(XrSpatialAnchorsCreateInfoFromPoseML, XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_POSE_ML) \ + _avail(XrCreateSpatialAnchorsCompletionML, XR_TYPE_CREATE_SPATIAL_ANCHORS_COMPLETION_ML) \ + _avail(XrSpatialAnchorStateML, XR_TYPE_SPATIAL_ANCHOR_STATE_ML) \ + _avail(XrSpatialAnchorsCreateStorageInfoML, XR_TYPE_SPATIAL_ANCHORS_CREATE_STORAGE_INFO_ML) \ + _avail(XrSpatialAnchorsQueryInfoRadiusML, XR_TYPE_SPATIAL_ANCHORS_QUERY_INFO_RADIUS_ML) \ + _avail(XrSpatialAnchorsQueryCompletionML, XR_TYPE_SPATIAL_ANCHORS_QUERY_COMPLETION_ML) \ + _avail(XrSpatialAnchorsCreateInfoFromUuidsML, XR_TYPE_SPATIAL_ANCHORS_CREATE_INFO_FROM_UUIDS_ML) \ + _avail(XrSpatialAnchorsPublishInfoML, XR_TYPE_SPATIAL_ANCHORS_PUBLISH_INFO_ML) \ + _avail(XrSpatialAnchorsPublishCompletionML, XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_ML) \ + _avail(XrSpatialAnchorsDeleteInfoML, XR_TYPE_SPATIAL_ANCHORS_DELETE_INFO_ML) \ + _avail(XrSpatialAnchorsDeleteCompletionML, XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_ML) \ + _avail(XrSpatialAnchorsUpdateExpirationInfoML, XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_INFO_ML) \ + _avail(XrSpatialAnchorsUpdateExpirationCompletionML, XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_ML) \ + _avail(XrSpatialAnchorsPublishCompletionDetailsML, XR_TYPE_SPATIAL_ANCHORS_PUBLISH_COMPLETION_DETAILS_ML) \ + _avail(XrSpatialAnchorsDeleteCompletionDetailsML, XR_TYPE_SPATIAL_ANCHORS_DELETE_COMPLETION_DETAILS_ML) \ + _avail(XrSpatialAnchorsUpdateExpirationCompletionDetailsML, XR_TYPE_SPATIAL_ANCHORS_UPDATE_EXPIRATION_COMPLETION_DETAILS_ML) \ _avail(XrSpatialAnchorPersistenceInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_PERSISTENCE_INFO_MSFT) \ _avail(XrSpatialAnchorFromPersistedAnchorCreateInfoMSFT, XR_TYPE_SPATIAL_ANCHOR_FROM_PERSISTED_ANCHOR_CREATE_INFO_MSFT) \ _avail(XrSceneMarkersMSFT, XR_TYPE_SCENE_MARKERS_MSFT) \ @@ -341,6 +358,11 @@ This file contains expansion macros (X Macros) for OpenXR structures. _avail(XrFoveationCustomModeInfoHTC, XR_TYPE_FOVEATION_CUSTOM_MODE_INFO_HTC) \ _avail(XrSystemAnchorPropertiesHTC, XR_TYPE_SYSTEM_ANCHOR_PROPERTIES_HTC) \ _avail(XrSpatialAnchorCreateInfoHTC, XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_HTC) \ + _avail(XrSystemBodyTrackingPropertiesHTC, XR_TYPE_SYSTEM_BODY_TRACKING_PROPERTIES_HTC) \ + _avail(XrBodyTrackerCreateInfoHTC, XR_TYPE_BODY_TRACKER_CREATE_INFO_HTC) \ + _avail(XrBodyJointsLocateInfoHTC, XR_TYPE_BODY_JOINTS_LOCATE_INFO_HTC) \ + _avail(XrBodyJointLocationsHTC, XR_TYPE_BODY_JOINT_LOCATIONS_HTC) \ + _avail(XrBodySkeletonHTC, XR_TYPE_BODY_SKELETON_HTC) \ _avail(XrActiveActionSetPrioritiesEXT, XR_TYPE_ACTIVE_ACTION_SET_PRIORITIES_EXT) \ _avail(XrSystemForceFeedbackCurlPropertiesMNDX, XR_TYPE_SYSTEM_FORCE_FEEDBACK_CURL_PROPERTIES_MNDX) \ _avail(XrForceFeedbackCurlApplyLocationsMNDX, XR_TYPE_FORCE_FEEDBACK_CURL_APPLY_LOCATIONS_MNDX) \ @@ -362,6 +384,19 @@ This file contains expansion macros (X Macros) for OpenXR structures. _avail(XrEventDataHeadsetFitChangedML, XR_TYPE_EVENT_DATA_HEADSET_FIT_CHANGED_ML) \ _avail(XrEventDataEyeCalibrationChangedML, XR_TYPE_EVENT_DATA_EYE_CALIBRATION_CHANGED_ML) \ _avail(XrUserCalibrationEnableEventsInfoML, XR_TYPE_USER_CALIBRATION_ENABLE_EVENTS_INFO_ML) \ + _avail(XrSystemNotificationsSetInfoML, XR_TYPE_SYSTEM_NOTIFICATIONS_SET_INFO_ML) \ + _avail(XrWorldMeshDetectorCreateInfoML, XR_TYPE_WORLD_MESH_DETECTOR_CREATE_INFO_ML) \ + _avail(XrWorldMeshBlockStateML, XR_TYPE_WORLD_MESH_BLOCK_STATE_ML) \ + _avail(XrWorldMeshStateRequestInfoML, XR_TYPE_WORLD_MESH_STATE_REQUEST_INFO_ML) \ + _avail(XrWorldMeshStateRequestCompletionML, XR_TYPE_WORLD_MESH_STATE_REQUEST_COMPLETION_ML) \ + _avail(XrWorldMeshBufferRecommendedSizeInfoML, XR_TYPE_WORLD_MESH_BUFFER_RECOMMENDED_SIZE_INFO_ML) \ + _avail(XrWorldMeshBufferSizeML, XR_TYPE_WORLD_MESH_BUFFER_SIZE_ML) \ + _avail(XrWorldMeshBufferML, XR_TYPE_WORLD_MESH_BUFFER_ML) \ + _avail(XrWorldMeshBlockRequestML, XR_TYPE_WORLD_MESH_BLOCK_REQUEST_ML) \ + _avail(XrWorldMeshGetInfoML, XR_TYPE_WORLD_MESH_GET_INFO_ML) \ + _avail(XrWorldMeshBlockML, XR_TYPE_WORLD_MESH_BLOCK_ML) \ + _avail(XrWorldMeshRequestCompletionInfoML, XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_INFO_ML) \ + _avail(XrWorldMeshRequestCompletionML, XR_TYPE_WORLD_MESH_REQUEST_COMPLETION_ML) \ #if defined(XR_USE_GRAPHICS_API_D3D11) @@ -392,6 +427,20 @@ This file contains expansion macros (X Macros) for OpenXR structures. #endif +#if defined(XR_USE_GRAPHICS_API_METAL) +#define _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_METAL(_avail, _unavail) \ + _avail(XrGraphicsBindingMetalKHR, XR_TYPE_GRAPHICS_BINDING_METAL_KHR) \ + _avail(XrSwapchainImageMetalKHR, XR_TYPE_SWAPCHAIN_IMAGE_METAL_KHR) \ + _avail(XrGraphicsRequirementsMetalKHR, XR_TYPE_GRAPHICS_REQUIREMENTS_METAL_KHR) \ + +#else +#define _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_METAL(_avail, _unavail) \ + _unavail(XrGraphicsBindingMetalKHR, XR_TYPE_GRAPHICS_BINDING_METAL_KHR) \ + _unavail(XrSwapchainImageMetalKHR, XR_TYPE_SWAPCHAIN_IMAGE_METAL_KHR) \ + _unavail(XrGraphicsRequirementsMetalKHR, XR_TYPE_GRAPHICS_REQUIREMENTS_METAL_KHR) \ + +#endif + #if defined(XR_USE_GRAPHICS_API_OPENGL) #define _impl_XR_LIST_ALL_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL(_avail, _unavail) \ _avail(XrSwapchainImageOpenGLKHR, XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR) \ diff --git a/thirdparty/openxr/src/common/platform_utils.hpp b/thirdparty/openxr/src/common/platform_utils.hpp index d047c17d9d9..19cd41cbb25 100644 --- a/thirdparty/openxr/src/common/platform_utils.hpp +++ b/thirdparty/openxr/src/common/platform_utils.hpp @@ -91,21 +91,22 @@ namespace detail { static inline char* ImplGetEnv(const char* name) { return getenv(name); } +// clang-format off static inline char* ImplGetSecureEnv(const char* name) { #ifdef HAVE_SECURE_GETENV return secure_getenv(name); #elif defined(HAVE___SECURE_GETENV) return __secure_getenv(name); #else -// clang-format off #pragma message( \ "Warning: Falling back to non-secure getenv for environmental" \ "lookups! Consider updating to a different libc.") - // clang-format on return ImplGetEnv(name); #endif } +// clang-format on + } // namespace detail #endif // defined(XR_OS_LINUX) || defined(XR_OS_APPLE) diff --git a/thirdparty/openxr/src/common/xr_linear.h b/thirdparty/openxr/src/common/xr_linear.h index 2b295ed304a..cc525d3357a 100644 --- a/thirdparty/openxr/src/common/xr_linear.h +++ b/thirdparty/openxr/src/common/xr_linear.h @@ -134,7 +134,7 @@ static const XrColor4f XrColorCyan = {0.0f, 1.0f, 1.0f, 1.0f}; static const XrColor4f XrColorLightGrey = {0.7f, 0.7f, 0.7f, 1.0f}; static const XrColor4f XrColorDarkGrey = {0.3f, 0.3f, 0.3f, 1.0f}; -typedef enum GraphicsAPI { GRAPHICS_VULKAN, GRAPHICS_OPENGL, GRAPHICS_OPENGL_ES, GRAPHICS_D3D } GraphicsAPI; +typedef enum GraphicsAPI { GRAPHICS_VULKAN, GRAPHICS_OPENGL, GRAPHICS_OPENGL_ES, GRAPHICS_D3D, GRAPHICS_METAL } GraphicsAPI; // Column-major, pre-multiplied. This type does not exist in the OpenXR API and is provided for convenience. typedef struct XrMatrix4x4f { diff --git a/thirdparty/openxr/src/loader/android_utilities.cpp b/thirdparty/openxr/src/loader/android_utilities.cpp index 5c9b846b5ad..1f7424b8e6d 100644 --- a/thirdparty/openxr/src/loader/android_utilities.cpp +++ b/thirdparty/openxr/src/loader/android_utilities.cpp @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -82,7 +83,6 @@ static Uri makeContentUri(bool systemBroker, int majorVersion, const char *abi) .appendPath(abi) .appendPath(RUNTIMES_PATH) .appendPath(TABLE_PATH); - ContentUris::appendId(builder, 0); return builder.build(); } @@ -175,7 +175,6 @@ static inline jni::Array makeArray(std::initializer_list &dispatch_table = loader_instance->DispatchTable(); + const std::unique_ptr &dispatch_table = loader_instance->DispatchTable(); // If we allocated a default debug utils messenger, free it XrDebugUtilsMessengerEXT messenger = loader_instance->DefaultDebugUtilsMessenger(); @@ -546,7 +546,7 @@ LoaderTrampolineSessionBeginDebugUtilsLabelRegionEXT(XrSession session, const Xr return result; } LoaderLogger::GetInstance().BeginLabelRegion(session, labelInfo); - const std::unique_ptr &dispatch_table = loader_instance->DispatchTable(); + const std::unique_ptr &dispatch_table = loader_instance->DispatchTable(); if (nullptr != dispatch_table->SessionBeginDebugUtilsLabelRegionEXT) { return dispatch_table->SessionBeginDebugUtilsLabelRegionEXT(session, labelInfo); } @@ -567,7 +567,7 @@ static XRAPI_ATTR XrResult XRAPI_CALL LoaderTrampolineSessionEndDebugUtilsLabelR } LoaderLogger::GetInstance().EndLabelRegion(session); - const std::unique_ptr &dispatch_table = loader_instance->DispatchTable(); + const std::unique_ptr &dispatch_table = loader_instance->DispatchTable(); if (nullptr != dispatch_table->SessionEndDebugUtilsLabelRegionEXT) { return dispatch_table->SessionEndDebugUtilsLabelRegionEXT(session); } @@ -597,7 +597,7 @@ LoaderTrampolineSessionInsertDebugUtilsLabelEXT(XrSession session, const XrDebug LoaderLogger::GetInstance().InsertLabel(session, labelInfo); - const std::unique_ptr &dispatch_table = loader_instance->DispatchTable(); + const std::unique_ptr &dispatch_table = loader_instance->DispatchTable(); if (nullptr != dispatch_table->SessionInsertDebugUtilsLabelEXT) { return dispatch_table->SessionInsertDebugUtilsLabelEXT(session, labelInfo); } @@ -643,7 +643,7 @@ XRAPI_ATTR XrResult XRAPI_CALL LoaderXrTermCreateDebugUtilsMessengerEXT(XrInstan "xrCreateDebugUtilsMessengerEXT", "invalid messenger pointer"); return XR_ERROR_VALIDATION_FAILURE; } - const XrGeneratedDispatchTable *dispatch_table = RuntimeInterface::GetDispatchTable(instance); + const XrGeneratedDispatchTableCore *dispatch_table = RuntimeInterface::GetDispatchTable(instance); XrResult result = XR_SUCCESS; // This extension is supported entirely by the loader which means the runtime may or may not support it. if (nullptr != dispatch_table->CreateDebugUtilsMessengerEXT) { @@ -664,7 +664,7 @@ XRLOADER_ABI_CATCH_FALLBACK XRAPI_ATTR XrResult XRAPI_CALL LoaderXrTermDestroyDebugUtilsMessengerEXT(XrDebugUtilsMessengerEXT messenger) XRLOADER_ABI_TRY { LoaderLogger::LogVerboseMessage("xrDestroyDebugUtilsMessengerEXT", "Entering loader terminator"); - const XrGeneratedDispatchTable *dispatch_table = RuntimeInterface::GetDebugUtilsMessengerDispatchTable(messenger); + const XrGeneratedDispatchTableCore *dispatch_table = RuntimeInterface::GetDebugUtilsMessengerDispatchTable(messenger); XrResult result = XR_SUCCESS; LoaderLogger::GetInstance().RemoveLogRecorder(MakeHandleGeneric(messenger)); RuntimeInterface::GetRuntime().ForgetDebugMessenger(messenger); @@ -684,7 +684,7 @@ XRAPI_ATTR XrResult XRAPI_CALL LoaderXrTermSubmitDebugUtilsMessageEXT( XrInstance instance, XrDebugUtilsMessageSeverityFlagsEXT messageSeverity, XrDebugUtilsMessageTypeFlagsEXT messageTypes, const XrDebugUtilsMessengerCallbackDataEXT *callbackData) XRLOADER_ABI_TRY { LoaderLogger::LogVerboseMessage("xrSubmitDebugUtilsMessageEXT", "Entering loader terminator"); - const XrGeneratedDispatchTable *dispatch_table = RuntimeInterface::GetDispatchTable(instance); + const XrGeneratedDispatchTableCore *dispatch_table = RuntimeInterface::GetDispatchTable(instance); XrResult result = XR_SUCCESS; if (nullptr != dispatch_table->SubmitDebugUtilsMessageEXT) { result = dispatch_table->SubmitDebugUtilsMessageEXT(instance, messageSeverity, messageTypes, callbackData); @@ -701,7 +701,7 @@ XRLOADER_ABI_CATCH_FALLBACK XRAPI_ATTR XrResult XRAPI_CALL LoaderXrTermSetDebugUtilsObjectNameEXT(XrInstance instance, const XrDebugUtilsObjectNameInfoEXT *nameInfo) XRLOADER_ABI_TRY { LoaderLogger::LogVerboseMessage("xrSetDebugUtilsObjectNameEXT", "Entering loader terminator"); - const XrGeneratedDispatchTable *dispatch_table = RuntimeInterface::GetDispatchTable(instance); + const XrGeneratedDispatchTableCore *dispatch_table = RuntimeInterface::GetDispatchTable(instance); XrResult result = XR_SUCCESS; if (nullptr != dispatch_table->SetDebugUtilsObjectNameEXT) { result = dispatch_table->SetDebugUtilsObjectNameEXT(instance, nameInfo); diff --git a/thirdparty/openxr/src/loader/loader_instance.cpp b/thirdparty/openxr/src/loader/loader_instance.cpp index f18230087f4..09521ecf471 100644 --- a/thirdparty/openxr/src/loader/loader_instance.cpp +++ b/thirdparty/openxr/src/loader/loader_instance.cpp @@ -278,12 +278,12 @@ LoaderInstance::LoaderInstance(XrInstance instance, const XrInstanceCreateInfo* : _runtime_instance(instance), _topmost_gipa(topmost_gipa), _api_layer_interfaces(std::move(api_layer_interfaces)), - _dispatch_table(new XrGeneratedDispatchTable{}) { + _dispatch_table(new XrGeneratedDispatchTableCore{}) { for (uint32_t ext = 0; ext < create_info->enabledExtensionCount; ++ext) { _enabled_extensions.push_back(create_info->enabledExtensionNames[ext]); } - GeneratedXrPopulateDispatchTable(_dispatch_table.get(), instance, topmost_gipa); + GeneratedXrPopulateDispatchTableCore(_dispatch_table.get(), instance, topmost_gipa); } LoaderInstance::~LoaderInstance() { diff --git a/thirdparty/openxr/src/loader/loader_instance.hpp b/thirdparty/openxr/src/loader/loader_instance.hpp index b99e6b047fd..93cd5dc6a47 100644 --- a/thirdparty/openxr/src/loader/loader_instance.hpp +++ b/thirdparty/openxr/src/loader/loader_instance.hpp @@ -23,7 +23,7 @@ #include class ApiLayerInterface; -struct XrGeneratedDispatchTable; +struct XrGeneratedDispatchTableCore; class LoaderInstance; // Manage the single loader instance that is available. @@ -54,7 +54,7 @@ class LoaderInstance { virtual ~LoaderInstance(); XrInstance GetInstanceHandle() { return _runtime_instance; } - const std::unique_ptr& DispatchTable() { return _dispatch_table; } + const std::unique_ptr& DispatchTable() { return _dispatch_table; } std::vector>& LayerInterfaces() { return _api_layer_interfaces; } bool ExtensionIsEnabled(const std::string& extension); XrDebugUtilsMessengerEXT DefaultDebugUtilsMessenger() { return _messenger; } @@ -71,7 +71,7 @@ class LoaderInstance { std::vector _enabled_extensions; std::vector> _api_layer_interfaces; - std::unique_ptr _dispatch_table; + std::unique_ptr _dispatch_table; // Internal debug messenger created during xrCreateInstance XrDebugUtilsMessengerEXT _messenger{XR_NULL_HANDLE}; }; diff --git a/thirdparty/openxr/src/loader/manifest_file.cpp b/thirdparty/openxr/src/loader/manifest_file.cpp index 4e3e5b49476..ca212d34357 100644 --- a/thirdparty/openxr/src/loader/manifest_file.cpp +++ b/thirdparty/openxr/src/loader/manifest_file.cpp @@ -75,11 +75,12 @@ static inline bool StringEndsWith(const std::string &value, const std::string &e } // If the file found is a manifest file name, add it to the out_files manifest list. -static void AddIfJson(const std::string &full_file, std::vector &manifest_files) { +static bool AddIfJson(const std::string &full_file, std::vector &manifest_files) { if (full_file.empty() || !StringEndsWith(full_file, ".json")) { - return; + return false; } manifest_files.push_back(full_file); + return true; } // Check the current path for any manifest files. If the provided search_path is a directory, look for @@ -381,7 +382,6 @@ static void ReadRuntimeDataFilesInRegistry(const std::string &runtime_registry_l if (ERROR_SUCCESS != open_value) { LoaderLogger::LogWarningMessage("", "ReadRuntimeDataFilesInRegistry - failed to open registry key " + full_registry_location); - return; } @@ -391,7 +391,23 @@ static void ReadRuntimeDataFilesInRegistry(const std::string &runtime_registry_l LoaderLogger::LogWarningMessage( "", "ReadRuntimeDataFilesInRegistry - failed to read registry value " + default_runtime_value_name); } else { - AddFilesInPath(wide_to_utf8(value_w), false, manifest_files); + // Not using AddFilesInPath here (as only api_layer manifest paths allow multiple + // separated paths) + // Small time-of-check vs time-of-use issue here but it mainly only affects the error message. + // It does not introduce a security defect. + std::string activeRuntimePath = wide_to_utf8(value_w); + if (FileSysUtilsIsRegularFile(activeRuntimePath)) { + // If the file exists, try to add it + std::string absolute_path; + FileSysUtilsGetAbsolutePath(activeRuntimePath, absolute_path); + if (!AddIfJson(absolute_path, manifest_files)) { + LoaderLogger::LogErrorMessage( + "", "ReadRuntimeDataFilesInRegistry - registry runtime path is not json " + activeRuntimePath); + } + } else { + LoaderLogger::LogErrorMessage( + "", "ReadRuntimeDataFilesInRegistry - registry runtime path does not exist " + activeRuntimePath); + } } RegCloseKey(hkey); @@ -757,8 +773,7 @@ void ApiLayerManifestFile::AddManifestFilesAndroid(const std::string &openxr_com } std::istringstream json_stream(std::string{buf, length}); - CreateIfValid(ManifestFileType::MANIFEST_TYPE_EXPLICIT_API_LAYER, filename, json_stream, - &ApiLayerManifestFile::LocateLibraryInAssets, manifest_files); + CreateIfValid(type, filename, json_stream, &ApiLayerManifestFile::LocateLibraryInAssets, manifest_files); } } #endif // defined(XR_USE_PLATFORM_ANDROID) && defined(XR_KHR_LOADER_INIT_SUPPORT) diff --git a/thirdparty/openxr/src/loader/runtime_interface.cpp b/thirdparty/openxr/src/loader/runtime_interface.cpp index a0296c738cc..32feea6dde6 100644 --- a/thirdparty/openxr/src/loader/runtime_interface.cpp +++ b/thirdparty/openxr/src/loader/runtime_interface.cpp @@ -126,6 +126,10 @@ XrResult RuntimeInterface::TryLoadingSingleRuntime(const std::string& openxr_com XrResult res = XR_ERROR_RUNTIME_FAILURE; if (nullptr != negotiate) { res = negotiate(&loader_info, &runtime_info); + } else { + std::string error_message = "RuntimeInterface::LoadRuntime failed to find negotiate function "; + error_message += function_name; + LoaderLogger::LogErrorMessage(openxr_command, error_message); } // If we supposedly succeeded, but got a nullptr for GetInstanceProcAddr // then something still went wrong, so return with an error. @@ -270,8 +274,8 @@ XrResult RuntimeInterface::GetInstanceProcAddr(XrInstance instance, const char* return GetInstance()->_get_instance_proc_addr(instance, name, function); } -const XrGeneratedDispatchTable* RuntimeInterface::GetDispatchTable(XrInstance instance) { - XrGeneratedDispatchTable* table = nullptr; +const XrGeneratedDispatchTableCore* RuntimeInterface::GetDispatchTable(XrInstance instance) { + XrGeneratedDispatchTableCore* table = nullptr; std::lock_guard mlock(GetInstance()->_dispatch_table_mutex); auto it = GetInstance()->_dispatch_table_map.find(instance); if (it != GetInstance()->_dispatch_table_map.end()) { @@ -280,7 +284,7 @@ const XrGeneratedDispatchTable* RuntimeInterface::GetDispatchTable(XrInstance in return table; } -const XrGeneratedDispatchTable* RuntimeInterface::GetDebugUtilsMessengerDispatchTable(XrDebugUtilsMessengerEXT messenger) { +const XrGeneratedDispatchTableCore* RuntimeInterface::GetDebugUtilsMessengerDispatchTable(XrDebugUtilsMessengerEXT messenger) { XrInstance runtime_instance = XR_NULL_HANDLE; { std::lock_guard mlock(GetInstance()->_messenger_to_instance_mutex); @@ -349,8 +353,8 @@ XrResult RuntimeInterface::CreateInstance(const XrInstanceCreateInfo* info, XrIn res = rt_xrCreateInstance(info, instance); if (XR_SUCCEEDED(res)) { create_succeeded = true; - std::unique_ptr dispatch_table(new XrGeneratedDispatchTable()); - GeneratedXrPopulateDispatchTable(dispatch_table.get(), *instance, _get_instance_proc_addr); + std::unique_ptr dispatch_table(new XrGeneratedDispatchTableCore()); + GeneratedXrPopulateDispatchTableCore(dispatch_table.get(), *instance, _get_instance_proc_addr); std::lock_guard mlock(_dispatch_table_mutex); _dispatch_table_map[*instance] = std::move(dispatch_table); } diff --git a/thirdparty/openxr/src/loader/runtime_interface.hpp b/thirdparty/openxr/src/loader/runtime_interface.hpp index 093f8ba767f..3d45b129460 100644 --- a/thirdparty/openxr/src/loader/runtime_interface.hpp +++ b/thirdparty/openxr/src/loader/runtime_interface.hpp @@ -24,7 +24,7 @@ class Value; } class RuntimeManifestFile; -struct XrGeneratedDispatchTable; +struct XrGeneratedDispatchTableCore; class RuntimeInterface { public: @@ -37,8 +37,8 @@ class RuntimeInterface { static XrResult GetInstanceProcAddr(XrInstance instance, const char* name, PFN_xrVoidFunction* function); // Get the direct dispatch table to this runtime, without API layers or loader terminators. - static const XrGeneratedDispatchTable* GetDispatchTable(XrInstance instance); - static const XrGeneratedDispatchTable* GetDebugUtilsMessengerDispatchTable(XrDebugUtilsMessengerEXT messenger); + static const XrGeneratedDispatchTableCore* GetDispatchTable(XrInstance instance); + static const XrGeneratedDispatchTableCore* GetDebugUtilsMessengerDispatchTable(XrDebugUtilsMessengerEXT messenger); void GetInstanceExtensionProperties(std::vector& extension_properties); bool SupportsExtension(const std::string& extension_name); @@ -66,7 +66,7 @@ class RuntimeInterface { LoaderPlatformLibraryHandle _runtime_library; PFN_xrGetInstanceProcAddr _get_instance_proc_addr; - std::unordered_map> _dispatch_table_map; + std::unordered_map> _dispatch_table_map; std::mutex _dispatch_table_mutex; std::unordered_map _messenger_to_instance_map; std::mutex _messenger_to_instance_mutex; diff --git a/thirdparty/openxr/src/loader/xr_generated_loader.cpp b/thirdparty/openxr/src/loader/xr_generated_loader.cpp index 7bddbdc3ea5..d7f1ed18c18 100644 --- a/thirdparty/openxr/src/loader/xr_generated_loader.cpp +++ b/thirdparty/openxr/src/loader/xr_generated_loader.cpp @@ -697,4 +697,17 @@ extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrStopHapticFeedback( } XRLOADER_ABI_CATCH_FALLBACK +extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrLocateSpaces( + XrSession session, + const XrSpacesLocateInfo* locateInfo, + XrSpaceLocations* spaceLocations) XRLOADER_ABI_TRY { + LoaderInstance* loader_instance; + XrResult result = ActiveLoaderInstance::Get(&loader_instance, "xrLocateSpaces"); + if (XR_SUCCEEDED(result)) { + result = loader_instance->DispatchTable()->LocateSpaces(session, locateInfo, spaceLocations); + } + return result; +} +XRLOADER_ABI_CATCH_FALLBACK + diff --git a/thirdparty/openxr/src/loader/xr_generated_loader.hpp b/thirdparty/openxr/src/loader/xr_generated_loader.hpp index 68a6b9470d6..9a6c9154219 100644 --- a/thirdparty/openxr/src/loader/xr_generated_loader.hpp +++ b/thirdparty/openxr/src/loader/xr_generated_loader.hpp @@ -245,6 +245,10 @@ extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrApplyHapticFeedback( extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrStopHapticFeedback( XrSession session, const XrHapticActionInfo* hapticActionInfo); +extern "C" LOADER_EXPORT XRAPI_ATTR XrResult XRAPI_CALL xrLocateSpaces( + XrSession session, + const XrSpacesLocateInfo* locateInfo, + XrSpaceLocations* spaceLocations); #ifdef __cplusplus } // extern "C" #endif diff --git a/thirdparty/openxr/src/xr_generated_dispatch_table_core.c b/thirdparty/openxr/src/xr_generated_dispatch_table_core.c index e73e8b2b950..aaf854704b3 100644 --- a/thirdparty/openxr/src/xr_generated_dispatch_table_core.c +++ b/thirdparty/openxr/src/xr_generated_dispatch_table_core.c @@ -37,7 +37,7 @@ extern "C" { #endif // Helper function to populate an instance dispatch table -void GeneratedXrPopulateDispatchTable(struct XrGeneratedDispatchTable *table, +void GeneratedXrPopulateDispatchTableCore(struct XrGeneratedDispatchTableCore *table, XrInstance instance, PFN_xrGetInstanceProcAddr get_inst_proc_addr) { @@ -96,6 +96,9 @@ void GeneratedXrPopulateDispatchTable(struct XrGeneratedDispatchTable *table, (get_inst_proc_addr(instance, "xrApplyHapticFeedback", (PFN_xrVoidFunction*)&table->ApplyHapticFeedback)); (get_inst_proc_addr(instance, "xrStopHapticFeedback", (PFN_xrVoidFunction*)&table->StopHapticFeedback)); + // ---- Core 1.1 commands + (get_inst_proc_addr(instance, "xrLocateSpaces", (PFN_xrVoidFunction*)&table->LocateSpaces)); + // ---- XR_EXT_debug_utils extension commands (get_inst_proc_addr(instance, "xrSetDebugUtilsObjectNameEXT", (PFN_xrVoidFunction*)&table->SetDebugUtilsObjectNameEXT)); (get_inst_proc_addr(instance, "xrCreateDebugUtilsMessengerEXT", (PFN_xrVoidFunction*)&table->CreateDebugUtilsMessengerEXT)); diff --git a/thirdparty/openxr/src/xr_generated_dispatch_table_core.h b/thirdparty/openxr/src/xr_generated_dispatch_table_core.h index 58712312676..69abf10b933 100644 --- a/thirdparty/openxr/src/xr_generated_dispatch_table_core.h +++ b/thirdparty/openxr/src/xr_generated_dispatch_table_core.h @@ -38,7 +38,7 @@ extern "C" { #endif // Generated dispatch table -struct XrGeneratedDispatchTable { +struct XrGeneratedDispatchTableCore { // ---- Core 1.0 commands PFN_xrGetInstanceProcAddr GetInstanceProcAddr; @@ -97,6 +97,9 @@ struct XrGeneratedDispatchTable { PFN_xrApplyHapticFeedback ApplyHapticFeedback; PFN_xrStopHapticFeedback StopHapticFeedback; + // ---- Core 1.1 commands + PFN_xrLocateSpaces LocateSpaces; + // ---- XR_EXT_debug_utils extension commands PFN_xrSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT; PFN_xrCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT; @@ -109,7 +112,7 @@ struct XrGeneratedDispatchTable { // Prototype for dispatch table helper function -void GeneratedXrPopulateDispatchTable(struct XrGeneratedDispatchTable *table, +void GeneratedXrPopulateDispatchTableCore(struct XrGeneratedDispatchTableCore *table, XrInstance instance, PFN_xrGetInstanceProcAddr get_inst_proc_addr);