From d15a933d529f1454e003e23706f2f1dbc10cd2a8 Mon Sep 17 00:00:00 2001 From: yl-msft Date: Wed, 30 Sep 2020 14:38:41 -0700 Subject: [PATCH] Update to openxr SDK 1.0.12 (#66) * Update to openxr SDK 1.0.12 * Fix CI build --- README.md | 18 +- openxr_preview/include/openxr/openxr.h | 84 +- .../include/openxr/openxr_platform.h | 103 +- .../include/openxr/openxr_platform_defines.h | 2 +- .../include/openxr/openxr_reflection.h | 107 +- openxr_preview/specs/openxr.html | 3155 +++++++++++++++-- samples/SampleSceneWin32/Main.cpp | 2 +- shared/SampleShared/SampleShared_uwp.vcxproj | 1 - .../SampleShared_uwp.vcxproj.filters | 1 - .../SampleShared/SampleShared_win32.vcxproj | 1 - .../SampleShared_win32.vcxproj.filters | 1 - shared/XrSceneLib/PbrModelObject.cpp | 31 + shared/XrSceneLib/PbrModelObject.h | 21 + shared/XrSceneLib/SpaceObject.cpp | 6 +- shared/XrSceneLib/SpaceObject.h | 4 +- shared/XrUtility/XrExtensionContext.h | 4 +- shared/XrUtility/XrExtensions.h | 2 +- shared/XrUtility/XrGuid.h | 2 +- shared/XrUtility/XrMath.h | 30 + 19 files changed, 3185 insertions(+), 390 deletions(-) diff --git a/README.md b/README.md index 5bf8268..a3f6b4a 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,6 @@ or choose x64 platform when running on a Windows Desktop PC with the HoloLens 2 The [openxr_preview](https://github.com/microsoft/OpenXR-MixedReality/tree/master/openxr_preview) folder contains a set of [preview header files](https://github.com/microsoft/OpenXR-MixedReality/tree/master/openxr_preview/include/openxr) containing the following OpenXR extensions that are only available [in preview runtime](http://aka.ms/openxr-preview). -1. [XR_MSFT_controller_model_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_controller_model_preview) - 1. [XR_MSFT_spatial_anchor_export_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_spatial_anchor_export_preview) 1. [XR_MSFT_perception_anchor_interop_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_perception_anchor_interop_preview) @@ -49,8 +47,8 @@ captures a typical OpenXR app code flow for session initialization, event handli - **Hand tracking**
The [Scene_HandTracking.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/samples/SampleSceneUwp/Scene_HandTracking.cpp) -demos the usage of [XR_EXT_hand_tracking](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_EXT_hand_tracking) -and [XR_MSFT_hand_tracking_mesh](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_hand_tracking_mesh) extensions. +demos the usage of [XR_EXT_hand_tracking](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_EXT_hand_tracking) +and [XR_MSFT_hand_tracking_mesh](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_hand_tracking_mesh) extensions. - **Eye tracking**
The [Scene_EyeGazeInteraction.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/samples/EyeGazeInteractionUwp/Scene_EyeGazeInteraction.cpp) file @@ -58,13 +56,13 @@ demos the usage of [XR_EXT_eye_gaze_interaction](https://www.khronos.org/registr - **Mixed reality capture support**
Search "secondary" in [XrApp.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/shared/XrSceneLib/XrApp.cpp) file -to understand the usage of [XR_MSFT_secondary_view_configuration](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_secondary_view_configuration) -and [XR_MSFT_first_person_observer](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_first_person_observer) extensions. +to understand the usage of [XR_MSFT_secondary_view_configuration](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_secondary_view_configuration) +and [XR_MSFT_first_person_observer](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_first_person_observer) extensions. - **Render the motion controller model**
The [ControllerObject.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/shared/XrSceneLib/ControllerObject.cpp) and [Scene_ControllerModel.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/samples/SampleSceneWin32/Scene_ControllerModel.cpp) files -demos the usage of [XR_MSFT_controller_model_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_controller_model_preview) extension. +demos the usage of [XR_MSFT_controller_model](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_controller_model) extension. - **Holographic window attachment**
The [SampleSceneUwp/Main.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/samples/SampleSceneUwp/Main.cpp) file demos protocol activation for XR apps, @@ -74,9 +72,9 @@ and [TextEditingContext](https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Tex - **Understand the local, unbounded and anchor spaces**
The [ThreeSpacesUwp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/samples/ThreeSpacesUwp/Scene_ThreeSpaces.cpp) project -demos the usage and differences of [LOCAL](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#reference-spaces), -[UNBOUNDED](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_unbounded_reference_space) reference spaces -and [spatial anchors](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_spatial_anchor). +demos the usage and differences of [LOCAL](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#reference-spaces), +[UNBOUNDED](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_unbounded_reference_space) reference spaces +and [spatial anchors](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_spatial_anchor). * The sample code for [XR_MSFT_spatial_graph_bridge](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_spatial_graph_bridge) is coming soon ... diff --git a/openxr_preview/include/openxr/openxr.h b/openxr_preview/include/openxr/openxr.h index 694c1fd..69ead41 100644 --- a/openxr_preview/include/openxr/openxr.h +++ b/openxr_preview/include/openxr/openxr.h @@ -25,7 +25,7 @@ extern "C" { ((((major) & 0xffffULL) << 48) | (((minor) & 0xffffULL) << 32) | ((patch) & 0xffffffffULL)) // OpenXR current version number. -#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 10) +#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 12) #define XR_VERSION_MAJOR(version) (uint16_t)(((uint64_t)(version) >> 48)& 0xffffULL) #define XR_VERSION_MINOR(version) (uint16_t)(((uint64_t)(version) >> 32) & 0xffffULL) @@ -180,12 +180,12 @@ typedef enum XrResult { XR_ERROR_ACTIONSETS_ALREADY_ATTACHED = -47, XR_ERROR_LOCALIZED_NAME_DUPLICATED = -48, XR_ERROR_LOCALIZED_NAME_INVALID = -49, + XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING = -50, XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR = -1000003000, XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR = -1000003001, XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT = -1000039001, XR_ERROR_SECONDARY_VIEW_CONFIGURATION_TYPE_NOT_ENABLED_MSFT = -1000053000, - XR_ERROR_CONTROLLER_MODEL_UNAVAILABLE_MSFT = -1000055000, - XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT = -1000055001, + XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT = -1000055000, XR_SPATIAL_ANCHOR_EXPORT_DATA_UNAVAILABLE_MSFT = 1000062000, XR_ERROR_SPATIAL_ANCHOR_EXPORT_FAILED_MSFT = -1000062000, XR_ERROR_SPATIAL_ANCHOR_SUFFICIENCY_QUERY_FAILED_MSFT = -1000062001, @@ -278,6 +278,7 @@ typedef enum XrStructureType { XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR = 1000031001, XR_TYPE_SESSION_CREATE_INFO_OVERLAY_EXTX = 1000033000, XR_TYPE_EVENT_DATA_MAIN_SESSION_VISIBILITY_CHANGED_EXTX = 1000033003, + XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR = 1000034000, XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT = 1000039000, XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT = 1000039001, XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT = 1000046000, @@ -299,16 +300,24 @@ typedef enum XrStructureType { XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_END_INFO_MSFT = 1000053003, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_LAYER_INFO_MSFT = 1000053004, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SWAPCHAIN_CREATE_INFO_MSFT = 1000053005, - XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC = 1000059000, - XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT = 1000063000, - XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE = 1000079000, XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT = 1000055000, XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT = 1000055001, XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT = 1000055002, XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT = 1000055003, XR_TYPE_CONTROLLER_MODEL_STATE_MSFT = 1000055004, + XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC = 1000059000, + XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT = 1000063000, + XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE = 1000079000, + XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR = 1000089000, + XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR = 1000090000, + XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR = 1000090001, + XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR = 1000090003, + XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR = 1000091000, XR_TYPE_SPATIAL_ANCHOR_EXPORT_PURPOSE_INFO_MSFT = 1000062000, XR_TYPE_SPATIAL_ANCHOR_EXPORT_SUFFICIENCY_MSFT = 1000062001, + 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, XR_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF } XrStructureType; @@ -1398,6 +1407,53 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetVisibilityMaskKHR( #endif +#define XR_KHR_composition_layer_color_scale_bias 1 +#define XR_KHR_composition_layer_color_scale_bias_SPEC_VERSION 5 +#define XR_KHR_COMPOSITION_LAYER_COLOR_SCALE_BIAS_EXTENSION_NAME "XR_KHR_composition_layer_color_scale_bias" +typedef struct XrCompositionLayerColorScaleBiasKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrColor4f colorScale; + XrColor4f colorBias; +} XrCompositionLayerColorScaleBiasKHR; + + + +#define XR_KHR_loader_init 1 +#define XR_KHR_loader_init_SPEC_VERSION 1 +#define XR_KHR_LOADER_INIT_EXTENSION_NAME "XR_KHR_loader_init" +typedef struct XR_MAY_ALIAS XrLoaderInitInfoBaseHeaderKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; +} XrLoaderInitInfoBaseHeaderKHR; + +typedef XrResult (XRAPI_PTR *PFN_xrInitializeLoaderKHR)(const XrLoaderInitInfoBaseHeaderKHR* loaderInitInfo); + +#ifndef XR_NO_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrInitializeLoaderKHR( + const XrLoaderInitInfoBaseHeaderKHR* loaderInitInfo); +#endif + + +#define XR_KHR_composition_layer_equirect2 1 +#define XR_KHR_composition_layer_equirect2_SPEC_VERSION 1 +#define XR_KHR_COMPOSITION_LAYER_EQUIRECT2_EXTENSION_NAME "XR_KHR_composition_layer_equirect2" +typedef struct XrCompositionLayerEquirect2KHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrCompositionLayerFlags layerFlags; + XrSpace space; + XrEyeVisibility eyeVisibility; + XrSwapchainSubImage subImage; + XrPosef pose; + float radius; + float centralHorizontalAngle; + float upperVerticalAngle; + float lowerVerticalAngle; +} XrCompositionLayerEquirect2KHR; + + + #define XR_EXT_performance_settings 1 #define XR_EXT_performance_settings_SPEC_VERSION 1 #define XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME "XR_EXT_performance_settings" @@ -2009,15 +2065,13 @@ typedef struct XrSecondaryViewConfigurationSwapchainCreateInfoMSFT { #define XR_MSFT_FIRST_PERSON_OBSERVER_EXTENSION_NAME "XR_MSFT_first_person_observer" -#define XR_MSFT_controller_model_preview 1 +#define XR_MSFT_controller_model 1 #define XR_NULL_CONTROLLER_MODEL_KEY_MSFT 0 - - XR_DEFINE_ATOM(XrControllerModelKeyMSFT) - -#define XR_MSFT_controller_model_preview_SPEC_VERSION 1 -#define XR_MSFT_CONTROLLER_MODEL_PREVIEW_EXTENSION_NAME "XR_MSFT_controller_model_preview" +XR_DEFINE_ATOM(XrControllerModelKeyMSFT) +#define XR_MSFT_controller_model_SPEC_VERSION 2 +#define XR_MSFT_CONTROLLER_MODEL_EXTENSION_NAME "XR_MSFT_controller_model" #define XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT 64 typedef struct XrControllerModelKeyStateMSFT { XrStructureType type; @@ -2055,7 +2109,7 @@ typedef struct XrControllerModelStateMSFT { } XrControllerModelStateMSFT; typedef XrResult (XRAPI_PTR *PFN_xrGetControllerModelKeyMSFT)(XrSession session, XrPath topLevelUserPath, XrControllerModelKeyStateMSFT* controllerModelKeyState); -typedef XrResult (XRAPI_PTR *PFN_xrLoadControllerModelMSFT)(XrSession session, XrControllerModelKeyMSFT modelKey, uint32_t sizeInput, uint32_t* sizeOutput, uint8_t* buffer); +typedef XrResult (XRAPI_PTR *PFN_xrLoadControllerModelMSFT)(XrSession session, XrControllerModelKeyMSFT modelKey, uint32_t bufferCapacityInput, uint32_t* bufferCountOutput, uint8_t* buffer); typedef XrResult (XRAPI_PTR *PFN_xrGetControllerModelPropertiesMSFT)(XrSession session, XrControllerModelKeyMSFT modelKey, XrControllerModelPropertiesMSFT* properties); typedef XrResult (XRAPI_PTR *PFN_xrGetControllerModelStateMSFT)(XrSession session, XrControllerModelKeyMSFT modelKey, XrControllerModelStateMSFT* state); @@ -2068,8 +2122,8 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetControllerModelKeyMSFT( XRAPI_ATTR XrResult XRAPI_CALL xrLoadControllerModelMSFT( XrSession session, XrControllerModelKeyMSFT modelKey, - uint32_t sizeInput, - uint32_t* sizeOutput, + uint32_t bufferCapacityInput, + uint32_t* bufferCountOutput, uint8_t* buffer); XRAPI_ATTR XrResult XRAPI_CALL xrGetControllerModelPropertiesMSFT( diff --git a/openxr_preview/include/openxr/openxr_platform.h b/openxr_preview/include/openxr/openxr_platform.h index 1e11e8e..8cd600a 100644 --- a/openxr_preview/include/openxr/openxr_platform.h +++ b/openxr_preview/include/openxr/openxr_platform.h @@ -75,7 +75,7 @@ typedef struct XrInstanceCreateInfoAndroidKHR { #ifdef XR_USE_GRAPHICS_API_VULKAN #define XR_KHR_vulkan_swapchain_format_list 1 -#define XR_KHR_vulkan_swapchain_format_list_SPEC_VERSION 2 +#define XR_KHR_vulkan_swapchain_format_list_SPEC_VERSION 3 #define XR_KHR_VULKAN_SWAPCHAIN_FORMAT_LIST_EXTENSION_NAME "XR_KHR_vulkan_swapchain_format_list" typedef struct XrVulkanSwapchainFormatListCreateInfoKHR { XrStructureType type; @@ -89,7 +89,7 @@ typedef struct XrVulkanSwapchainFormatListCreateInfoKHR { #ifdef XR_USE_GRAPHICS_API_OPENGL #define XR_KHR_opengl_enable 1 -#define XR_KHR_opengl_enable_SPEC_VERSION 8 +#define XR_KHR_opengl_enable_SPEC_VERSION 9 #define XR_KHR_OPENGL_ENABLE_EXTENSION_NAME "XR_KHR_opengl_enable" #ifdef XR_USE_PLATFORM_WIN32 typedef struct XrGraphicsBindingOpenGLWin32KHR { @@ -159,7 +159,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLGraphicsRequirementsKHR( #ifdef XR_USE_GRAPHICS_API_OPENGL_ES #define XR_KHR_opengl_es_enable 1 -#define XR_KHR_opengl_es_enable_SPEC_VERSION 6 +#define XR_KHR_opengl_es_enable_SPEC_VERSION 7 #define XR_KHR_OPENGL_ES_ENABLE_EXTENSION_NAME "XR_KHR_opengl_es_enable" #ifdef XR_USE_PLATFORM_ANDROID typedef struct XrGraphicsBindingOpenGLESAndroidKHR { @@ -197,7 +197,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetOpenGLESGraphicsRequirementsKHR( #ifdef XR_USE_GRAPHICS_API_VULKAN #define XR_KHR_vulkan_enable 1 -#define XR_KHR_vulkan_enable_SPEC_VERSION 6 +#define XR_KHR_vulkan_enable_SPEC_VERSION 7 #define XR_KHR_VULKAN_ENABLE_EXTENSION_NAME "XR_KHR_vulkan_enable" typedef struct XrGraphicsBindingVulkanKHR { XrStructureType type; @@ -258,7 +258,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirementsKHR( #ifdef XR_USE_GRAPHICS_API_D3D11 #define XR_KHR_D3D11_enable 1 -#define XR_KHR_D3D11_enable_SPEC_VERSION 4 +#define XR_KHR_D3D11_enable_SPEC_VERSION 5 #define XR_KHR_D3D11_ENABLE_EXTENSION_NAME "XR_KHR_D3D11_enable" typedef struct XrGraphicsBindingD3D11KHR { XrStructureType type; @@ -292,7 +292,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrGetD3D11GraphicsRequirementsKHR( #ifdef XR_USE_GRAPHICS_API_D3D12 #define XR_KHR_D3D12_enable 1 -#define XR_KHR_D3D12_enable_SPEC_VERSION 6 +#define XR_KHR_D3D12_enable_SPEC_VERSION 7 #define XR_KHR_D3D12_ENABLE_EXTENSION_NAME "XR_KHR_D3D12_enable" typedef struct XrGraphicsBindingD3D12KHR { XrStructureType type; @@ -366,6 +366,97 @@ XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToTimespecTimeKHR( #endif #endif /* XR_USE_TIMESPEC */ +#ifdef XR_USE_PLATFORM_ANDROID + +#define XR_KHR_loader_init_android 1 +#define XR_KHR_loader_init_android_SPEC_VERSION 1 +#define XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME "XR_KHR_loader_init_android" +typedef struct XrLoaderInitInfoAndroidKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + void* XR_MAY_ALIAS applicationVM; + void* XR_MAY_ALIAS applicationContext; +} XrLoaderInitInfoAndroidKHR; + +#endif /* XR_USE_PLATFORM_ANDROID */ + +#ifdef XR_USE_GRAPHICS_API_VULKAN + +#define XR_KHR_vulkan_enable2 1 +#define XR_KHR_vulkan_enable2_SPEC_VERSION 1 +#define XR_KHR_VULKAN_ENABLE2_EXTENSION_NAME "XR_KHR_vulkan_enable2" +typedef XrFlags64 XrVulkanInstanceCreateFlagsKHR; + +// Flag bits for XrVulkanInstanceCreateFlagsKHR + +typedef XrFlags64 XrVulkanDeviceCreateFlagsKHR; + +// Flag bits for XrVulkanDeviceCreateFlagsKHR + +typedef struct XrVulkanInstanceCreateInfoKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSystemId systemId; + XrVulkanInstanceCreateFlagsKHR createFlags; + PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr; + const VkInstanceCreateInfo* vulkanCreateInfo; + const VkAllocationCallbacks* vulkanAllocator; +} XrVulkanInstanceCreateInfoKHR; + +typedef struct XrVulkanDeviceCreateInfoKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSystemId systemId; + XrVulkanDeviceCreateFlagsKHR createFlags; + PFN_vkGetInstanceProcAddr pfnGetInstanceProcAddr; + VkPhysicalDevice vulkanPhysicalDevice; + const VkDeviceCreateInfo* vulkanCreateInfo; + const VkAllocationCallbacks* vulkanAllocator; +} XrVulkanDeviceCreateInfoKHR; + +typedef XrGraphicsBindingVulkanKHR XrGraphicsBindingVulkan2KHR; + +typedef struct XrVulkanGraphicsDeviceGetInfoKHR { + XrStructureType type; + const void* XR_MAY_ALIAS next; + XrSystemId systemId; + VkInstance vulkanInstance; +} XrVulkanGraphicsDeviceGetInfoKHR; + +typedef XrSwapchainImageVulkanKHR XrSwapchainImageVulkan2KHR; + +typedef XrGraphicsRequirementsVulkanKHR XrGraphicsRequirementsVulkan2KHR; + +typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanInstanceKHR)(XrInstance instance, const XrVulkanInstanceCreateInfoKHR*createInfo, VkInstance* vulkanInstance, VkResult* vulkanResult); +typedef XrResult (XRAPI_PTR *PFN_xrCreateVulkanDeviceKHR)(XrInstance instance, const XrVulkanDeviceCreateInfoKHR* createInfo, VkDevice* vulkanDevice, VkResult* vulkanResult); +typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsDevice2KHR)(XrInstance instance, const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, VkPhysicalDevice* vulkanPhysicalDevice); +typedef XrResult (XRAPI_PTR *PFN_xrGetVulkanGraphicsRequirements2KHR)(XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsVulkanKHR* graphicsRequirements); + +#ifndef XR_NO_PROTOTYPES +XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanInstanceKHR( + XrInstance instance, + const XrVulkanInstanceCreateInfoKHR* createInfo, + VkInstance* vulkanInstance, + VkResult* vulkanResult); + +XRAPI_ATTR XrResult XRAPI_CALL xrCreateVulkanDeviceKHR( + XrInstance instance, + const XrVulkanDeviceCreateInfoKHR* createInfo, + VkDevice* vulkanDevice, + VkResult* vulkanResult); + +XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsDevice2KHR( + XrInstance instance, + const XrVulkanGraphicsDeviceGetInfoKHR* getInfo, + VkPhysicalDevice* vulkanPhysicalDevice); + +XRAPI_ATTR XrResult XRAPI_CALL xrGetVulkanGraphicsRequirements2KHR( + XrInstance instance, + XrSystemId systemId, + XrGraphicsRequirementsVulkanKHR* graphicsRequirements); +#endif +#endif /* XR_USE_GRAPHICS_API_VULKAN */ + #ifdef XR_USE_PLATFORM_EGL #define XR_MNDX_egl_enable 1 diff --git a/openxr_preview/include/openxr/openxr_platform_defines.h b/openxr_preview/include/openxr/openxr_platform_defines.h index 840f51a..45ccf0e 100644 --- a/openxr_preview/include/openxr/openxr_platform_defines.h +++ b/openxr_preview/include/openxr/openxr_platform_defines.h @@ -80,7 +80,7 @@ typedef unsigned __int64 uint64_t; #endif #endif -// Identifies if the current compiler has C++11 support enabled. +// Identifies if the current compiler has C++11 support enabled. // Does not by itself identify if any given C++11 feature is present. #if !defined(XR_CPP11_ENABLED) && defined(__cplusplus) #if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) diff --git a/openxr_preview/include/openxr/openxr_reflection.h b/openxr_preview/include/openxr/openxr_reflection.h index 63b13eb..b5e7ea1 100644 --- a/openxr_preview/include/openxr/openxr_reflection.h +++ b/openxr_preview/include/openxr/openxr_reflection.h @@ -84,12 +84,12 @@ XR_ENUM_STR(XrResult); _(XR_ERROR_ACTIONSETS_ALREADY_ATTACHED, -47) \ _(XR_ERROR_LOCALIZED_NAME_DUPLICATED, -48) \ _(XR_ERROR_LOCALIZED_NAME_INVALID, -49) \ + _(XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING, -50) \ _(XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR, -1000003000) \ _(XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR, -1000003001) \ _(XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT, -1000039001) \ _(XR_ERROR_SECONDARY_VIEW_CONFIGURATION_TYPE_NOT_ENABLED_MSFT, -1000053000) \ - _(XR_ERROR_CONTROLLER_MODEL_UNAVAILABLE_MSFT, -1000055000) \ - _(XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT, -1000055001) \ + _(XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT, -1000055000) \ _(XR_SPATIAL_ANCHOR_EXPORT_DATA_UNAVAILABLE_MSFT, 1000062000) \ _(XR_ERROR_SPATIAL_ANCHOR_EXPORT_FAILED_MSFT, -1000062000) \ _(XR_ERROR_SPATIAL_ANCHOR_SUFFICIENCY_QUERY_FAILED_MSFT, -1000062001) \ @@ -181,6 +181,7 @@ XR_ENUM_STR(XrResult); _(XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR, 1000031001) \ _(XR_TYPE_SESSION_CREATE_INFO_OVERLAY_EXTX, 1000033000) \ _(XR_TYPE_EVENT_DATA_MAIN_SESSION_VISIBILITY_CHANGED_EXTX, 1000033003) \ + _(XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR, 1000034000) \ _(XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT, 1000039000) \ _(XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT, 1000039001) \ _(XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT, 1000046000) \ @@ -202,14 +203,19 @@ XR_ENUM_STR(XrResult); _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_END_INFO_MSFT, 1000053003) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_LAYER_INFO_MSFT, 1000053004) \ _(XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SWAPCHAIN_CREATE_INFO_MSFT, 1000053005) \ - _(XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC, 1000059000) \ - _(XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT, 1000063000) \ - _(XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE, 1000079000) \ _(XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT, 1000055000) \ _(XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT, 1000055001) \ _(XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT, 1000055002) \ _(XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT, 1000055003) \ _(XR_TYPE_CONTROLLER_MODEL_STATE_MSFT, 1000055004) \ + _(XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC, 1000059000) \ + _(XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT, 1000063000) \ + _(XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE, 1000079000) \ + _(XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR, 1000089000) \ + _(XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR, 1000090000) \ + _(XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR, 1000090001) \ + _(XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR, 1000090003) \ + _(XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR, 1000091000) \ _(XR_TYPE_SPATIAL_ANCHOR_EXPORT_PURPOSE_INFO_MSFT, 1000062000) \ _(XR_TYPE_SPATIAL_ANCHOR_EXPORT_SUFFICIENCY_MSFT, 1000062001) \ _(XR_STRUCTURE_TYPE_MAX_ENUM, 0x7FFFFFFF) @@ -413,6 +419,10 @@ XR_ENUM_STR(XrResult); _(XR_INPUT_SOURCE_LOCALIZED_NAME_INTERACTION_PROFILE_BIT, 0x00000002) \ _(XR_INPUT_SOURCE_LOCALIZED_NAME_COMPONENT_BIT, 0x00000004) \ +#define XR_LIST_BITS_XrVulkanInstanceCreateFlagsKHR(_) + +#define XR_LIST_BITS_XrVulkanDeviceCreateFlagsKHR(_) + #define XR_LIST_BITS_XrDebugUtilsMessageSeverityFlagsEXT(_) \ _(XR_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT, 0x00000001) \ _(XR_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT, 0x00000010) \ @@ -1055,6 +1065,60 @@ XR_ENUM_STR(XrResult); _(viewConfigurationType) \ _(viewIndex) \ +#define XR_LIST_STRUCT_XrCompositionLayerColorScaleBiasKHR(_) \ + _(type) \ + _(next) \ + _(colorScale) \ + _(colorBias) \ + +#define XR_LIST_STRUCT_XrLoaderInitInfoBaseHeaderKHR(_) \ + _(type) \ + _(next) \ + +#define XR_LIST_STRUCT_XrLoaderInitInfoAndroidKHR(_) \ + _(type) \ + _(next) \ + _(applicationVM) \ + _(applicationContext) \ + +#define XR_LIST_STRUCT_XrVulkanInstanceCreateInfoKHR(_) \ + _(type) \ + _(next) \ + _(systemId) \ + _(createFlags) \ + _(pfnGetInstanceProcAddr) \ + _(vulkanCreateInfo) \ + _(vulkanAllocator) \ + +#define XR_LIST_STRUCT_XrVulkanDeviceCreateInfoKHR(_) \ + _(type) \ + _(next) \ + _(systemId) \ + _(createFlags) \ + _(pfnGetInstanceProcAddr) \ + _(vulkanPhysicalDevice) \ + _(vulkanCreateInfo) \ + _(vulkanAllocator) \ + +#define XR_LIST_STRUCT_XrVulkanGraphicsDeviceGetInfoKHR(_) \ + _(type) \ + _(next) \ + _(systemId) \ + _(vulkanInstance) \ + +#define XR_LIST_STRUCT_XrCompositionLayerEquirect2KHR(_) \ + _(type) \ + _(next) \ + _(layerFlags) \ + _(space) \ + _(eyeVisibility) \ + _(subImage) \ + _(pose) \ + _(radius) \ + _(centralHorizontalAngle) \ + _(upperVerticalAngle) \ + _(lowerVerticalAngle) \ + #define XR_LIST_STRUCT_XrEventDataPerfSettingsEXT(_) \ _(type) \ _(next) \ @@ -1400,6 +1464,8 @@ XR_ENUM_STR(XrResult); _(XrCompositionLayerEquirectKHR, XR_TYPE_COMPOSITION_LAYER_EQUIRECT_KHR) \ _(XrVisibilityMaskKHR, XR_TYPE_VISIBILITY_MASK_KHR) \ _(XrEventDataVisibilityMaskChangedKHR, XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR) \ + _(XrCompositionLayerColorScaleBiasKHR, XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR) \ + _(XrCompositionLayerEquirect2KHR, XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR) \ _(XrEventDataPerfSettingsEXT, XR_TYPE_EVENT_DATA_PERF_SETTINGS_EXT) \ _(XrDebugUtilsObjectNameInfoEXT, XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT) \ _(XrDebugUtilsLabelEXT, XR_TYPE_DEBUG_UTILS_LABEL_EXT) \ @@ -1501,15 +1567,6 @@ XR_ENUM_STR(XrResult); #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XCB(_) #endif -#if defined(XR_USE_GRAPHICS_API_OPENGL) && defined(XR_USE_PLATFORM_XLIB) -#define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XLIB(_) \ - _(XrGraphicsBindingOpenGLXlibKHR, XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR) \ - - -#else -#define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XLIB(_) -#endif - #if defined(XR_USE_GRAPHICS_API_OPENGL_ES) #define XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES(_) \ _(XrSwapchainImageOpenGLESKHR, XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_ES_KHR) \ @@ -1526,6 +1583,9 @@ XR_ENUM_STR(XrResult); _(XrGraphicsBindingVulkanKHR, XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR) \ _(XrSwapchainImageVulkanKHR, XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR) \ _(XrGraphicsRequirementsVulkanKHR, XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR) \ + _(XrVulkanInstanceCreateInfoKHR, XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR) \ + _(XrVulkanDeviceCreateInfoKHR, XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR) \ + _(XrVulkanGraphicsDeviceGetInfoKHR, XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR) \ #else @@ -1535,6 +1595,7 @@ XR_ENUM_STR(XrResult); #if defined(XR_USE_PLATFORM_ANDROID) #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_ANDROID(_) \ _(XrInstanceCreateInfoAndroidKHR, XR_TYPE_INSTANCE_CREATE_INFO_ANDROID_KHR) \ + _(XrLoaderInitInfoAndroidKHR, XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR) \ #else @@ -1568,6 +1629,15 @@ XR_ENUM_STR(XrResult); #define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_WIN32(_) #endif +#if defined(XR_USE_PLATFORM_XLIB) && defined(XR_USE_GRAPHICS_API_OPENGL) +#define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_XLIB_XR_USE_GRAPHICS_API_OPENGL(_) \ + _(XrGraphicsBindingOpenGLXlibKHR, XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR) \ + + +#else +#define XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_XLIB_XR_USE_GRAPHICS_API_OPENGL(_) +#endif + #define XR_LIST_STRUCTURE_TYPES(_) \ XR_LIST_STRUCTURE_TYPES_CORE(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_D3D11(_) \ @@ -1576,13 +1646,13 @@ XR_ENUM_STR(XrResult); 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(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XCB(_) \ - XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_XR_USE_PLATFORM_XLIB(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_OPENGL_ES(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_GRAPHICS_API_VULKAN(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_ANDROID(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_ANDROID_XR_USE_GRAPHICS_API_OPENGL_ES(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_EGL(_) \ XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_WIN32(_) \ + XR_LIST_STRUCTURE_TYPES_XR_USE_PLATFORM_XLIB_XR_USE_GRAPHICS_API_OPENGL(_) \ #define XR_LIST_EXTENSIONS(_) \ @@ -1605,6 +1675,7 @@ XR_ENUM_STR(XrResult); _(XR_EXT_eye_gaze_interaction, 31) \ _(XR_KHR_visibility_mask, 32) \ _(XR_EXTX_overlay, 34) \ + _(XR_KHR_composition_layer_color_scale_bias, 35) \ _(XR_KHR_win32_convert_performance_counter_time, 36) \ _(XR_KHR_convert_timespec_time, 37) \ _(XR_VARJO_quad_views, 38) \ @@ -1621,7 +1692,7 @@ XR_ENUM_STR(XrResult); _(XR_MSFT_hand_tracking_mesh, 53) \ _(XR_MSFT_secondary_view_configuration, 54) \ _(XR_MSFT_first_person_observer, 55) \ - _(XR_MSFT_controller_model_preview, 56) \ + _(XR_MSFT_controller_model, 56) \ _(XR_MSFT_perception_anchor_interop_preview, 57) \ _(XR_EXT_win32_appcontainer_compatible, 58) \ _(XR_EPIC_view_configuration_fov, 60) \ @@ -1629,6 +1700,10 @@ XR_ENUM_STR(XrResult); _(XR_MSFT_holographic_window_attachment, 64) \ _(XR_HUAWEI_controller_interaction, 70) \ _(XR_VALVE_analog_threshold, 80) \ + _(XR_KHR_loader_init, 89) \ + _(XR_KHR_loader_init_android, 90) \ + _(XR_KHR_vulkan_enable2, 91) \ + _(XR_KHR_composition_layer_equirect2, 92) \ _(XR_EXT_samsung_odyssey_controller, 95) \ _(XR_EXT_hp_mixed_reality_controller, 96) \ _(XR_MND_swapchain_usage_input_attachment_bit, 97) \ diff --git a/openxr_preview/specs/openxr.html b/openxr_preview/specs/openxr.html index 3e4cadb..cff15f4 100644 --- a/openxr_preview/specs/openxr.html +++ b/openxr_preview/specs/openxr.html @@ -443,9 +443,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b

The OpenXR Specification

Copyright (c) 2017-2020 The Khronos Group Inc.
-version 1.0.10, -Fri, 31 Jul 2020 07:28:48 +0000 -
from git branch: last-integration-point commit: ebcf879c04fce7c4b519024a72a0edf5a03c32f0 +version 1.0.12, +Wed, 30 Sep 2020 16:48:42 +0000 +
from git branch: master commit: 6b66bbaabdca7479852cf50fa1149452b7cbe299
Table of Contents
@@ -561,47 +561,52 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
  • 12.1. XR_KHR_android_create_instance
  • 12.2. XR_KHR_android_surface_swapchain
  • 12.3. XR_KHR_android_thread_settings
  • -
  • 12.4. XR_KHR_composition_layer_cube
  • -
  • 12.5. XR_KHR_composition_layer_cylinder
  • -
  • 12.6. XR_KHR_composition_layer_depth
  • -
  • 12.7. XR_KHR_composition_layer_equirect
  • -
  • 12.8. XR_KHR_convert_timespec_time
  • -
  • 12.9. XR_KHR_D3D11_enable
  • -
  • 12.10. XR_KHR_D3D12_enable
  • -
  • 12.11. XR_KHR_opengl_enable
  • -
  • 12.12. XR_KHR_opengl_es_enable
  • -
  • 12.13. XR_KHR_visibility_mask
  • -
  • 12.14. XR_KHR_vulkan_enable
  • -
  • 12.15. XR_KHR_vulkan_swapchain_format_list
  • -
  • 12.16. XR_KHR_win32_convert_performance_counter_time
  • -
  • 12.17. XR_EXT_conformance_automation
  • -
  • 12.18. XR_EXT_debug_utils
  • -
  • 12.19. XR_EXT_eye_gaze_interaction
  • -
  • 12.20. XR_EXT_hand_tracking
  • -
  • 12.21. XR_EXT_hp_mixed_reality_controller
  • -
  • 12.22. XR_EXT_performance_settings
  • -
  • 12.23. XR_EXT_samsung_odyssey_controller
  • -
  • 12.24. XR_EXT_thermal_query
  • -
  • 12.25. XR_EXT_view_configuration_depth_range
  • -
  • 12.26. XR_EXT_win32_appcontainer_compatible
  • -
  • 12.27. XR_EPIC_view_configuration_fov
  • -
  • 12.28. XR_HUAWEI_controller_interaction
  • -
  • 12.29. XR_MND_headless
  • -
  • 12.30. XR_MND_swapchain_usage_input_attachment_bit
  • -
  • 12.31. XR_MSFT_controller_model_preview
  • -
  • 12.32. XR_MSFT_first_person_observer
  • -
  • 12.33. XR_MSFT_hand_interaction
  • -
  • 12.34. XR_MSFT_hand_tracking_mesh
  • -
  • 12.35. XR_MSFT_holographic_window_attachment
  • -
  • 12.36. XR_MSFT_perception_anchor_interop_preview
  • -
  • 12.37. XR_MSFT_secondary_view_configuration
  • -
  • 12.38. XR_MSFT_spatial_anchor
  • -
  • 12.39. XR_MSFT_spatial_anchor_export_preview
  • -
  • 12.40. XR_MSFT_spatial_graph_bridge
  • -
  • 12.41. XR_MSFT_unbounded_reference_space
  • -
  • 12.42. XR_OCULUS_android_session_state_enable
  • -
  • 12.43. XR_VALVE_analog_threshold
  • -
  • 12.44. XR_VARJO_quad_views
  • +
  • 12.4. XR_KHR_composition_layer_color_scale_bias
  • +
  • 12.5. XR_KHR_composition_layer_cube
  • +
  • 12.6. XR_KHR_composition_layer_cylinder
  • +
  • 12.7. XR_KHR_composition_layer_depth
  • +
  • 12.8. XR_KHR_composition_layer_equirect
  • +
  • 12.9. XR_KHR_composition_layer_equirect2
  • +
  • 12.10. XR_KHR_convert_timespec_time
  • +
  • 12.11. XR_KHR_D3D11_enable
  • +
  • 12.12. XR_KHR_D3D12_enable
  • +
  • 12.13. XR_KHR_loader_init
  • +
  • 12.14. XR_KHR_loader_init_android
  • +
  • 12.15. XR_KHR_opengl_enable
  • +
  • 12.16. XR_KHR_opengl_es_enable
  • +
  • 12.17. XR_KHR_visibility_mask
  • +
  • 12.18. XR_KHR_vulkan_enable
  • +
  • 12.19. XR_KHR_vulkan_enable2
  • +
  • 12.20. XR_KHR_vulkan_swapchain_format_list
  • +
  • 12.21. XR_KHR_win32_convert_performance_counter_time
  • +
  • 12.22. XR_EXT_conformance_automation
  • +
  • 12.23. XR_EXT_debug_utils
  • +
  • 12.24. XR_EXT_eye_gaze_interaction
  • +
  • 12.25. XR_EXT_hand_tracking
  • +
  • 12.26. XR_EXT_hp_mixed_reality_controller
  • +
  • 12.27. XR_EXT_performance_settings
  • +
  • 12.28. XR_EXT_samsung_odyssey_controller
  • +
  • 12.29. XR_EXT_thermal_query
  • +
  • 12.30. XR_EXT_view_configuration_depth_range
  • +
  • 12.31. XR_EXT_win32_appcontainer_compatible
  • +
  • 12.32. XR_EPIC_view_configuration_fov
  • +
  • 12.33. XR_HUAWEI_controller_interaction
  • +
  • 12.34. XR_MND_headless
  • +
  • 12.35. XR_MND_swapchain_usage_input_attachment_bit
  • +
  • 12.36. XR_MSFT_controller_model
  • +
  • 12.37. XR_MSFT_first_person_observer
  • +
  • 12.38. XR_MSFT_hand_interaction
  • +
  • 12.39. XR_MSFT_hand_tracking_mesh
  • +
  • 12.40. XR_MSFT_holographic_window_attachment
  • +
  • 12.41. XR_MSFT_perception_anchor_interop_preview
  • +
  • 12.42. XR_MSFT_secondary_view_configuration
  • +
  • 12.43. XR_MSFT_spatial_anchor
  • +
  • 12.44. XR_MSFT_spatial_anchor_export_preview
  • +
  • 12.45. XR_MSFT_spatial_graph_bridge
  • +
  • 12.46. XR_MSFT_unbounded_reference_space
  • +
  • 12.47. XR_OCULUS_android_session_state_enable
  • +
  • 12.48. XR_VALVE_analog_threshold
  • +
  • 12.49. XR_VARJO_quad_views
  • 13. List of Provisional Extensions @@ -1947,12 +1952,12 @@ All run time error codes are negative values.

    XR_ERROR_ACTIONSETS_ALREADY_ATTACHED = -47, XR_ERROR_LOCALIZED_NAME_DUPLICATED = -48, XR_ERROR_LOCALIZED_NAME_INVALID = -49, + XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING = -50, XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR = -1000003000, XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR = -1000003001, XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT = -1000039001, XR_ERROR_SECONDARY_VIEW_CONFIGURATION_TYPE_NOT_ENABLED_MSFT = -1000053000, - XR_ERROR_CONTROLLER_MODEL_UNAVAILABLE_MSFT = -1000055000, - XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT = -1000055001, + XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT = -1000055000, XR_SPATIAL_ANCHOR_EXPORT_DATA_UNAVAILABLE_MSFT = 1000062000, XR_ERROR_SPATIAL_ANCHOR_EXPORT_FAILED_MSFT = -1000062000, XR_ERROR_SPATIAL_ANCHOR_SUFFICIENCY_QUERY_FAILED_MSFT = -1000062001, @@ -2235,6 +2240,10 @@ supported by this function’s parent handle but not at this moment.

    The localized name provided was invalid.

    +

    XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING

    +

    The xrGetGraphicsRequirements* call was not made before calling xrCreateSession.

    + +

    XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR

    xrSetAndroidApplicationThreadKHR failed as thread id is invalid. (Added by the XR_KHR_android_thread_settings extension)

    @@ -2251,12 +2260,8 @@ supported by this function’s parent handle but not at this moment.

    The secondary view configuration was not enabled when creating the session. (Added by the XR_MSFT_secondary_view_configuration extension)

    -

    XR_ERROR_CONTROLLER_MODEL_UNAVAILABLE_MSFT

    -

    The controller model is currently not available. (Added by the XR_MSFT_controller_model_preview extension)

    - -

    XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT

    -

    The controller model key is invalid. (Added by the XR_MSFT_controller_model_preview extension)

    +

    The controller model key is invalid. (Added by the XR_MSFT_controller_model extension)

    XR_ERROR_SPATIAL_ANCHOR_EXPORT_FAILED_MSFT

    @@ -4142,8 +4147,8 @@ first parameter) that is instance or a child of instance
  • -

    PFN_xrVoidFunction is a dummy pointer returned by queries, -specifically those to xrGetInstanceProcAddr.

    +

    PFN_xrVoidFunction is a generic function pointer type returned by +queries, specifically those to xrGetInstanceProcAddr.

    @@ -10248,7 +10253,8 @@ When the runtime determines that the system is ready to start transitioning to this session’s XR content, it notifies the application that its session has moved into the XR_SESSION_STATE_READY state. When the application is ready to proceed and display its XR content, it -calls xrBeginSession, which starts its session running. +calls xrBeginSession and starts its frame loop, +which starts its session running. While the session is running, the application is expected to continuously run its frame loop by calling xrWaitFrame, xrBeginFrame and xrEndFrame each frame, to establish synchronization with the runtime. @@ -10425,6 +10431,9 @@ for the new session.

  • XR_ERROR_VALIDATION_FAILURE

  • +
  • +

    XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING

    +
  • @@ -11183,8 +11192,8 @@ calling xrEndSession.

  • XR_SESSION_STATE_READY. -The application is ready to call xrBeginSession and sync its frame -loop with the runtime.

    +The application is ready to call xrBeginSession and +sync its frame loop with the runtime.

  • XR_SESSION_STATE_SYNCHRONIZED. @@ -11193,13 +11202,13 @@ visible to the user.

  • XR_SESSION_STATE_VISIBLE. -The application has synced its frame loop with the runtime and is visible -to the user but cannot receive XR input.

    +The application has synced its frame loop with the +runtime and is visible to the user but cannot receive XR input.

  • XR_SESSION_STATE_FOCUSED. -The application has synced its frame loop with the runtime, is visible to -the user and can receive XR input.

    +The application has synced its frame loop with the +runtime, is visible to the user and can receive XR input.

  • XR_SESSION_STATE_STOPPING. @@ -11234,9 +11243,9 @@ continue to call xrPollEvent at some reasonable caden

    Receiving the XR_SESSION_STATE_READY state indicates that the runtime desires the application to prepare rendering resources, begin its session and synchronize its frame loop with the runtime. -The application does this by successfully calling xrBeginSession and -then running its frame loop by calling xrWaitFrame, xrBeginFrame -and xrEndFrame in a loop. + The application does this by successfully calling +xrBeginSession and then running its frame loop by calling +xrWaitFrame, xrBeginFrame and xrEndFrame in a loop. If the runtime wishes to return the session to the XR_SESSION_STATE_IDLE state, it must wait until the application calls xrBeginSession. @@ -11252,8 +11261,8 @@ device.

    Receiving the XR_SESSION_STATE_SYNCHRONIZED state indicates that the -application has synchronized its frame loop with the runtime, but its frames -are not visible to the user. +application has synchronized its frame loop with the +runtime, but its frames are not visible to the user. The application should continue running its frame loop by calling xrWaitFrame, xrBeginFrame and xrEndFrame, although it should avoid heavy GPU work so that other visible applications can take CPU @@ -11267,9 +11276,9 @@ boundary.

    Receiving the XR_SESSION_STATE_VISIBLE state indicates that the -application has synchronized its frame loop with the runtime, and the -session’s frames will be visible to the user, but the session is not -eligible to receive XR input. +application has synchronized its frame loop with the +runtime, and the session’s frames will be visible to the user, but the +session is not eligible to receive XR input. An application may be visible but not have focus, for example when the runtime is composing a modal pop-up on top of the application’s rendered frames. @@ -11286,9 +11295,9 @@ other tracked objects controlled by the user).

    Receiving the XR_SESSION_STATE_FOCUSED state indicates that the -application has synchronized its frame loop with the runtime, the session’s -frames will be visible to the user, and the session is eligible to receive -XR input. +application has synchronized its frame loop with the +runtime, the session’s frames will be visible to the user, and the session +is eligible to receive XR input. The runtime should only give one session XR input focus at any given time. The application should be running its frame loop, rendering and submitting composition layers, including input avatars (depictions of hands or other @@ -14009,7 +14018,7 @@ If layerCount is greater than the maximum supported layer count then

    environmentBlendMode must be a valid XrEnvironmentBlendMode value

  • -

    If layerCount is not 0, layers must be a pointer to an array of layerCount valid XrCompositionLayerBaseHeader-based structures. See also: XrCompositionLayerCubeKHR, XrCompositionLayerCylinderKHR, XrCompositionLayerEquirectKHR, XrCompositionLayerProjection, XrCompositionLayerQuad

    +

    If layerCount is not 0, layers must be a pointer to an array of layerCount valid XrCompositionLayerBaseHeader-based structures. See also: XrCompositionLayerCubeKHR, XrCompositionLayerCylinderKHR, XrCompositionLayerEquirect2KHR, XrCompositionLayerEquirectKHR, XrCompositionLayerProjection, XrCompositionLayerQuad

  • @@ -14235,10 +14244,10 @@ All composition layer type pointers must be type
    -

    12.4. XR_KHR_composition_layer_cube

    +

    12.4. XR_KHR_composition_layer_color_scale_bias

    +
    +
    +
    Name String
    +
    +

    XR_KHR_composition_layer_color_scale_bias

    +
    +
    Extension Type
    +
    +

    Instance extension

    +
    +
    Registered Extension Number
    +
    +

    35

    +
    +
    Revision
    +
    +

    5

    +
    +
    Extension and Version Dependencies
    +
    +
    +
      +
    • +

      Requires OpenXR 1.0

      +
    • +
    +
    +
    +
    Last Modified Date
    +
    +

    2019-01-28

    +
    +
    IP Status
    +
    +

    No known IP claims.

    +
    +
    Contributors
    +
    +

    Paul Pedriana, Oculus
    +Cass Everitt, Oculus
    +Martin Renschler, Qualcomm

    +
    +
    +
    +
    +

    Overview

    +
    +
    +

    Color scale and bias are applied to a layer color during composition, after +its conversion to premultiplied alpha representation.

    +
    +
    +

    If specified, colorScale and colorBias must be used to alter +the LayerColor as follows:

    +
    +
    +
      +
    • +

      colorScale = max( vec4( 0, 0, 0, 0 ), colorScale )

      +
    • +
    • +

      LayerColor.RGB = LayerColor.A > 0 ? LayerColor.RGB / LayerColor.A : vec3( +0, 0, 0 )

      +
    • +
    • +

      LayerColor = LayerColor * colorScale + colorBias

      +
    • +
    • +

      LayerColor.RGB *= LayerColor.A

      +
    • +
    +
    +
    +

    This extension specifies the XrCompositionLayerColorScaleBiasKHR +structure, which, if present in the +XrCompositionLayerBaseHeader::next chain, must be applied to +the composition layer.

    +
    +
    +

    This extension does not define a new composition layer type, but rather it +defines a transform that may be applied to the color derived from existing +composition layer types.

    +
    +
    +

    New Object Types

    +
    +
    +

    New Flag Types

    +
    +
    +

    New Enum Constants

    +
    +
    +

    XrStructureType enumeration is extended with:

    +
    +
    +
      +
    • +

      XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR

      +
    • +
    +
    +
    +

    New Enums

    +
    +
    +

    New Structures

    +
    +
    +
    +
    +

    The XrCompositionLayerColorScaleBiasKHR structure is defined as:

    +
    +
    +

    +
    +
    +
    +
    typedef struct XrCompositionLayerColorScaleBiasKHR {
    +    XrStructureType    type;
    +    const void*        next;
    +    XrColor4f          colorScale;
    +    XrColor4f          colorBias;
    +} XrCompositionLayerColorScaleBiasKHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      type is the XrStructureType of this structure.

      +
    • +
    • +

      next is NULL or a pointer to the next structure in a structure +chain. +No such structures are defined in core OpenXR or this extension.

      +
    • +
    • +

      colorScale is an XrColor4f which will modulate the color +sourced from the images.

      +
    • +
    • +

      colorBias is an XrColor4f which will offset the color sourced +from the images.

      +
    • +
    +
    +
    +
    +
    +

    XrCompositionLayerColorScaleBiasKHR contains the information needed to +scale and bias the color of layer textures.

    +
    +
    +

    The XrCompositionLayerColorScaleBiasKHR structure can be applied by +applications to composition layers by adding an instance of the struct to +the XrCompositionLayerBaseHeader::next list.

    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +

    New Functions

    +
    +
    +

    Issues

    +
    +
    +

    Version History

    +
    +
    +
      +
    • +

      Revision 1, 2017-09-13 (Paul Pedriana)

      +
      +
        +
      • +

        Initial implementation.

        +
      • +
      +
      +
    • +
    • +

      Revision 2, 2019-01-24 (Martin Renschler)

      +
      +
        +
      • +

        Formatting, spec language changes

        +
      • +
      +
      +
    • +
    • +

      Revision 3, 2019-01-28 (Paul Pedriana)

      +
      +
        +
      • +

        Revised math to remove premultiplied alpha before applying color scale +and offset, then restoring.

        +
      • +
      +
      +
    • +
    • +

      Revision 4, 2019-07-17 (Cass Everitt)

      +
      +
        +
      • +

        Non-substantive updates to the spec language and equations.

        +
      • +
      +
      +
    • +
    • +

      Revision 5, 2020-05-20 (Cass Everitt)

      +
      +
        +
      • +

        Changed extension name, simplified language.

        +
      • +
      +
      +
    • +
    +
    +
    +
    +

    12.5. XR_KHR_composition_layer_cube

    Name String
    @@ -20103,7 +20374,7 @@ language changes, eye parameter description update

    -

    12.5. XR_KHR_composition_layer_cylinder

    +

    12.6. XR_KHR_composition_layer_cylinder

    Name String
    @@ -20403,7 +20674,7 @@ the existing core spec.

    -

    12.6. XR_KHR_composition_layer_depth

    +

    12.7. XR_KHR_composition_layer_depth

    Name String
    @@ -20662,7 +20933,7 @@ to XrSwapchainSubImage

    -

    12.7. XR_KHR_composition_layer_equirect

    +

    12.8. XR_KHR_composition_layer_equirect

    Name String
    @@ -20918,7 +21189,254 @@ such extension layer types.

    -

    12.8. XR_KHR_convert_timespec_time

    +

    12.9. XR_KHR_composition_layer_equirect2

    +
    +
    +
    Name String
    +
    +

    XR_KHR_composition_layer_equirect2

    +
    +
    Extension Type
    +
    +

    Instance extension

    +
    +
    Registered Extension Number
    +
    +

    92

    +
    +
    Revision
    +
    +

    1

    +
    +
    Extension and Version Dependencies
    +
    +
    +
      +
    • +

      Requires OpenXR 1.0

      +
    • +
    +
    +
    +
    Last Modified Date
    +
    +

    2019-01-24

    +
    +
    IP Status
    +
    +

    No known IP claims.

    +
    +
    Contributors
    +
    +

    Johannes van Waveren, Oculus
    +Cass Everitt, Oculus
    +Paul Pedriana, Oculus
    +Gloria Kennickell, Oculus
    +Martin Renschler, Qualcomm

    +
    +
    Contacts
    +
    +

    Cass Everitt, Oculus

    +
    +
    +
    +
    +

    Overview

    +
    +
    +

    This extension adds an additional layer type where the XR runtime must map +an equirectangular coded image stemming from a swapchain onto the inside of +a sphere.

    +
    +
    +

    The equirect layer type provides most of the same benefits as a cubemap, but +from an equirect 2D image source. +This image source is appealing mostly because equirect environment maps are +very common, and the highest quality you can get from them is by sampling +them directly in the compositor.

    +
    +
    +

    This is not a projection type of layer but rather an object-in-world type of +layer, similar to XrCompositionLayerQuad. +Only the interior of the sphere surface must be visible; the exterior of +the sphere is not visible and must not be drawn by the runtime.

    +
    +
    +

    This extension uses a different parameterization more in keeping with the +formulation of KHR_composition_layer_cylinder but is functionally equivalent +to KHR_composition_layer_equirect.

    +
    +
    +

    New Object Types

    +
    +
    +

    New Flag Types

    +
    +
    +

    New Enum Constants

    +
    +
    +

    XrStructureType enumeration is extended with:

    +
    +
    +
      +
    • +

      XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR

      +
    • +
    +
    +
    +

    New Enums

    +
    +
    +

    New Structures

    +
    +
    +
    +
    +

    The XrCompositionLayerEquirect2KHR structure is defined as:

    +
    +
    +

    +
    +
    +
    +
    typedef struct XrCompositionLayerEquirect2KHR {
    +    XrStructureType            type;
    +    const void*                next;
    +    XrCompositionLayerFlags    layerFlags;
    +    XrSpace                    space;
    +    XrEyeVisibility            eyeVisibility;
    +    XrSwapchainSubImage        subImage;
    +    XrPosef                    pose;
    +    float                      radius;
    +    float                      centralHorizontalAngle;
    +    float                      upperVerticalAngle;
    +    float                      lowerVerticalAngle;
    +} XrCompositionLayerEquirect2KHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      type is the XrStructureType of this structure.

      +
    • +
    • +

      next is NULL or a pointer to the next structure in a structure +chain. +No such structures are defined in core OpenXR or this extension.

      +
    • +
    • +

      layerFlags specifies options for the layer.

      +
    • +
    • +

      space is the XrSpace in which the pose of the equirect +layer is evaluated over time.

      +
    • +
    • +

      eye is the eye represented by this layer.

      +
    • +
    • +

      subImage identifies the image XrSwapchainSubImage to use.

      +
    • +
    • +

      pose is an XrPosef defining the position and orientation of +the center point of the sphere onto which the equirect image data is mapped, +relative to the reference frame of the space.

      +
    • +
    • +

      radius is the non-negative radius of the sphere onto which the +equirect image data is mapped. +Values of zero or floating point positive infinity are treated as an +infinite sphere.

      +
    • +
    • +

      centralHorizontalAngle defines the visible horizontal angle of the +sphere, based at 0 radians, in the range of [0, 2Ï€]. +It grows symmetrically around the 0 radian angle.

      +
    • +
    • +

      upperVerticalAngle defines the upper vertical angle of the visible +portion of the sphere, in the range of [-π/2, π/2].

      +
    • +
    • +

      lowerVerticalAngle defines the lower vertical angle of the visible +portion of the sphere, in the range of [-π/2, π/2].

      +
    • +
    +
    +
    +
    +
    +

    XrCompositionLayerEquirect2KHR contains the information needed to +render an equirectangular image onto a sphere when calling xrEndFrame. +XrCompositionLayerEquirect2KHR is an alias type for the base struct +XrCompositionLayerBaseHeader used in XrFrameEndInfo.

    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +

    New Functions

    +
    +
    +

    Issues

    +
    +
    +

    Version History

    +
    +
    +
      +
    • +

      Revision 1, 2020-05-08 (Cass Everitt)

      +
      +
        +
      • +

        Initial version.

        +
      • +
      • +

        Kept contributors from the original equirect extension.

        +
      • +
      +
      +
    • +
    +
    +
    +
    +

    12.10. XR_KHR_convert_timespec_time

    Name String
    @@ -21233,7 +21751,7 @@ runtime must return XR_ERROR_TIME_INVALID<
    -

    12.9. XR_KHR_D3D11_enable

    +

    12.11. XR_KHR_D3D11_enable

    Name String
    @@ -21250,7 +21768,7 @@ runtime must return XR_ERROR_TIME_INVALID<
    Revision
    -

    4

    +

    5

    Extension and Version Dependencies
    @@ -21619,9 +22137,10 @@ output structure.

    The xrGetD3D11GraphicsRequirementsKHR function identifies to the application what graphics device (Windows LUID) needs to be used and the minimum feature level to use. -The runtime must return XR_ERROR_VALIDATION_FAILURE on calls to -xrCreateSession if xrGetD3D11GraphicsRequirementsKHR has not -been called for the same instance and systemId. +The runtime must return XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING +(XR_ERROR_VALIDATION_FAILURE may be returned due to legacy behavior) +on calls to xrCreateSession if xrGetD3D11GraphicsRequirementsKHR +has not been called for the same instance and systemId. The LUID and feature level that xrGetD3D11GraphicsRequirementsKHR returns should be used to create the ID3D11Device that the application passes to xrCreateSession in the XrGraphicsBindingD3D11KHR.

    @@ -21742,11 +22261,21 @@ passes to xrCreateSession in the +
      +
    • +

      Added new XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING error code

      +
    • +
    +
    +
    -

    12.10. XR_KHR_D3D12_enable

    +

    12.12. XR_KHR_D3D12_enable

    Name String
    @@ -21763,7 +22292,7 @@ passes to xrCreateSession in the Revision
    -

    6

    +

    7

    Extension and Version Dependencies
    @@ -22193,9 +22722,10 @@ output structure.

    The xrGetD3D12GraphicsRequirementsKHR function identifies to the application what graphics device (Windows LUID) needs to be used and the minimum feature level to use. -The runtime must return XR_ERROR_VALIDATION_FAILURE on calls to -xrCreateSession if xrGetD3D12GraphicsRequirementsKHR has not -been called for the same instance and systemId. +The runtime must return XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING +(XR_ERROR_VALIDATION_FAILURE may be returned due to legacy behavior) +on calls to xrCreateSession if xrGetD3D12GraphicsRequirementsKHR +has not been called for the same instance and systemId. The LUID and feature level that xrGetD3D12GraphicsRequirementsKHR returns should be used to create the ID3D12Device that the application passes to xrCreateSession in the XrGraphicsBindingD3D12KHR.

    @@ -22336,11 +22866,393 @@ passes to xrCreateSession in the +
      +
    • +

      Added new XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING error code

      +
    • +
    +
    +
    -

    12.11. XR_KHR_opengl_enable

    +

    12.13. XR_KHR_loader_init

    +
    +
    +
    Name String
    +
    +

    XR_KHR_loader_init

    +
    +
    Extension Type
    +
    +

    Instance extension

    +
    +
    Registered Extension Number
    +
    +

    89

    +
    +
    Revision
    +
    +

    1

    +
    +
    Extension and Version Dependencies
    +
    +
    +
      +
    • +

      Requires OpenXR 1.0

      +
    • +
    +
    +
    +
    Last Modified Date
    +
    +

    2020-05-07

    +
    +
    IP Status
    +
    +

    No known IP claims.

    +
    +
    Contributors
    +
    +

    Cass Everitt, Facebook

    +
    +
    +
    +
    +

    Overview

    +
    +
    +

    On some platforms, before loading can occur the loader must be initialized +with platform-specific parameters. +Unlike other extensions, the presence of this extension is signaled by a +successful call to xrGetInstanceProcAddr to retrieve the function +pointer for xrInitializeLoaderKHR using a null instance handle. +If this extension is supported, its use may be required on some platforms +and the use of the xrInitializeLoaderKHR function must precede other +OpenXR calls except xrGetInstanceProcAddr. +This function exists as part of the loader library that the application is +using.

    +
    +
    +

    New Object Types

    +
    +
    +

    New Flag Types

    +
    +
    +

    New Enum Constants

    +
    +
    +

    New Enums

    +
    +
    +

    New Structures

    +
    +
    +
    +
    +

    The XrLoaderInitInfoBaseHeaderKHR structure is defined as:

    +
    +
    +

    +
    +
    +
    +
    typedef struct XrLoaderInitInfoBaseHeaderKHR {
    +    XrStructureType    type;
    +    const void*        next;
    +} XrLoaderInitInfoBaseHeaderKHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      type is the XrStructureType of this structure. +This base structure itself has no associated XrStructureType value.

      +
    • +
    • +

      next is NULL or a pointer to the next structure in a structure +chain. +No such structures are defined in core OpenXR or this extension.

      +
    • +
    +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +

    New Functions

    +
    +
    +
    +
    +

    To initialize an OpenXR loader with platform or implementation-specific +parameters, call:

    +
    +
    +

    +
    +
    +
    +
    XrResult xrInitializeLoaderKHR(
    +    const XrLoaderInitInfoBaseHeaderKHR*        loaderInitInfo);
    +
    +
    +
    +
    +
    Parameter Descriptions
    +
    +
      +
    • +

      loaderInitInfo is a pointer to an +XrLoaderInitInfoBaseHeaderKHR structure, which is a polymorphic type +defined by other platform- or implementation-specific extensions.

      +
    • +
    +
    +
    +
    +
    +
    +
    +

    Issues

    +
    +
    +

    Version History

    +
    +
    +
      +
    • +

      Revision 1, 2020-05-07 (Cass Everitt)

      +
      +
        +
      • +

        Initial draft

        +
      • +
      +
      +
    • +
    +
    +
    +
    +

    12.14. XR_KHR_loader_init_android

    +
    +
    +
    Name String
    +
    +

    XR_KHR_loader_init_android

    +
    +
    Extension Type
    +
    +

    Instance extension

    +
    +
    Registered Extension Number
    +
    +

    90

    +
    +
    Revision
    +
    +

    1

    +
    +
    Extension and Version Dependencies
    +
    +
    + +
    +
    +
    Last Modified Date
    +
    +

    2020-05-07

    +
    +
    IP Status
    +
    +

    No known IP claims.

    +
    +
    Contributors
    +
    +

    Cass Everitt, Facebook

    +
    +
    +
    +
    +

    Overview

    +
    +
    +

    On Android, some loader implementations need the application to provide +additional information on initialization. +This extension defines the parameters needed by such implementations. +If this is available on a given implementation, an application must make +use of it.

    +
    +
    +

    On implementations where use of this is required, the following condition +must apply:

    +
    +
    + +
    +
    +

    New Object Types

    +
    +
    +

    New Flag Types

    +
    +
    +

    New Enum Constants

    +
    +
    +

    XrStructureType enumeration is extended with:

    +
    +
    +
      +
    • +

      XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR

      +
    • +
    +
    +
    +

    New Enums

    +
    +
    +

    New Structures

    +
    +
    +
    +
    +

    The XrLoaderInitInfoAndroidKHR structure is defined as:

    +
    +
    +

    +
    +
    +
    +
    typedef struct XrLoaderInitInfoAndroidKHR {
    +    XrStructureType    type;
    +    const void*        next;
    +    void*              applicationVM;
    +    void*              applicationContext;
    +} XrLoaderInitInfoAndroidKHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      type is the XrStructureType of this structure.

      +
    • +
    • +

      next is NULL or a pointer to the next structure in a structure +chain. +No such structures are defined in core OpenXR or this extension.

      +
    • +
    • +

      applicationVM is a pointer to the JNI’s opaque JavaVM structure, +cast to a void pointer.

      +
    • +
    • +

      applicationContext is a JNI reference to an +android.content.Context associated with the application, cast to a void +pointer.

      +
    • +
    +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +

    New Functions

    +
    +
    +

    Issues

    +
    +
    +

    Version History

    +
    +
    +
      +
    • +

      Revision 1, 2020-05-07 (Cass Everitt)

      +
      +
        +
      • +

        Initial draft

        +
      • +
      +
      +
    • +
    +
    +
    +
    +

    12.15. XR_KHR_opengl_enable

    Name String
    @@ -22357,7 +23269,7 @@ passes to xrCreateSession in the Revision
    -

    8

    +

    9

    Extension and Version Dependencies
    @@ -23054,9 +23966,11 @@ output structure.

    The xrGetOpenGLGraphicsRequirementsKHR function identifies to the application the minimum OpenGL version requirement and the highest known tested OpenGL version. -The runtime must return XR_ERROR_VALIDATION_FAILURE on calls to -xrCreateSession if xrGetOpenGLGraphicsRequirementsKHR has not -been called for the same instance and systemId.

    +The runtime must return XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING +(XR_ERROR_VALIDATION_FAILURE may be returned due to legacy behavior) +on calls to xrCreateSession if +xrGetOpenGLGraphicsRequirementsKHR has not been called for the same +instance and systemId.

    @@ -23210,11 +24124,21 @@ been called for the same instance and systemId.

    +
  • +

    Revision 9, 2020-08-06 (Bryce Hutchings)

    +
    +
      +
    • +

      Added new XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING error code

      +
    • +
    +
    +
  • -

    12.12. XR_KHR_opengl_es_enable

    +

    12.16. XR_KHR_opengl_es_enable

    Name String
    @@ -23231,7 +24155,7 @@ been called for the same instance and systemId.

    Revision
    -

    6

    +

    7

    Extension and Version Dependencies
    @@ -23632,9 +24556,11 @@ output structure.

    The xrGetOpenGLESGraphicsRequirementsKHR function identifies to the application the minimum OpenGL ES version requirement and the highest known tested OpenGL ES version. -The runtime must return XR_ERROR_VALIDATION_FAILURE on calls to -xrCreateSession if xrGetOpenGLESGraphicsRequirementsKHR has not -been called for the same instance and systemId.

    +The runtime must return XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING +(XR_ERROR_VALIDATION_FAILURE may be returned due to legacy behavior) +on calls to xrCreateSession if +xrGetOpenGLESGraphicsRequirementsKHR has not been called for the same +instance and systemId.

    @@ -23768,11 +24694,21 @@ been called for the same instance and systemId.

    +
  • +

    Revision 7, 2020-08-06 (Bryce Hutchings)

    +
    +
      +
    • +

      Added new XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING error code

      +
    • +
    +
    +
  • -

    12.13. XR_KHR_visibility_mask

    +

    12.17. XR_KHR_visibility_mask

    Name String
    @@ -24257,7 +25193,7 @@ and index counts must be 0.

    -

    12.14. XR_KHR_vulkan_enable

    +

    12.18. XR_KHR_vulkan_enable

    Name String
    @@ -24274,7 +25210,7 @@ and index counts must be 0.

    Revision
    -

    6

    +

    7

    Extension and Version Dependencies
    @@ -24343,7 +25279,7 @@ or application that include it.

    A runtime may require that the VkInstance be initialized to a -specific vulkan API version. +specific Vulkan API version. Additionally, the runtime may require a set of instance extensions to be enabled in the VkInstance. These requirements can be queried by the application using @@ -24802,9 +25738,11 @@ output structure.

    The xrGetVulkanGraphicsRequirementsKHR function identifies to the application the minimum Vulkan version requirement and the highest known tested Vulkan version. -The runtime must return XR_ERROR_VALIDATION_FAILURE on calls to -xrCreateSession if xrGetVulkanGraphicsRequirementsKHR has not -been called for the same instance and systemId.

    +The runtime must return XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING +(XR_ERROR_VALIDATION_FAILURE may be returned due to legacy behavior) +on calls to xrCreateSession if +xrGetVulkanGraphicsRequirementsKHR has not been called for the same +instance and systemId.

    @@ -25313,11 +26251,1397 @@ instead of the app

    +
  • +

    Revision 7, 2020-08-06 (Bryce Hutchings)

    +
    +
      +
    • +

      Added new XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING error code

      +
    • +
    +
    +
  • -

    12.15. XR_KHR_vulkan_swapchain_format_list

    +

    12.19. XR_KHR_vulkan_enable2

    +
    +
    +
    Name String
    +
    +

    XR_KHR_vulkan_enable2

    +
    +
    Extension Type
    +
    +

    Instance extension

    +
    +
    Registered Extension Number
    +
    +

    91

    +
    +
    Revision
    +
    +

    1

    +
    +
    Extension and Version Dependencies
    +
    +
    +
      +
    • +

      Requires OpenXR 1.0

      +
    • +
    +
    +
    +
    +
    +
    +
    +
    Last Modified Date
    +
    +

    2020-05-04

    +
    +
    IP Status
    +
    +

    No known IP claims.

    +
    +
    Contributors
    +
    +

    Mark Young, LunarG
    +Paul Pedriana, Oculus
    +Ed Hutchins, Oculus
    +Andres Rodriguez, Valve
    +Dan Ginsburg, Valve
    +Bryce Hutchings, Microsoft
    +Minmin Gong, Microsoft
    +Robert Menzel, NVIDIA

    +
    +
    +
    +
    +

    12.19.1. Overview

    +
    +

    This extension enables the use of the Vulkan graphics API in an OpenXR +runtime. +Without this extension, the OpenXR runtime may not be able to use any Vulkan +swapchain images.

    +
    +
    +

    This extension provides the mechanisms necessary for an application to +generate a valid XrGraphicsBindingVulkan2KHR structure in order to +create a Vulkan-based XrSession.

    +
    +
    +

    This extension also provides mechanisms for the application to interact with +images acquired by calling xrEnumerateSwapchainImages.

    +
    +
    +

    In order to expose the structures, types, and functions of this extension, +you must define XR_USE_GRAPHICS_API_VULKAN before including the +OpenXR platform header openxr_platform.h, in all portions of your library +or application that include it.

    +
    +
    + + + + + +
    + + +
    Note
    +
    +

    This extension is intended as an alternative to XR_KHR_vulkan_enable, +and does not depend on it.

    +
    +
    +
    +
    +
    +

    12.19.2. Initialization

    +
    +

    When operating in Vulkan mode, the OpenXR runtime and the application will +share the Vulkan queue described in the XrGraphicsBindingVulkan2KHR +structure. +This section of the document describes the mechanisms this extensions +exposes to ensure the shared Vulkan queue is compatible with the runtime and +the application’s requirements.

    +
    +
    +
    Vulkan Version Requirements
    +
    +

    First, a compatible Vulkan version must be agreed upon. +To query the runtime’s Vulkan API version requirements an application will +call:

    +
    +
    +
    +
    +

    +
    +
    +
    +
    XrResult xrGetVulkanGraphicsRequirements2KHR(
    +    XrInstance                                  instance,
    +    XrSystemId                                  systemId,
    +    XrGraphicsRequirementsVulkanKHR*            graphicsRequirements);
    +
    +
    +
    +

    The xrGetVulkanGraphicsRequirementsKHR function identifies to the +application the runtime’s minimum Vulkan version requirement and the highest +known tested Vulkan version. +xrGetVulkanGraphicsRequirementsKHR must be called prior to calling +xrCreateSession. +The runtime must return XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING +on calls to xrCreateSession if +xrGetVulkanGraphicsRequirements2KHR has not been called for the same +instance and systemId.

    +
    +
    +
    +
    Parameter Descriptions
    +
    + +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    Return Codes
    +
    +
    +
    Success
    +
    +
    +
      +
    • +

      XR_SUCCESS

      +
    • +
    +
    +
    +
    Failure
    +
    +
    +
      +
    • +

      XR_ERROR_HANDLE_INVALID

      +
    • +
    • +

      XR_ERROR_INSTANCE_LOST

      +
    • +
    • +

      XR_ERROR_RUNTIME_FAILURE

      +
    • +
    • +

      XR_ERROR_SYSTEM_INVALID

      +
    • +
    • +

      XR_ERROR_VALIDATION_FAILURE

      +
    • +
    • +

      XR_ERROR_FUNCTION_UNSUPPORTED

      +
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    The XrGraphicsRequirementsVulkan2KHR structure populated by +xrGetVulkanGraphicsRequirements2KHR is defined as:

    +
    +
    +
    +
    +

    +
    +
    +
    +
    // XrGraphicsRequirementsVulkan2KHR is an alias for XrGraphicsRequirementsVulkanKHR
    +typedef struct XrGraphicsRequirementsVulkanKHR {
    +    XrStructureType    type;
    +    void*              next;
    +    XrVersion          minApiVersionSupported;
    +    XrVersion          maxApiVersionSupported;
    +} XrGraphicsRequirementsVulkanKHR;
    +
    +typedef XrGraphicsRequirementsVulkanKHR XrGraphicsRequirementsVulkan2KHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      type is the XrStructureType of this structure.

      +
    • +
    • +

      next is NULL or a pointer to the next structure in a structure +chain. +No such structures are defined in core OpenXR or this extension.

      +
    • +
    • +

      minApiVersionSupported is the minimum version of Vulkan that the +runtime supports. +Uses XR_MAKE_VERSION on major and minor API version, ignoring any +patch version component.

      +
    • +
    • +

      maxApiVersionSupported is the maximum version of Vulkan that the +runtime has been tested on and is known to support. +Newer Vulkan versions might work if they are compatible. +Uses XR_MAKE_VERSION on major and minor API version, ignoring any +patch version component.

      +
    • +
    +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    Vulkan Instance Creation
    +
    +

    Second, a compatible VkInstance must be created. +The xrCreateVulkanInstanceKHR entry point is a wrapper around +vkCreateInstance intended for +this purpose. +When called, the runtime must aggregate the requirements specified by the +application with its own requirements and forward the VkInstance +creation request to the vkCreateInstance function pointer returned by +pfnGetInstanceProcAddr.

    +
    +
    +
    +
    +

    +
    +
    +
    +
    XrResult xrCreateVulkanInstanceKHR(
    +    XrInstance                                  instance,
    +    const XrVulkanInstanceCreateInfoKHR*        createInfo,
    +    VkInstance*                                 vulkanInstance,
    +    VkResult*                                   vulkanResult);
    +
    +
    +
    +
    +
    Parameter Descriptions
    +
    +
      +
    • +

      instance is an XrInstance handle previously created with +xrCreateInstance.

      +
    • +
    • +

      createInfo extensible input struct of type +XrCreateVulkanInstanceCreateInfoKHR

      +
    • +
    • +

      vulkanInstance points to a VkInstance handle to populate with +the new Vulkan instance.

      +
    • +
    • +

      vulkanResult points to a VkResult to populate with the result +of the vkCreateInstance operation as returned by +pfnGetInstanceProcAddr.

      +
    • +
    +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    Return Codes
    +
    +
    +
    Success
    +
    +
    +
      +
    • +

      XR_SUCCESS

      +
    • +
    +
    +
    +
    Failure
    +
    +
    +
      +
    • +

      XR_ERROR_INSTANCE_LOST

      +
    • +
    • +

      XR_ERROR_RUNTIME_FAILURE

      +
    • +
    • +

      XR_ERROR_HANDLE_INVALID

      +
    • +
    • +

      XR_ERROR_SYSTEM_INVALID

      +
    • +
    • +

      XR_ERROR_VALIDATION_FAILURE

      +
    • +
    • +

      XR_ERROR_FUNCTION_UNSUPPORTED

      +
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    The XrVulkanInstanceCreateInfoKHR structure contains the input +parameters to xrCreateVulkanInstanceKHR.

    +
    +
    +
    +
    +

    +
    +
    +
    +
    typedef struct XrVulkanInstanceCreateInfoKHR {
    +    XrStructureType                   type;
    +    const void*                       next;
    +    XrSystemId                        systemId;
    +    XrVulkanInstanceCreateFlagsKHR    createFlags;
    +    PFN_vkGetInstanceProcAddr         pfnGetInstanceProcAddr;
    +    const VkInstanceCreateInfo*       vulkanCreateInfo;
    +    const VkAllocationCallbacks*      vulkanAllocator;
    +} XrVulkanInstanceCreateInfoKHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    + +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    +
      +
    • +

      The XR_KHR_vulkan_enable2 extension must be enabled prior to using XrVulkanInstanceCreateInfoKHR

      +
    • +
    • +

      type must be XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR

      +
    • +
    • +

      next must be NULL or a valid pointer to the next structure in a structure chain

      +
    • +
    • +

      createFlags must be 0

      +
    • +
    • +

      pfnGetInstanceProcAddr must be a valid PFN_vkGetInstanceProcAddr value

      +
    • +
    • +

      vulkanCreateInfo must be a pointer to a valid VkInstanceCreateInfo value

      +
    • +
    • +

      vulkanAllocator must be a pointer to a valid VkAllocationCallbacks value

      +
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    +
    +
    +
    +
    typedef XrFlags64 XrVulkanInstanceCreateFlagsKHR;
    +
    +
    +
    +
    +
    +
    +
    Physical Device Selection
    +
    +

    Third, a VkPhysicalDevice must be chosen. +Some computer systems may have multiple graphics devices, each of which may +have independent external display outputs. +The runtime must report a VkPhysicalDevice that is compatible with +the OpenXR implementation when xrGetVulkanGraphicsDevice2KHR is +invoked. +The application will use this VkPhysicalDevice to interact with the +OpenXR runtime.

    +
    +
    +
    +
    +

    +
    +
    +
    +
    XrResult xrGetVulkanGraphicsDevice2KHR(
    +    XrInstance                                  instance,
    +    const XrVulkanGraphicsDeviceGetInfoKHR*     getInfo,
    +    VkPhysicalDevice*                           vulkanPhysicalDevice);
    +
    +
    +
    +
    +
    Parameter Descriptions
    +
    + +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    Return Codes
    +
    +
    +
    Success
    +
    +
    +
      +
    • +

      XR_SUCCESS

      +
    • +
    +
    +
    +
    Failure
    +
    +
    +
      +
    • +

      XR_ERROR_HANDLE_INVALID

      +
    • +
    • +

      XR_ERROR_INSTANCE_LOST

      +
    • +
    • +

      XR_ERROR_RUNTIME_FAILURE

      +
    • +
    • +

      XR_ERROR_SYSTEM_INVALID

      +
    • +
    • +

      XR_ERROR_VALIDATION_FAILURE

      +
    • +
    • +

      XR_ERROR_FUNCTION_UNSUPPORTED

      +
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    The XrVulkanGraphicsDeviceGetInfoKHR structure contains the input +parameters to xrCreateVulkanInstanceKHR.

    +
    +
    +
    +
    +

    +
    +
    +
    +
    typedef struct XrVulkanGraphicsDeviceGetInfoKHR {
    +    XrStructureType    type;
    +    const void*        next;
    +    XrSystemId         systemId;
    +    VkInstance         vulkanInstance;
    +} XrVulkanGraphicsDeviceGetInfoKHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      systemId is an XrSystemId handle for the system which will +be used to create a session.

      +
    • +
    • +

      vulkanInstance is a valid Vulkan VkInstance.

      +
    • +
    +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    Vulkan Device Creation
    +
    +

    Fourth, a compatible VkDevice must be created. +The xrCreateVulkanDeviceKHR entry point is a wrapper around +vkCreateDevice intended for this +purpose. +When called, the runtime must aggregate the requirements specified by the +application with its own requirements and forward the VkDevice +creation request to the vkCreateDevice function pointer returned by +pfnGetInstanceProcAddr.

    +
    +
    +
    +
    +

    +
    +
    +
    +
    XrResult xrCreateVulkanDeviceKHR(
    +    XrInstance                                  instance,
    +    const XrVulkanDeviceCreateInfoKHR*          createInfo,
    +    VkDevice*                                   vulkanDevice,
    +    VkResult*                                   vulkanResult);
    +
    +
    +
    +
    +
    Parameter Descriptions
    +
    +
      +
    • +

      instance is an XrInstance handle previously created with +xrCreateInstance.

      +
    • +
    • +

      createInfo extensible input struct of type +XrCreateVulkanDeviceCreateInfoKHR

      +
    • +
    • +

      vulkanDevice points to a VkDevice handle to populate with the +new Vulkan device.

      +
    • +
    • +

      vulkanResult points to a VkResult to populate with the result +of the vkCreateDevice operation as returned by +pfnGetInstanceProcAddr.

      +
    • +
    +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    Return Codes
    +
    +
    +
    Success
    +
    +
    +
      +
    • +

      XR_SUCCESS

      +
    • +
    +
    +
    +
    Failure
    +
    +
    +
      +
    • +

      XR_ERROR_INSTANCE_LOST

      +
    • +
    • +

      XR_ERROR_RUNTIME_FAILURE

      +
    • +
    • +

      XR_ERROR_HANDLE_INVALID

      +
    • +
    • +

      XR_ERROR_SYSTEM_INVALID

      +
    • +
    • +

      XR_ERROR_VALIDATION_FAILURE

      +
    • +
    • +

      XR_ERROR_FUNCTION_UNSUPPORTED

      +
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    The XrVulkanDeviceCreateInfoKHR structure contains the input +parameters to xrCreateVulkanDeviceKHR.

    +
    +
    +
    +
    +

    +
    +
    +
    +
    typedef struct XrVulkanDeviceCreateInfoKHR {
    +    XrStructureType                 type;
    +    const void*                     next;
    +    XrSystemId                      systemId;
    +    XrVulkanDeviceCreateFlagsKHR    createFlags;
    +    PFN_vkGetInstanceProcAddr       pfnGetInstanceProcAddr;
    +    VkPhysicalDevice                vulkanPhysicalDevice;
    +    const VkDeviceCreateInfo*       vulkanCreateInfo;
    +    const VkAllocationCallbacks*    vulkanAllocator;
    +} XrVulkanDeviceCreateInfoKHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    + +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    +
      +
    • +

      The XR_KHR_vulkan_enable2 extension must be enabled prior to using XrVulkanDeviceCreateInfoKHR

      +
    • +
    • +

      type must be XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR

      +
    • +
    • +

      next must be NULL or a valid pointer to the next structure in a structure chain

      +
    • +
    • +

      createFlags must be 0

      +
    • +
    • +

      pfnGetInstanceProcAddr must be a valid PFN_vkGetInstanceProcAddr value

      +
    • +
    • +

      vulkanPhysicalDevice must be a valid VkPhysicalDevice value

      +
    • +
    • +

      vulkanCreateInfo must be a pointer to a valid VkDeviceCreateInfo value

      +
    • +
    • +

      vulkanAllocator must be a pointer to a valid VkAllocationCallbacks value

      +
    • +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    +
    +
    +
    +
    typedef XrFlags64 XrVulkanDeviceCreateFlagsKHR;
    +
    +
    +
    +
    +
    +

    If the vulkanPhysicalDevice parameter does not match the output of +xrGetVulkanGraphicsDeviceKHR, then the runtime must return +XR_ERROR_HANDLE_INVALID.

    +
    +
    +
    +
    Queue Selection
    +
    +

    Last, the application selects a VkQueue from the VkDevice that +has the VK_QUEUE_GRAPHICS_BIT set.

    +
    +
    + + + + + +
    + + +
    Note
    +
    +

    The runtime may schedule work on the VkQueue specified in the binding, +or it may schedule work on any hardware queue in a foreign logical device.

    +
    +
    +
    +
    +
    +
    Vulkan Graphics Binding
    +
    +

    When creating a Vulkan-backed XrSession, the application will chain a +pointer to an XrGraphicsBindingVulkan2KHR to the +XrSessionCreateInfo parameter of xrCreateSession. +With the data collected in the previous sections, the application now has +all the necessary information to populate an +XrGraphicsBindingVulkan2KHR structure for session creation.

    +
    +
    +
    +
    +

    +
    +
    +
    +
    // XrGraphicsBindingVulkan2KHR is an alias for XrGraphicsBindingVulkanKHR
    +typedef struct XrGraphicsBindingVulkanKHR {
    +    XrStructureType     type;
    +    const void*         next;
    +    VkInstance          instance;
    +    VkPhysicalDevice    physicalDevice;
    +    VkDevice            device;
    +    uint32_t            queueFamilyIndex;
    +    uint32_t            queueIndex;
    +} XrGraphicsBindingVulkanKHR;
    +
    +typedef XrGraphicsBindingVulkanKHR XrGraphicsBindingVulkan2KHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      type is the XrStructureType of this structure.

      +
    • +
    • +

      next is NULL or a pointer to the next structure in a structure +chain. +No such structures are defined in core OpenXR or this extension.

      +
    • +
    • +

      instance is a valid Vulkan VkInstance.

      +
    • +
    • +

      physicalDevice is a valid Vulkan VkPhysicalDevice.

      +
    • +
    • +

      device is a valid Vulkan VkDevice.

      +
    • +
    • +

      queueFamilyIndex is a valid queue family index on device.

      +
    • +
    • +

      queueIndex is a valid queue index on device to be used for +synchronization.

      +
    • +
    +
    +
    +
    +
    +
    +
    Valid Usage
    +
    + +
    +
    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +

    Populating a XrGraphicsBindingVulkan2KHR structure with a member that +does not meet the requirements outlined by this extension may result in +undefined behaviour by the OpenXR runtime.

    +
    +
    +

    The requirements outlined in this extension only apply to the +VkInstance, VkDevice, VkPhysicalDevice and VkQueue +objects which the application wishes to associate with an +XrGraphicsBindingVulkan2KHR.

    +
    +
    +
    +
    +

    12.19.3. Concurrency

    +
    +

    Vulkan requires that concurrent access to a VkQueue from multiple +threads be externally synchronized. +Therefore, OpenXR functions that may access the VkQueue specified in +the XrGraphicsBindingVulkan2KHR must also be externally synchronized +by the OpenXR application.

    +
    +
    +

    The list of OpenXR functions where the OpenXR runtime may access the +VkQueue are:

    +
    + +
    +

    The runtime must not access the VkQueue in any OpenXR function that +is not listed above or in an extension definition.

    +
    +
    +

    Failure by the application to synchronize access to VkQueue may +result in undefined behaviour in the OpenXR runtime.

    +
    +
    +
    +

    12.19.4. Swapchain Interactions

    +
    +
    Swapchain Images
    +
    +

    When an application interacts with XrSwapchainImageBaseHeader +structures in a Vulkan-backed XrSession, the application can interpret +these to be XrSwapchainImageVulkan2KHR structures. +These are defined as:

    +
    +
    +
    +
    +

    +
    +
    +
    +
    // XrSwapchainImageVulkan2KHR is an alias for XrSwapchainImageVulkanKHR
    +typedef struct XrSwapchainImageVulkanKHR {
    +    XrStructureType    type;
    +    void*              next;
    +    VkImage            image;
    +} XrSwapchainImageVulkanKHR;
    +
    +typedef XrSwapchainImageVulkanKHR XrSwapchainImageVulkan2KHR;
    +
    +
    +
    +
    +
    Member Descriptions
    +
    +
      +
    • +

      type is the XrStructureType of this structure.

      +
    • +
    • +

      next is NULL or a pointer to the next structure in a structure +chain. +No such structures are defined in core OpenXR or this extension.

      +
    • +
    • +

      image is a valid Vulkan VkImage to use.

      +
    • +
    +
    +
    +
    +
    +

    If a given session was created with XrGraphicsBindingVulkan2KHR, the +following conditions must apply.

    +
    +
    + +
    +
    +

    The OpenXR runtime must interpret the top-left corner of the swapchain +image as the coordinate origin unless specified otherwise by extension +functionality.

    +
    +
    +

    The OpenXR runtime must interpret the swapchain images in a clip space of +positive Y pointing down, near Z plane at 0, and far Z plane at 1.

    +
    +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    Swapchain Image Layout
    +
    +

    When an application acquires a swapchain image by calling +xrAcquireSwapchainImage in a session created using +XrGraphicsBindingVulkan2KHR, the OpenXR runtime must guarantee that:

    +
    +
    +
      +
    • +

      The image has a memory layout compatible with +VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL for color images, or +VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL for depth images.

      +
    • +
    • +

      The VkQueue specified in XrGraphicsBindingVulkan2KHR has +ownership of the image.

      +
    • +
    +
    +
    +

    When an application releases a swapchain image by calling +xrReleaseSwapchainImage, in a session created using +XrGraphicsBindingVulkan2KHR, the OpenXR runtime must interpret the +image as:

    +
    +
    +
      +
    • +

      Having a memory layout compatible with +VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL for color images, or +VK_IMAGE_LAYOUT_DEPTH_STENCIAL_ATTACHMENT_OPTIMAL for depth images.

      +
    • +
    • +

      Being owned by the VkQueue specified in +XrGraphicsBindingVulkan2KHR.

      +
    • +
    • +

      Being referenced by command buffers submitted to the VkQueue +specified in XrGraphicsBindingVulkan2KHR which have not yet +completed execution.

      +
    • +
    +
    +
    +

    The application is responsible for transitioning the swapchain image back to +the image layout and queue ownership that the OpenXR runtime requires. +If the image is not in a layout compatible with the above specifications the +runtime may exhibit undefined behaviour.

    +
    +
    +
    +
    +

    12.19.5. Appendix

    +
    +
    Questions
    +
    +
      +
    1. +

      Should the xrCreateVulkanDeviceKHR and +xrCreateVulkanInstanceKHR functions have an output parameter that +returns the combined list of parameters used to create the Vulkan +device/instance?

      +
      +
        +
      • +

        No. +If the application is interested in capturing this data it can set the +pfnGetInstanceProcAddr parameter to a local callback that +captures the relevant information.

        +
      • +
      +
      +
    2. +
    +
    +
    +
    +
    Quick Reference
    +
    +
    New Enum Constants
    +
    +

    XrStructureType enumeration is extended with:

    +
    +
    +
      +
    • +

      XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN2_KHR (alias of +XR_TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR)

      +
    • +
    • +

      XR_TYPE_GRAPHICS_BINDING_VULKAN2_KHR (alias of +XR_TYPE_GRAPHICS_BINDING_VULKAN_KHR)

      +
    • +
    • +

      XR_TYPE_SWAPCHAIN_IMAGE_VULKAN2_KHR (alias of +XR_TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR)

      +
    • +
    +
    +
    + + +
    +
    +
    Version History
    +
    +
      +
    • +

      Revision 1, 2020-05-04 (Andres Rodriguez)

      +
      +
        +
      • +

        Initial draft

        +
      • +
      +
      +
    • +
    +
    +
    +
    +
    +
    +

    12.20. XR_KHR_vulkan_swapchain_format_list

    Name String
    @@ -25334,7 +27658,7 @@ instead of the app

    Revision
    -

    2

    +

    3

    Extension and Version Dependencies
    @@ -25351,7 +27675,7 @@ instead of the app

    Last Modified Date
    -

    2017-09-13

    +

    2020-01-01

    IP Status
    @@ -25386,9 +27710,10 @@ must create OpenXR swapchains with the

    Runtimes implementing this extension must support the -XR_KHR_vulkan_enable extension and add VK_KHR_image_format_list -to the list returned by xrGetVulkanDeviceExtensionsKHR, as the runtime -will need to use that Vulkan extension.

    +XR_KHR_vulkan_enable or the XR_KHR_vulkan_enable2 extension. +When XR_KHR_vulkan_enable is used, the runtime must add +VK_KHR_image_format_list to the list of extensions enabled in +xrCreateVulkanDeviceKHR.

    New Object Types

    @@ -25507,11 +27832,21 @@ No such structures are defined in core OpenXR or this extension.

    +
  • +

    Revision 3, 2020-01-01 (Andres Rodriguez)

    +
    +
      +
    • +

      Update for XR_KHR_vulkan_enable2

      +
    • +
    +
    +
  • -

    12.16. XR_KHR_win32_convert_performance_counter_time

    +

    12.21. XR_KHR_win32_convert_performance_counter_time

    Name String
    @@ -25833,7 +28168,7 @@ Windows function.

    -

    12.17. XR_EXT_conformance_automation

    +

    12.22. XR_EXT_conformance_automation

    Name String
    @@ -26582,7 +28917,7 @@ wish to set the pose for (e.g. /user/hand/left/input/grip/pose).

    -

    12.18. XR_EXT_debug_utils

    +

    12.23. XR_EXT_debug_utils

    Name String
    @@ -26657,7 +28992,7 @@ tracking.

    -

    12.18.1. Object Debug Annotation

    +

    12.23.1. Object Debug Annotation

    It can be useful for an application to provide its own content relative to a specific OpenXR handle.

    @@ -26683,7 +29018,7 @@ structure is an empty string, then any previously set name is removed.

    -

    12.18.2. Debug Messengers

    +

    12.23.2. Debug Messengers

    OpenXR allows an application to register arbitrary number of callbacks with all the OpenXR components wishing to report debug information. @@ -26706,7 +29041,7 @@ debug messages.

    -

    12.18.3. Debug Message Categorization

    +

    12.23.3. Debug Message Categorization

    Messages that are triggered by the debug messenger are categorized by their message type and severity. @@ -26857,7 +29192,7 @@ this can be done.

    -

    12.18.4. Session Labels

    +

    12.23.4. Session Labels

    All OpenXR work is performed inside of an XrSession. There are times that it helps to label areas in your OpenXR session to allow @@ -28645,7 +30980,7 @@ VK_EXT_debug_utils extension by Peter Kraus (aka @krOoze).

    -

    12.19. XR_EXT_eye_gaze_interaction

    +

    12.24. XR_EXT_eye_gaze_interaction

    Name String
    @@ -28732,7 +31067,7 @@ determine if the eye tracker is actively tracking the users eye gaze, and use the eye gaze pose as an input signal to build eye gaze interactions.

    -

    12.19.1. Eye tracker

    +

    12.24.1. Eye tracker

    An eye tracker is a sensory device that tracks eyes and accurately maps what the user is looking at. @@ -28766,7 +31101,7 @@ tracked space.

    -

    12.19.2. Device enumeration

    +

    12.24.2. Device enumeration

    When the eye gaze input extension is enabled an application may pass in a XrSystemEyeGazeInteractionPropertiesEXT structure in next chain @@ -28837,7 +31172,7 @@ set this to XR_FALSE.

    -

    12.19.3. Eye gaze input

    +

    12.24.3. Eye gaze input

    This extension exposes a new interaction profile path /interaction_profiles/ext/eye_gaze_interaction that is valid for @@ -28974,7 +31309,7 @@ No such structures are defined in core OpenXR or this extension.

    -

    12.19.4. Sample code

    +

    12.24.4. Sample code

    The following example code shows how to bind the eye pose to the action system.

    @@ -29080,7 +31415,7 @@ while(true)
    -

    12.20. XR_EXT_hand_tracking

    +

    12.25. XR_EXT_hand_tracking

    Name String
    @@ -29419,7 +31754,7 @@ joints to retrieve.

    type must be XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT

  • -

    next must be NULL or a valid pointer to the next structure in a structure chain

    +

    next must be NULL or a valid pointer to the next structure in a structure chain. See also: XrHandPoseTypeInfoMSFT

  • hand must be a valid XrHandEXT value

    @@ -30488,7 +32823,7 @@ defined in XrHandJointEXT

  • -

    12.21. XR_EXT_hp_mixed_reality_controller

    +

    12.26. XR_EXT_hp_mixed_reality_controller

    Name String
    @@ -30545,7 +32880,7 @@ Controllers:

    • -

      /interaction_profile/hp/mixed_reality_controller

      +

      /interaction_profiles/hp/mixed_reality_controller

    @@ -30648,7 +32983,7 @@ Controllers:

    -

    12.22. XR_EXT_performance_settings

    +

    12.27. XR_EXT_performance_settings

    Name String
    @@ -30693,7 +33028,7 @@ Innovation Center, Inc

    -

    12.22.1. Overview

    +

    12.27.1. Overview

    This extension defines an API for the application to give performance hints to the runtime and for the runtime to send performance related notifications @@ -30721,7 +33056,7 @@ load without consuming more energy than necessary.

    -

    12.22.2. Setting Performance Levels Hints

    +

    12.27.2. Setting Performance Levels Hints

    Performance level hint definition
    @@ -30902,7 +33237,7 @@ sustainable XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT for CPU
    - +

    The XR runtime shall provide performance related notifications to the application in the following situations:

    @@ -31401,7 +33736,7 @@ No such structures are defined in core OpenXR or this extension.

    -

    12.23. XR_EXT_samsung_odyssey_controller

    +

    12.28. XR_EXT_samsung_odyssey_controller

    Name String
    @@ -31460,10 +33795,10 @@ controller.

    This extension added a new interaction profile -/interaction_profile/samsung/odyssey_controller to describe the +/interaction_profiles/samsung/odyssey_controller to describe the Odyssey controller. The action bindings of this interaction profile work exactly the same as the -/interaction_profile/microsoft/motion_controller in terms of +/interaction_profiles/microsoft/motion_controller in terms of valid user paths and supported input and output component paths.

    @@ -31506,7 +33841,7 @@ for the form factor of …/samsung/odyssey_controller.

    -

    12.24. XR_EXT_thermal_query

    +

    12.29. XR_EXT_thermal_query

    Name String
    @@ -31551,14 +33886,14 @@ Innovation Center, Inc

    -

    12.24.1. Overview

    +

    12.29.1. Overview

    This extension provides an API to query a domain’s current thermal warning level and current thermal trend.

    -

    12.24.2. Querying the current thermal level and trend

    +

    12.29.2. Querying the current thermal level and trend

    This query allows to determine the extent and urgency of the needed workload reduction and to verify that the mitigation measures efficiently reduce the @@ -31765,7 +34100,7 @@ most critical temperature of the domain.

    -

    12.25. XR_EXT_view_configuration_depth_range

    +

    12.30. XR_EXT_view_configuration_depth_range

    Name String
    @@ -31973,7 +34308,7 @@ of XrViewConfigurationView.

    -

    12.26. XR_EXT_win32_appcontainer_compatible

    +

    12.31. XR_EXT_win32_appcontainer_compatible

    Name String
    @@ -32092,7 +34427,7 @@ properly in the AppContainer execution environment.

    -

    12.27. XR_EPIC_view_configuration_fov

    +

    12.32. XR_EPIC_view_configuration_fov

    Name String
    @@ -32269,7 +34604,7 @@ display.

    -

    12.28. XR_HUAWEI_controller_interaction

    +

    12.33. XR_HUAWEI_controller_interaction

    Name String
    @@ -32439,7 +34774,7 @@ Huawei Controller.

    -

    12.29. XR_MND_headless

    +

    12.34. XR_MND_headless

    Name String
    @@ -32598,7 +34933,7 @@ false.

    -

    12.30. XR_MND_swapchain_usage_input_attachment_bit

    +

    12.35. XR_MND_swapchain_usage_input_attachment_bit

    Name String
    @@ -32712,12 +35047,12 @@ At the time of writing this bit only affects Vulkan swapchains.

    -

    12.31. XR_MSFT_controller_model_preview

    +

    12.36. XR_MSFT_controller_model

    Name String
    -

    XR_MSFT_controller_model_preview

    +

    XR_MSFT_controller_model

    Extension Type
    @@ -32729,7 +35064,7 @@ At the time of writing this bit only affects Vulkan swapchains.

    Revision
    -

    1

    +

    2

    Extension and Version Dependencies
    @@ -32755,13 +35090,16 @@ Lachlan Ford, Microsoft

    This extension provides a mechanism to load a GLTF model for controllers. -An application can render the controller model using the realtime pose input from controller’s grip action pose -and animate controller parts representing the user’s interactions, such as pressing a button, or pulling a trigger.

    +An application can render the controller model using the real time pose +input from controller’s grip action pose and animate controller parts +representing the user’s interactions, such as pressing a button, or pulling +a trigger.

    -

    This extension supports any controller interaction profile that supports …/grip/pose. -The returned controller model represents the physical controller held in the user’s hands, -and it can be different from the current interaction profile.

    +

    This extension supports any controller interaction profile that supports +…/grip/pose. +The returned controller model represents the physical controller held in the +user’s hands, and it may be different from the current interaction profile.

    Query controller model key

    @@ -32769,11 +35107,12 @@ and it can be different from the current interac
    -

    xrGetControllerModelKeyMSFT retrieves the XrControllerModelKeyMSFT for a controller. -This model key may later be used to retrieve the model data.

    +

    xrGetControllerModelKeyMSFT retrieves the +XrControllerModelKeyMSFT for a controller. +This model key may later be used to retrieve the model data.

    -

    The xrGetControllerModelKeyMSFT function is defined as.

    +

    The xrGetControllerModelKeyMSFT function is defined as:

    @@ -32795,15 +35134,92 @@ This model key may later be used to retrieve the model data.

    session is the specified XrSession.

  • -

    topLevelUserPath is the top level user path corresponding to the controller render model being queried (e.g. /user/hand/left or /user/hand/right).

    +

    topLevelUserPath is the top level user path corresponding to the +controller render model being queried (e.g. /user/hand/left or +/user/hand/right).

  • -

    controllerModelKeyState is a pointer to the XrControllerModelKeyStateMSFT to write the model key state to.

    +

    controllerModelKeyState is a pointer to the +XrControllerModelKeyStateMSFT to write the model key state to.

  • +
    +
    +
    Valid Usage (Implicit)
    +
    + +
    +
    +
    +
    +
    +
    Return Codes
    +
    +
    +
    Success
    +
    +
    +
      +
    • +

      XR_SUCCESS

      +
    • +
    +
    +
    +
    Failure
    +
    +
    +
      +
    • +

      XR_ERROR_INSTANCE_LOST

      +
    • +
    • +

      XR_ERROR_OUT_OF_MEMORY

      +
    • +
    • +

      XR_ERROR_FUNCTION_UNSUPPORTED

      +
    • +
    • +

      XR_ERROR_VALIDATION_FAILURE

      +
    • +
    • +

      XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT

      +
    • +
    • +

      XR_ERROR_HANDLE_INVALID

      +
    • +
    • +

      XR_ERROR_SESSION_LOST

      +
    • +
    • +

      XR_SESSION_LOSS_PENDING

      +
    • +
    • +

      XR_ERROR_PATH_UNSUPPORTED

      +
    • +
    • +

      XR_ERROR_PATH_INVALID

      +
    • +
    +
    +
    +
    +
    +
    +
    @@ -32832,33 +35248,29 @@ This model key may later be used to retrieve the model data.

    type is the XrStructureType of this structure.

  • -

    next is NULL or a pointer to the next structure in a structure chain.

    +

    next is NULL or a pointer to the next structure in a structure +chain.

  • -

    modelKey is the model key corresponding to the controller render model being queried.

    +

    modelKey is the model key corresponding to the controller render +model being queried.

  • -

    A modelKey value of XR_NULL_CONTROLLER_MODEL_KEY_MSFT, represents an invalid model key and indicates there is no controller model available.

    +

    The modelKey value for the session represents a unique controller +model that can be retrieved from xrLoadControllerModelMSFT function. +Therefore, the application can use modelKey to cache the returned +data from xrLoadControllerModelMSFT for the session.

    -

    A unique value of modelKey of the session represents a unique controller model that can be retrieved from xrLoadControllerModelMSFT function. -Therefore, the application can use modelKey to cache the returned data from xrLoadControllerModelMSFT for the session.

    -
    -
    -

    The controller model may be temporarily unavailable for a valid model key, and xrLoadControllerModelMSFT may return error. -The application should avoid caching the invalid data in this case, and try to load the model again some time later, -for example after the next xrSyncActions function call.

    -
    -
    -

    If the controller doesn’t provide any valid controller model, the runtime must return modelKeyValid as XR_FALSE, and modelKey as 0.

    -
    -
    -

    The runtime must retain the data related to the modelKey before application calls xrSyncActions again, -including the data returned by xrLoadControllerModelMSFT, xrGetControllerModelPropertiesMSFT and xrGetControllerModelStateMSFT.

    +

    A modelKey value of XR_NULL_CONTROLLER_MODEL_KEY_MSFT, +represents an invalid model key and indicates there is no controller model +yet available. +The application should keep calling xrGetControllerModelKeyMSFT +because the model may become available at a later point.

    @@ -32914,15 +35327,18 @@ including the data returned by xrLoadContro

    Load controller model as glTF 2.0 data

    -

    Once the application obtained a valid modelKey, -it can use the xrLoadControllerModelMSFT function to load the GLB data for the controller model.

    +

    Once the application obtained a valid modelKey, it can use the +xrLoadControllerModelMSFT function to load the GLB data for the +controller model.

    -

    The xrLoadControllerModelMSFT function loads the controller model as a byte buffer -containing a binary form of glTF (a.k.a GLB file format) for the controller. -The binary glTF data must conform to glTF 2.0 format defined at https://github.com/KhronosGroup/glTF/tree/master/specification/2.0.

    +

    The xrLoadControllerModelMSFT function loads the controller model as a +byte buffer containing a binary form of glTF (a.k.a GLB file format) for the +controller. +The binary glTF data must conform to glTF 2.0 format defined at +https://github.com/KhronosGroup/glTF/tree/master/specification/2.0.

    @@ -32932,8 +35348,8 @@ The binary glTF data must conform to glTF 2.0 fo
    XrResult xrLoadControllerModelMSFT(
         XrSession                                   session,
         XrControllerModelKeyMSFT                    modelKey,
    -    uint32_t                                    sizeInput,
    -    uint32_t*                                   sizeOutput,
    +    uint32_t                                    bufferCapacityInput,
    +    uint32_t*                                   bufferCountOutput,
         uint8_t*                                    buffer);
    @@ -32946,32 +35362,41 @@ The binary glTF data must conform to glTF 2.0 fo

    session is the specified XrSession.

  • -

    modelKey is the model key corresponding to the controller render model being queried.

    +

    modelKey is the model key corresponding to the controller render +model being queried.

  • -

    sizeInput is the size in bytes of the buffer provided.

    +

    bufferCapacityInput is the capacity of the buffer array, or 0 +to indicate a request to retrieve the required capacity.

  • -

    sizeOutput is the size in bytes of the model for the device, filled in by the runtime.

    +

    bufferCountOutput filled in by the runtime with the count of +elements in buffer array, or returns the required capacity in the +case that bufferCapacityInput is 0.

  • -

    buffer is the pointer to the bytes of the model for the device, filled in by the runtime.

    +

    buffer is a pointer to an application-allocated array of the model +for the device that will be filled with the uint8_t values by the +runtime. +It can be NULL if bufferCapacityInput is 0.

    +
  • +
  • +

    See Buffer Size Parameters chapter for a +detailed description of retrieving the required buffer size.

  • -

    The xrLoadControllerModelMSFT function typically involves loading files from disk, -and therefore should be avoided to be invoked in any time critical threads, such as UI or rendering thread.

    +

    The xrLoadControllerModelMSFT function may be a slow operation and +therefore should be invoked from a non-timing critical thread.

    -

    If the input modelKey is invalid, i.e. it’s '0' or not returned from XrControllerModelKeyStateMSFT, -the runtime must return XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

    -
    -
    -

    If the data for the given modelKey is not available, -the runtime must return XR_ERROR_CONTROLLER_MODEL_UNAVAILABLE_MSFT.

    +

    If the input modelKey is invalid, i.e. it is +XR_NULL_CONTROLLER_MODEL_KEY_MSFT or not a key returned from +XrControllerModelKeyStateMSFT, the runtime must return +XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

    @@ -32979,16 +35404,16 @@ the runtime must return XR_ERROR_CONTROLLE
    • -

      The XR_MSFT_controller_model_preview extension must be enabled prior to calling xrLoadControllerModelMSFT

      +

      The XR_MSFT_controller_model extension must be enabled prior to calling xrLoadControllerModelMSFT

    • session must be a valid XrSession handle

    • -

      If sizeOutput is not NULL, sizeOutput must be a pointer to a uint32_t value

      +

      bufferCountOutput must be a pointer to a uint32_t value

    • -

      If sizeInput is not 0, buffer must be a pointer to an array of sizeInput uint8_t values

      +

      If bufferCapacityInput is not 0, buffer must be a pointer to an array of bufferCapacityInput uint8_t values

    @@ -33032,9 +35457,6 @@ the runtime must return XR_ERROR_CONTROLLE

    XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT

  • -

    XR_ERROR_CONTROLLER_MODEL_UNAVAILABLE_MSFT

    -
  • -
  • XR_ERROR_HANDLE_INVALID

  • @@ -33056,28 +35478,27 @@ the runtime must return XR_ERROR_CONTROLLE

    Animate controller parts

  • -

    The application can animate parts of the glTF model to represent the user’s interaction on the controller, -such as pressing a button or pulling a trigger.

    +

    The application can animate parts of the glTF model to represent the user’s +interaction on the controller, such as pressing a button or pulling a +trigger.

    -

    Once the application loads the glTF model of the controller, -it should first get XrControllerModelPropertiesMSFT containing an array of -node names in the glTF model that can be animated. +

    Once the application loads the glTF model of the controller, it should +first get XrControllerModelPropertiesMSFT containing an array of node +names in the glTF model that can be animated. These properties, including the order of these node names in the array, -must be immutable for a valid modelKey in the session, and therefore can be cached.

    -
    -
    -

    Then, after each xrSyncActions in frame loop, -the application should get XrControllerModelStateMSFT to retrieve -the pose of each node representing user’s interaction on the controller. -The application can then apply the transform to the corresponding node -in the glTF model using application’s glTF renderer.

    +must be immutable for a valid modelKey in the session, and therefore +can be cached. +In the frame loop, the application should get +XrControllerModelStateMSFT to retrieve the pose of each node +representing user’s interaction on the controller and apply the transform to +the corresponding node in the glTF model using application’s glTF renderer.

    -

    The xrGetControllerModelPropertiesMSFT function returns the controller model properties -for a given modelKey.

    +

    The xrGetControllerModelPropertiesMSFT function returns the controller +model properties for a given modelKey.

    @@ -33099,32 +35520,29 @@ for a given modelKey.

    session is the specified XrSession.

  • -

    modelKey is a valid model key obtained from XrControllerModelKeyStateMSFT

    +

    modelKey is a valid model key obtained from +XrControllerModelKeyStateMSFT

  • -

    properties is a XrControllerModelPropertiesMSFT returns the properties of the controller model

    +

    properties is a XrControllerModelPropertiesMSFT returns the +properties of the controller model

  • -

    The runtime must return the same data in XrControllerModelPropertiesMSFT for a valid modelKey. -Therefore, the application can cache the returned XrControllerModelPropertiesMSFT using modelKey -and reuse the data for each frame.

    +

    The runtime must return the same data in +XrControllerModelPropertiesMSFT for a valid modelKey. +Therefore, the application can cache the returned +XrControllerModelPropertiesMSFT using modelKey and reuse the +data for each frame.

    -

    The runtime must retain the data of XrControllerModelKeyStateMSFT for a modelKey -before the subsequence call to the xrSyncActions.

    -
    -
    -

    If the input modelKey is not from a pose action state returned after the previous xrSyncActions, -the runtime may return XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT -indicating the properties are discarded for out-of-date model key.

    -
    -
    -

    If the input modelKey is invalid, i.e. it’s '0' or not returned from any XrControllerModelKeyStateMSFT, -the runtime must return XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

    +

    If the input modelKey is invalid, i.e. it is +XR_NULL_CONTROLLER_MODEL_KEY_MSFT or not a key returned from +XrControllerModelKeyStateMSFT, the runtime must return +XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

    @@ -33132,7 +35550,7 @@ the runtime must return XR_ERROR_CONTROLLE
    • -

      The XR_MSFT_controller_model_preview extension must be enabled prior to calling xrGetControllerModelPropertiesMSFT

      +

      The XR_MSFT_controller_model extension must be enabled prior to calling xrGetControllerModelPropertiesMSFT

    • session must be a valid XrSession handle

      @@ -33199,8 +35617,9 @@ the runtime must return XR_ERROR_CONTROLLE
      -

      The XrControllerModelPropertiesMSFT structure describes the properties of a controller model -including an array of XrControllerModelNodePropertiesMSFT.

      +

      The XrControllerModelPropertiesMSFT structure describes the properties +of a controller model including an array of +XrControllerModelNodePropertiesMSFT.

      @@ -33225,20 +35644,22 @@ including an array of XrControlle

      type is the XrStructureType of this structure.

    • -

      next is NULL or a pointer to the next structure in a structure chain.

      +

      next is NULL or a pointer to the next structure in a structure +chain.

    • -

      nodeCapacityInput is the capacity of the nodeProperties array, or 0 to indicate a -request to retrieve the required capacity.

      +

      nodeCapacityInput is the capacity of the nodeProperties array, +or 0 to indicate a request to retrieve the required capacity.

    • -

      nodeCountOutput filled in by the runtime with the count of elements in nodeProperties array, -or returns the required capacity in the case that nodeCapacityInput is 0.

      +

      nodeCountOutput filled in by the runtime with the count of elements +in nodeProperties array, or returns the required capacity in the +case that nodeCapacityInput is 0.

    • -

      nodeProperties is a pointer to an application-allocated array that will be -filled with the XrControllerModelNodePropertiesMSFT values. -It can be NULL if sourceCapacityInput is 0.

      +

      nodeProperties is a pointer to an application-allocated array that +will be filled with the XrControllerModelNodePropertiesMSFT values. +It can be NULL if nodeCapacityInput is 0.

    • See Buffer Size Parameters chapter for a @@ -33254,7 +35675,7 @@ detailed description of retrieving the required nodeProperties size

      • -

        The XR_MSFT_controller_model_preview extension must be enabled prior to using XrControllerModelPropertiesMSFT

        +

        The XR_MSFT_controller_model extension must be enabled prior to using XrControllerModelPropertiesMSFT

      • type must be XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT

        @@ -33274,9 +35695,10 @@ detailed description of retrieving the required nodeProperties size
        -

        The XrControllerModelNodePropertiesMSFT structure describes properties of animatable nodes, -including the node name and parent node name to locate a glTF node in the controller model -that can be animated based on user’s interactions on the controller.

        +

        The XrControllerModelNodePropertiesMSFT structure describes properties +of animatable nodes, including the node name and parent node name to locate +a glTF node in the controller model that can be animated based on user’s +interactions on the controller.

        @@ -33300,11 +35722,14 @@ that can be animated based on user’s interactions on the controller.

        type is the XrStructureType of this structure.

      • -

        next is NULL or a pointer to the next structure in a structure chain.

        +

        next is NULL or a pointer to the next structure in a structure +chain.

      • -

        parentNodeName is the name of the parent node in the provided glTF file. -The parent name may be empty if it should not be used to locate this node.

        +

        parentNodeName is the name of the parent node in the provided glTF +file. +The parent name may be empty if it should not be used to locate this +node.

      • nodeName is the name of this node in the provided glTF file.

        @@ -33314,8 +35739,10 @@ The parent name may be empty if it should not be
    -

    The node can be located in the glTF node hierarchy by finding the node(s) with the matching node name and parent node name. -If the parentNodeName is empty, the matching will be solely based on the nodeName.

    +

    The node can be located in the glTF node hierarchy by finding the node(s) +with the matching node name and parent node name. +If the parentNodeName is empty, the matching will be solely based on +the nodeName.

    If there are multiple nodes in the glTF file matches the condition above, @@ -33323,8 +35750,8 @@ the first matching node using depth-first traversal in the glTF scene should be animated and the rest should be ignored.

    -

    The runtime must not return any nodeName or parentName -that doesn’t match any gltTF nodes in the corresponding controller model.

    +

    The runtime must not return any nodeName or parentName that +doesn’t match any gltTF nodes in the corresponding controller model.

    @@ -33332,7 +35759,7 @@ that doesn’t match any gltTF nodes in the corresponding controller model.<
    -

    The runtime may return different state for a model key after each call to xrSyncActions, -which represents the latest state of the user interactions.

    +

    The runtime may return different state for a model key after each call to +xrSyncActions, which represents the latest state of the user +interactions.

    -

    The runtime must retain the data and return the same state for a valid model key -before the subsequence call to xrSyncActions,

    -
    -
    -

    If the input modelKey is not from a pose action state after the previous xrSyncActions, -the runtime may return XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT indicating -the properties are discarded for out-of-date model key.

    -
    -
    -

    If the input modelKey is invalid, i.e. it’s '0' or not returned from any XrControllerModelKeyStateMSFT, -the runtime must return XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

    +

    If the input modelKey is invalid, i.e. it is +XR_NULL_CONTROLLER_MODEL_KEY_MSFT or not a key returned from +XrControllerModelKeyStateMSFT, the runtime must return +XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

    @@ -33411,7 +35834,7 @@ the runtime must return XR_ERROR_CONTROLLE
    • -

      The XR_MSFT_controller_model_preview extension must be enabled prior to calling xrGetControllerModelStateMSFT

      +

      The XR_MSFT_controller_model extension must be enabled prior to calling xrGetControllerModelStateMSFT

    • session must be a valid XrSession handle

      @@ -33478,8 +35901,9 @@ the runtime must return XR_ERROR_CONTROLLE
      -

      The XrControllerModelStateMSFT structure describes the state of a controller model, -including an array of XrControllerModelNodeStateMSFT.

      +

      The XrControllerModelStateMSFT structure describes the state of a +controller model, including an array of +XrControllerModelNodeStateMSFT.

      @@ -33504,19 +35928,21 @@ including an array of XrControllerMode

      type is the XrStructureType of this structure.

    • -

      next is NULL or a pointer to the next structure in a structure chain.

      +

      next is NULL or a pointer to the next structure in a structure +chain.

    • -

      nodeCapacityInput is the capacity of the nodeStates array, or 0 to indicate a -request to retrieve the required capacity.

      +

      nodeCapacityInput is the capacity of the nodeStates array, or +0 to indicate a request to retrieve the required capacity.

    • -

      nodeCountOutput filled in by the runtime with the count of elements in nodeStates array, -or returns the required capacity in the case that nodeCapacityInput is 0.

      +

      nodeCountOutput filled in by the runtime with the count of elements +in nodeStates array, or returns the required capacity in the case +that nodeCapacityInput is 0.

    • -

      nodeStates is a pointer to an application-allocated array that will be -filled with the XrControllerModelNodeStateMSFT values. +

      nodeStates is a pointer to an application-allocated array that will +be filled with the XrControllerModelNodeStateMSFT values. It can be NULL if sourceCapacityInput is 0.

    • @@ -33533,7 +35959,7 @@ detailed description of retrieving the required nodeStates size.

      • -

        The XR_MSFT_controller_model_preview extension must be enabled prior to using XrControllerModelStateMSFT

        +

        The XR_MSFT_controller_model extension must be enabled prior to using XrControllerModelStateMSFT

      • type must be XR_TYPE_CONTROLLER_MODEL_STATE_MSFT

        @@ -33553,7 +35979,8 @@ detailed description of retrieving the required nodeStates size.

        -

        The XrControllerModelNodeStateMSFT structure describes the state of a node in a controller model.

        +

        The XrControllerModelNodeStateMSFT structure describes the state of a +node in a controller model.

        @@ -33576,25 +36003,25 @@ detailed description of retrieving the required nodeStates size.

        type is the XrStructureType of this structure.

      • -

        next is NULL or a pointer to the next structure in a structure chain.

        +

        next is NULL or a pointer to the next structure in a structure +chain.

      • nodePose is an XrPosef of the node in its parent node space.

      • -
      • -

        isHidden is XR_TRUE if this node and all descendants should be hidden.

        -
    -

    The state is corresponding to the glTF node identified by the nodeName and nodeParentName -of the node property at the same array index in the nodeProperties in XrControllerModelPropertiesMSFT.

    +

    The state is corresponding to the glTF node identified by the nodeName +and nodeParentName of the node property at the same array index in the +nodeProperties in XrControllerModelPropertiesMSFT.

    -

    The nodePose is based on the user’s interaction on the controller at the latest xrSyncActions, -represented as the XrPosef of the node in it’s parent node space.

    +

    The nodePose is based on the user’s interaction on the controller at +the latest xrSyncActions, represented as the XrPosef of the node +in it’s parent node space.

    @@ -33602,7 +36029,7 @@ represented as the XrPosef of the node in it’s pare
    @@ -33703,7 +36127,7 @@ represented as the XrPosef of the node in it’s pare
    • -

      Revision 1, 2020-03-12 (Yin LI)

      +

      Revision 1, 2020-03-12 (Yin Li)

      • @@ -33712,11 +36136,21 @@ represented as the XrPosef of the node in it’s pare
    • +
    • +

      Revision 2, 2020-08-12 (Bryce Hutchings)

      +
      +
        +
      • +

        Remove a possible error condition

        +
      • +
      +
      +
    -

    12.32. XR_MSFT_first_person_observer

    +

    12.37. XR_MSFT_first_person_observer

    Name String
    @@ -33769,7 +36203,7 @@ Alex Turner, Microsoft

    -

    12.32.1. Overview

    +

    12.37.1. Overview

    This first-person observer view configuration enables the runtime to request the application to render an additional first-person view of the scene to be @@ -33873,7 +36307,7 @@ blend modes when sharing render passes across both view configurations.

    -

    12.33. XR_MSFT_hand_interaction

    +

    12.38. XR_MSFT_hand_interaction

    Name String
    @@ -34029,7 +36463,7 @@ a controller.

    -

    12.34. XR_MSFT_hand_tracking_mesh

    +

    12.39. XR_MSFT_hand_tracking_mesh

    Name String
    @@ -35450,7 +37884,7 @@ while(1){
    -

    12.35. XR_MSFT_holographic_window_attachment

    +

    12.40. XR_MSFT_holographic_window_attachment

    Name String
    @@ -35590,7 +38024,7 @@ thread is blocked, otherwise the call may deadlo
    -

    12.35.1. Sample code

    +

    12.40.1. Sample code

    Following example demos the usage of holographic window attachment and use the attached CoreWindow to receive keyboard input, use @@ -35706,7 +38140,7 @@ int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int) {

    -

    12.36. XR_MSFT_perception_anchor_interop_preview

    +

    12.41. XR_MSFT_perception_anchor_interop_preview

    Name String
    @@ -36058,7 +38492,7 @@ in the pointer of perceptionAnchor must
    -

    12.37. XR_MSFT_secondary_view_configuration

    +

    12.42. XR_MSFT_secondary_view_configuration

    Name String
    @@ -36108,7 +38542,7 @@ Alex Turner, Microsoft

    -

    12.37.1. Overview

    +

    12.42.1. Overview

    This extension allows an application to enable support for one or more secondary view configurations. @@ -36176,7 +38610,7 @@ structure.

    -

    12.37.2. Enumerate supported secondary view configurations

    +

    12.42.2. Enumerate supported secondary view configurations

    The first step is for the application to inspect if a runtime supports certain secondary view configurations. @@ -36190,7 +38624,7 @@ and can use this secondary view configuration type in later functions.

    -

    12.37.3. Secondary view configuration properties

    +

    12.42.3. Secondary view configuration properties

    The application can inspect the properties of a secondary view configuration through the existing xrGetViewConfigurationProperties, @@ -36286,7 +38720,7 @@ configuration type was hinted when swapchain image was created.

    -

    12.37.4. Enable secondary view configuration

    +

    12.42.4. Enable secondary view configuration

    The application indicates to the runtime which secondary view configurations it can support by chaining an @@ -36386,7 +38820,7 @@ configuration types that application supports.

    -

    12.37.5. Per-frame active view configurations

    +

    12.42.5. Per-frame active view configurations

    The runtime then tells the application at each xrWaitFrame function call which of the enabled secondary view configurations are active for that @@ -36579,7 +39013,7 @@ configuration inactive by setting the corresponding active in the

    -

    12.37.6. Locate and inspect view states of secondary view configurations

    +

    12.42.6. Locate and inspect view states of secondary view configurations

    When the application calls xrLocateViews, it can use XrViewLocateInfo::viewConfigurationType field to query the view @@ -36602,7 +39036,7 @@ successfully return, but the resulting XrViewState -

    12.37.7. Submit composition layers to secondary view configurations

    +

    12.42.7. Submit composition layers to secondary view configurations

    @@ -36818,7 +39252,7 @@ configuration.

    environmentBlendMode must be a valid XrEnvironmentBlendMode value

  • -

    layers must be a pointer to an array of layerCount valid XrCompositionLayerBaseHeader-based structures. See also: XrCompositionLayerCubeKHR, XrCompositionLayerCylinderKHR, XrCompositionLayerEquirectKHR, XrCompositionLayerProjection, XrCompositionLayerQuad

    +

    layers must be a pointer to an array of layerCount valid XrCompositionLayerBaseHeader-based structures. See also: XrCompositionLayerCubeKHR, XrCompositionLayerCylinderKHR, XrCompositionLayerEquirect2KHR, XrCompositionLayerEquirectKHR, XrCompositionLayerProjection, XrCompositionLayerQuad

  • The layerCount parameter must be greater than 0

    @@ -36914,7 +39348,7 @@ configuration.

  • -

    12.38. XR_MSFT_spatial_anchor

    +

    12.43. XR_MSFT_spatial_anchor

    Name String
    @@ -37545,7 +39979,7 @@ maintain tracking for that anchor’s origin.

    -

    12.39. XR_MSFT_spatial_anchor_export_preview

    +

    12.44. XR_MSFT_spatial_anchor_export_preview

    Name String
    @@ -38310,7 +40744,7 @@ export is to be used for sharing.

    -

    12.40. XR_MSFT_spatial_graph_bridge

    +

    12.45. XR_MSFT_spatial_graph_bridge

    Name String
    @@ -38648,7 +41082,7 @@ Dynamic spatial nodes are represented by
    -

    12.41. XR_MSFT_unbounded_reference_space

    +

    12.46. XR_MSFT_unbounded_reference_space

    Name String
    @@ -38812,7 +41246,7 @@ extension is enabled.

    -

    12.42. XR_OCULUS_android_session_state_enable

    +

    12.47. XR_OCULUS_android_session_state_enable

    Name String
    @@ -38991,7 +41425,7 @@ from surfaceDestroyed() or onPause(), whichever comes first.

    -

    12.43. XR_VALVE_analog_threshold

    +

    12.48. XR_VALVE_analog_threshold

    Name String
    @@ -39215,7 +41649,7 @@ binding list for this interaction profile, the runtime mu
    -

    12.44. XR_VARJO_quad_views

    +

    12.49. XR_VARJO_quad_views

    Name String
    @@ -39261,7 +41695,7 @@ Robert Menzel, NVIDIA

    -

    12.44.1. Overview

    +

    12.49.1. Overview

    This extension adds a new view configuration type - XR_VIEW_CONFIGURATION_TYPE_PRIMARY_QUAD_VARJO to @@ -40379,6 +42813,12 @@ type is XR_USE_PLATFORM_EGL.

  • XrVisibilityMaskTypeKHR

  • +
  • +

    XrVulkanDeviceCreateFlagBitsKHR

    +
  • +
  • +

    XrVulkanInstanceCreateFlagBitsKHR

    +
  • @@ -40425,6 +42865,12 @@ type is XR_USE_PLATFORM_EGL.

  • XrViewStateFlags — See XrViewStateFlagBits

  • +
  • +

    XrVulkanDeviceCreateFlagsKHR — See XrVulkanDeviceCreateFlagBitsKHR

    +
  • +
  • +

    XrVulkanInstanceCreateFlagsKHR — See XrVulkanInstanceCreateFlagBitsKHR

    +
  • @@ -40521,6 +42967,12 @@ type is XR_USE_PLATFORM_EGL.

    xrCreateSwapchainAndroidSurfaceKHR

  • +

    xrCreateVulkanDeviceKHR

    +
  • +
  • +

    xrCreateVulkanInstanceKHR

    +
  • +
  • xrDestroyAction

  • @@ -40650,6 +43102,9 @@ type is XR_USE_PLATFORM_EGL.

    xrGetVulkanDeviceExtensionsKHR

  • +

    xrGetVulkanGraphicsDevice2KHR

    +
  • +
  • xrGetVulkanGraphicsDeviceKHR

  • @@ -40659,6 +43114,9 @@ type is XR_USE_PLATFORM_EGL.

    xrGetVulkanInstanceExtensionsKHR

  • +

    xrInitializeLoaderKHR

    +
  • +
  • xrLoadControllerModelMSFT

  • @@ -40853,6 +43311,9 @@ type is XR_USE_PLATFORM_EGL.

    XrCompositionLayerBaseHeader

  • +

    XrCompositionLayerColorScaleBiasKHR

    +
  • +
  • XrCompositionLayerCubeKHR

  • @@ -40862,6 +43323,9 @@ type is XR_USE_PLATFORM_EGL.

    XrCompositionLayerDepthInfoKHR

  • +

    XrCompositionLayerEquirect2KHR

    +
  • +
  • XrCompositionLayerEquirectKHR

  • @@ -40982,6 +43446,9 @@ type is XR_USE_PLATFORM_EGL.

    XrGraphicsBindingOpenGLXlibKHR

  • +

    XrGraphicsBindingVulkan2KHR

    +
  • +
  • XrGraphicsBindingVulkanKHR

  • @@ -40997,6 +43464,9 @@ type is XR_USE_PLATFORM_EGL.

    XrGraphicsRequirementsOpenGLKHR

  • +

    XrGraphicsRequirementsVulkan2KHR

    +
  • +
  • XrGraphicsRequirementsVulkanKHR

  • @@ -41072,6 +43542,12 @@ type is XR_USE_PLATFORM_EGL.

    XrInteractionProfileSuggestedBinding

  • +

    XrLoaderInitInfoAndroidKHR

    +
  • +
  • +

    XrLoaderInitInfoBaseHeaderKHR

    +
  • +
  • XrOffset2Df

  • @@ -41168,6 +43644,9 @@ type is XR_USE_PLATFORM_EGL.

    XrSwapchainImageReleaseInfo

  • +

    XrSwapchainImageVulkan2KHR

    +
  • +
  • XrSwapchainImageVulkanKHR

  • @@ -41231,6 +43710,15 @@ type is XR_USE_PLATFORM_EGL.

    XrVisibilityMaskKHR

  • +

    XrVulkanDeviceCreateInfoKHR

    +
  • +
  • +

    XrVulkanGraphicsDeviceGetInfoKHR

    +
  • +
  • +

    XrVulkanInstanceCreateInfoKHR

    +
  • +
  • XrVulkanSwapchainFormatListCreateInfoKHR

  • @@ -41419,6 +43907,7 @@ the application binary interface.

    XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR = 1000031001, XR_TYPE_SESSION_CREATE_INFO_OVERLAY_EXTX = 1000033000, XR_TYPE_EVENT_DATA_MAIN_SESSION_VISIBILITY_CHANGED_EXTX = 1000033003, + XR_TYPE_COMPOSITION_LAYER_COLOR_SCALE_BIAS_KHR = 1000034000, XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_MSFT = 1000039000, XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT = 1000039001, XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT = 1000046000, @@ -41440,16 +43929,24 @@ the application binary interface.

    XR_TYPE_SECONDARY_VIEW_CONFIGURATION_FRAME_END_INFO_MSFT = 1000053003, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_LAYER_INFO_MSFT = 1000053004, XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SWAPCHAIN_CREATE_INFO_MSFT = 1000053005, - XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC = 1000059000, - XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT = 1000063000, - XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE = 1000079000, XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT = 1000055000, XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT = 1000055001, XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT = 1000055002, XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT = 1000055003, XR_TYPE_CONTROLLER_MODEL_STATE_MSFT = 1000055004, + XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC = 1000059000, + XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT = 1000063000, + XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE = 1000079000, + XR_TYPE_LOADER_INIT_INFO_ANDROID_KHR = 1000089000, + XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR = 1000090000, + XR_TYPE_VULKAN_DEVICE_CREATE_INFO_KHR = 1000090001, + XR_TYPE_VULKAN_GRAPHICS_DEVICE_GET_INFO_KHR = 1000090003, + XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR = 1000091000, XR_TYPE_SPATIAL_ANCHOR_EXPORT_PURPOSE_INFO_MSFT = 1000062000, XR_TYPE_SPATIAL_ANCHOR_EXPORT_SUFFICIENCY_MSFT = 1000062001, + 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, XR_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF } XrStructureType;
    @@ -41600,7 +44097,7 @@ Macros.

    // OpenXR current version number.
    -#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 10)
    +#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 12)
    @@ -42530,8 +45027,8 @@ the time of their most recent contribution, are listed below.

    diff --git a/samples/SampleSceneWin32/Main.cpp b/samples/SampleSceneWin32/Main.cpp index 47ffd2f..3f00dff 100644 --- a/samples/SampleSceneWin32/Main.cpp +++ b/samples/SampleSceneWin32/Main.cpp @@ -25,7 +25,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int) auto on_exit = MakeScopeGuard([] { ::CoUninitialize(); }); engine::XrAppConfiguration appConfig({"SampleSceneWin32", 1}); - appConfig.RequestedExtensions.push_back(XR_MSFT_CONTROLLER_MODEL_PREVIEW_EXTENSION_NAME); + appConfig.RequestedExtensions.push_back(XR_MSFT_CONTROLLER_MODEL_EXTENSION_NAME); auto app = engine::CreateXrApp(appConfig); app->AddScene(TryCreateTitleScene(app->Context())); diff --git a/shared/SampleShared/SampleShared_uwp.vcxproj b/shared/SampleShared/SampleShared_uwp.vcxproj index 239ac08..1cb17b6 100644 --- a/shared/SampleShared/SampleShared_uwp.vcxproj +++ b/shared/SampleShared/SampleShared_uwp.vcxproj @@ -351,7 +351,6 @@ - diff --git a/shared/SampleShared/SampleShared_uwp.vcxproj.filters b/shared/SampleShared/SampleShared_uwp.vcxproj.filters index 6d6da1a..827772e 100644 --- a/shared/SampleShared/SampleShared_uwp.vcxproj.filters +++ b/shared/SampleShared/SampleShared_uwp.vcxproj.filters @@ -30,7 +30,6 @@ - diff --git a/shared/SampleShared/SampleShared_win32.vcxproj b/shared/SampleShared/SampleShared_win32.vcxproj index fb5bd98..367f2bf 100644 --- a/shared/SampleShared/SampleShared_win32.vcxproj +++ b/shared/SampleShared/SampleShared_win32.vcxproj @@ -330,7 +330,6 @@ - diff --git a/shared/SampleShared/SampleShared_win32.vcxproj.filters b/shared/SampleShared/SampleShared_win32.vcxproj.filters index bdfb87c..fac9cd2 100644 --- a/shared/SampleShared/SampleShared_win32.vcxproj.filters +++ b/shared/SampleShared/SampleShared_win32.vcxproj.filters @@ -28,7 +28,6 @@ - diff --git a/shared/XrSceneLib/PbrModelObject.cpp b/shared/XrSceneLib/PbrModelObject.cpp index 0ee553a..8e2dbfd 100644 --- a/shared/XrSceneLib/PbrModelObject.cpp +++ b/shared/XrSceneLib/PbrModelObject.cpp @@ -15,6 +15,8 @@ //********************************************************* #include "pch.h" #include +#include +#include #include "PbrModelObject.h" using namespace DirectX; @@ -61,6 +63,35 @@ void PbrModelObject::SetBaseColorFactor(const Pbr::RGBAColor color) { } } +using engine::PbrModelLoadOperation; + +/* static */ PbrModelLoadOperation PbrModelLoadOperation::LoadGltfBinaryAsync(Pbr::Resources& pbrResources, std::wstring filename) { + return PbrModelLoadOperation(std::async(std::launch::async, [&pbrResources, filename = std::move(filename)]() { + const std::vector glbData = sample::ReadFileBytes(sample::FindFileInAppFolder(filename.c_str())); + return Gltf::FromGltfBinary(pbrResources, glbData); + })); +} + +std::shared_ptr PbrModelLoadOperation::TakeModelWhenReady() { + if (m_loadModelTask.valid() && m_loadModelTask.wait_for(std::chrono::milliseconds(0)) == std::future_status::ready) { + return m_loadModelTask.get(); + } + + return nullptr; +} + +PbrModelLoadOperation::~PbrModelLoadOperation() { + // Caller ensures reference to Pbr::Resources stays alive only until this object is destroyed, so delay destruction if it is + // still in use. + if (m_loadModelTask.valid()) { + m_loadModelTask.get(); + } +} + +PbrModelLoadOperation::PbrModelLoadOperation(std::future> loadModelTask) + : m_loadModelTask(std::move(loadModelTask)) { +} + std::shared_ptr engine::CreateCube(const Pbr::Resources& pbrResources, XMFLOAT3 sideLengths, const Pbr::RGBAColor color, diff --git a/shared/XrSceneLib/PbrModelObject.h b/shared/XrSceneLib/PbrModelObject.h index 67762c0..caaaf7e 100644 --- a/shared/XrSceneLib/PbrModelObject.h +++ b/shared/XrSceneLib/PbrModelObject.h @@ -15,6 +15,7 @@ //********************************************************* #pragma once +#include #include #include #include "Scene.h" @@ -43,6 +44,26 @@ namespace engine { Pbr::FillMode m_fillMode; }; + // Helper for loading GLB files in the background. + struct PbrModelLoadOperation { + PbrModelLoadOperation() = default; + PbrModelLoadOperation(PbrModelLoadOperation&&) = default; + PbrModelLoadOperation& operator=(PbrModelLoadOperation&&) = default; + + static PbrModelLoadOperation LoadGltfBinaryAsync(Pbr::Resources& pbrResources, std::wstring filename); + + // Take the model (can only be done once) once it has been loaded. + std::shared_ptr TakeModelWhenReady(); + + // Dtor ensures outstanding operation is complete before returning. + ~PbrModelLoadOperation(); + + private: + explicit PbrModelLoadOperation(std::future> loadModelTask); + + std::future> m_loadModelTask; + }; + std::shared_ptr CreateCube(const Pbr::Resources& pbrResources, DirectX::XMFLOAT3 sideLengths, Pbr::RGBAColor color, diff --git a/shared/XrSceneLib/SpaceObject.cpp b/shared/XrSceneLib/SpaceObject.cpp index ff3ec40..8ebc305 100644 --- a/shared/XrSceneLib/SpaceObject.cpp +++ b/shared/XrSceneLib/SpaceObject.cpp @@ -16,15 +16,15 @@ #include "pch.h" #include "SpaceObject.h" -engine::SpaceObject::SpaceObject(std::unique_ptr space, bool hideWhenPoseInvalid) +engine::SpaceObject::SpaceObject(xr::SpaceHandle space, bool hideWhenPoseInvalid) : m_space(std::move(space)) , m_hideWhenPoseInvalid(hideWhenPoseInvalid) { - assert(m_space != nullptr); + assert(m_space.Get() != XR_NULL_HANDLE); } void engine::SpaceObject::Update(engine::Context& context, const engine::FrameTime& frameTime) { XrSpaceLocation location{XR_TYPE_SPACE_LOCATION}; - xrLocateSpace(m_space->Get(), context.SceneSpace, frameTime.PredictedDisplayTime, &location); + CHECK_XRCMD(xrLocateSpace(m_space.Get(), context.SceneSpace, frameTime.PredictedDisplayTime, &location)); const bool poseValid = xr::math::Pose::IsPoseValid(location); if (poseValid) { Pose() = location.pose; diff --git a/shared/XrSceneLib/SpaceObject.h b/shared/XrSceneLib/SpaceObject.h index cfb431d..f687d50 100644 --- a/shared/XrSceneLib/SpaceObject.h +++ b/shared/XrSceneLib/SpaceObject.h @@ -21,12 +21,12 @@ namespace engine { class SpaceObject : public Object { public: - SpaceObject(std::unique_ptr space, bool hideWhenPoseInvalid = true); + SpaceObject(xr::SpaceHandle space, bool hideWhenPoseInvalid = true); void Update(engine::Context& context, const engine::FrameTime& frameTime) override; private: - std::unique_ptr m_space; + xr::SpaceHandle m_space; const bool m_hideWhenPoseInvalid; }; } // namespace engine diff --git a/shared/XrUtility/XrExtensionContext.h b/shared/XrUtility/XrExtensionContext.h index f85a5fb..cbab4be 100644 --- a/shared/XrUtility/XrExtensionContext.h +++ b/shared/XrUtility/XrExtensionContext.h @@ -40,6 +40,7 @@ namespace xr { bool SupportsHPMixedRealityController; bool SupportsSpatialAnchorExport; bool SupportsPerceptionAnchorInterop; + bool SupportsColorScaleBias; std::vector EnabledExtensions; }; @@ -80,13 +81,14 @@ namespace xr { extensions.SupportsHandJointTracking = isExtensionEnabled(XR_EXT_HAND_TRACKING_EXTENSION_NAME); extensions.SupportsHandMeshTracking = isExtensionEnabled(XR_MSFT_HAND_TRACKING_MESH_EXTENSION_NAME); extensions.SupportsSpatialGraphBridge = isExtensionEnabled(XR_MSFT_SPATIAL_GRAPH_BRIDGE_EXTENSION_NAME); - extensions.SupportsControllerModel = isExtensionEnabled(XR_MSFT_CONTROLLER_MODEL_PREVIEW_EXTENSION_NAME); + extensions.SupportsControllerModel = isExtensionEnabled(XR_MSFT_CONTROLLER_MODEL_EXTENSION_NAME); extensions.SupportsAppContainer = isExtensionEnabled(XR_EXT_WIN32_APPCONTAINER_COMPATIBLE_EXTENSION_NAME); extensions.SupportsHolographicWindowAttachment = isExtensionEnabled(XR_MSFT_HOLOGRAPHIC_WINDOW_ATTACHMENT_EXTENSION_NAME); extensions.SupportsSamsungOdysseyController = isExtensionEnabled(XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME); extensions.SupportsHPMixedRealityController = isExtensionEnabled(XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME); extensions.SupportsSpatialAnchorExport = isExtensionEnabled(XR_MSFT_SPATIAL_ANCHOR_EXPORT_PREVIEW_EXTENSION_NAME); extensions.SupportsPerceptionAnchorInterop = isExtensionEnabled(XR_MSFT_PERCEPTION_ANCHOR_INTEROP_PREVIEW_EXTENSION_NAME); + extensions.SupportsColorScaleBias = isExtensionEnabled(XR_KHR_COMPOSITION_LAYER_COLOR_SCALE_BIAS_EXTENSION_NAME); return extensions; } diff --git a/shared/XrUtility/XrExtensions.h b/shared/XrUtility/XrExtensions.h index 4b5c839..00bf72a 100644 --- a/shared/XrUtility/XrExtensions.h +++ b/shared/XrUtility/XrExtensions.h @@ -33,7 +33,7 @@ #define FOR_EACH_VISIBILITY_MASK_FUNCTION(_) #endif -#ifdef XR_MSFT_controller_model_preview +#ifdef XR_MSFT_controller_model #define FOR_EACH_CONTROLLER_MODEL_EXTENSION_FUNCTION(_) \ _(xrGetControllerModelKeyMSFT) \ _(xrLoadControllerModelMSFT) \ diff --git a/shared/XrUtility/XrGuid.h b/shared/XrUtility/XrGuid.h index e7621c5..3805c56 100644 --- a/shared/XrUtility/XrGuid.h +++ b/shared/XrUtility/XrGuid.h @@ -44,7 +44,7 @@ namespace xr { }; template - XrGuid ToXrGuid(TGuid& guid) { + XrGuid ToXrGuid(const TGuid& guid) { XrGuid dest; static_assert(sizeof(guid) == sizeof(dest), "GUID sizes must be equal"); #ifdef _MSC_VER diff --git a/shared/XrUtility/XrMath.h b/shared/XrUtility/XrMath.h index 2d6136b..29f0c33 100644 --- a/shared/XrUtility/XrMath.h +++ b/shared/XrUtility/XrMath.h @@ -190,6 +190,36 @@ namespace xr::math { DEFINE_CAST(DirectX::XMFLOAT2, XrExtent2Df); #undef DEFINE_CAST +#define VECTOR2F_OPERATOR(op) \ + constexpr XrVector2f operator op(const XrVector2f& a, const XrVector2f& b) { \ + return XrVector2f{a.x op b.x, a.y op b.y}; \ + } + VECTOR2F_OPERATOR(+); + VECTOR2F_OPERATOR(-); + VECTOR2F_OPERATOR(*); + VECTOR2F_OPERATOR(/); +#undef VECTOR2F_OPERATOR + +#define VECTOR2F_OPERATOR(op) \ + constexpr XrVector2f operator op(const XrVector2f& a, float s) { \ + return XrVector2f{a.x op s, a.y op s}; \ + } + VECTOR2F_OPERATOR(+); + VECTOR2F_OPERATOR(-); + VECTOR2F_OPERATOR(*); + VECTOR2F_OPERATOR(/); +#undef VECTOR2F_OPERATOR + +#define VECTOR2F_OPERATOR(op) \ + constexpr XrVector2f operator op(float s, const XrVector2f& a) { \ + return XrVector2f{s op a.x, s op a.y}; \ + } + VECTOR2F_OPERATOR(+); + VECTOR2F_OPERATOR(-); + VECTOR2F_OPERATOR(*); + VECTOR2F_OPERATOR(/); +#undef VECTOR2F_OPERATOR + #define VECTOR3F_OPERATOR(op) \ constexpr XrVector3f operator op(const XrVector3f& a, const XrVector3f& b) { \ return XrVector3f{a.x op b.x, a.y op b.y, a.z op b.z}; \