st/oxr: Update openxr header and switch to XR_MNDX_egl_enable

This commit is contained in:
Jakob Bornecrantz 2020-05-20 16:55:07 +01:00 committed by Jakob Bornecrantz
parent 75d05c49de
commit d37f446def
10 changed files with 199 additions and 36 deletions

View file

@ -2,7 +2,9 @@
#define OPENXR_H_ 1
/*
** Copyright (c) 2017-2019 The Khronos Group Inc.
** Copyright (c) 2017-2020 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@ -35,7 +37,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, 3)
#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 8)
#define XR_VERSION_MAJOR(version) (uint16_t)(((uint64_t)(version) >> 48)& 0xffffULL)
#define XR_VERSION_MINOR(version) (uint16_t)(((uint64_t)(version) >> 32) & 0xffffULL)
@ -276,12 +278,17 @@ typedef enum XrStructureType {
XR_TYPE_GRAPHICS_BINDING_D3D12_KHR = 1000028000,
XR_TYPE_SWAPCHAIN_IMAGE_D3D12_KHR = 1000028001,
XR_TYPE_GRAPHICS_REQUIREMENTS_D3D12_KHR = 1000028002,
XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT = 1000030000,
XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT = 1000030001,
XR_TYPE_VISIBILITY_MASK_KHR = 1000031000,
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_SPATIAL_ANCHOR_CREATE_INFO_MSFT = 1000039000,
XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT = 1000039001,
XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT = 1000046000,
XR_TYPE_GRAPHICS_BINDING_EGL_MND = 1000047004,
XR_TYPE_GRAPHICS_BINDING_EGL_MNDX = 1000048004,
XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC = 1000059000,
XR_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
} XrStructureType;
@ -1534,6 +1541,52 @@ XRAPI_ATTR XrResult XRAPI_CALL xrSessionInsertDebugUtilsLabelEXT(
#endif
#define XR_EXT_eye_gaze_interaction 1
#define XR_EXT_eye_gaze_interaction_SPEC_VERSION 1
#define XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME "XR_EXT_eye_gaze_interaction"
typedef struct XrSystemEyeGazeInteractionPropertiesEXT {
XrStructureType type;
void* XR_MAY_ALIAS next;
XrBool32 supportsEyeGazeInteraction;
} XrSystemEyeGazeInteractionPropertiesEXT;
typedef struct XrEyeGazeSampleTimeEXT {
XrStructureType type;
void* XR_MAY_ALIAS next;
XrTime time;
} XrEyeGazeSampleTimeEXT;
#define XR_EXTX_overlay 1
#define XR_EXTX_overlay_SPEC_VERSION 4
#define XR_EXTX_OVERLAY_EXTENSION_NAME "XR_EXTX_overlay"
typedef XrFlags64 XrOverlaySessionCreateFlagsEXTX;
// Flag bits for XrOverlaySessionCreateFlagsEXTX
static const XrOverlaySessionCreateFlagsEXTX XR_OVERLAY_SESSION_CREATE_RELAXED_DISPLAY_TIME_BIT_EXTX = 0x00000001;
typedef XrFlags64 XrOverlayMainSessionFlagsEXTX;
// Flag bits for XrOverlayMainSessionFlagsEXTX
static const XrOverlayMainSessionFlagsEXTX XR_OVERLAY_MAIN_SESSION_ENABLED_COMPOSITION_LAYER_INFO_DEPTH_BIT_EXTX = 0x00000001;
typedef struct XrSessionCreateInfoOverlayEXTX {
XrStructureType type;
const void* XR_MAY_ALIAS next;
XrOverlaySessionCreateFlagsEXTX createFlags;
uint32_t sessionLayersPlacement;
} XrSessionCreateInfoOverlayEXTX;
typedef struct XrEventDataMainSessionVisibilityChangedEXTX {
XrStructureType type;
const void* XR_MAY_ALIAS next;
XrBool32 visible;
XrOverlayMainSessionFlagsEXTX flags;
} XrEventDataMainSessionVisibilityChangedEXTX;
#define XR_VARJO_quad_views 1
#define XR_VARJO_quad_views_SPEC_VERSION 1
#define XR_VARJO_QUAD_VIEWS_EXTENSION_NAME "XR_VARJO_quad_views"
@ -1584,7 +1637,7 @@ XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpatialAnchorMSFT(
#define XR_MND_headless 1
#define XR_MND_headless_SPEC_VERSION 1
#define XR_MND_headless_SPEC_VERSION 2
#define XR_MND_HEADLESS_EXTENSION_NAME "XR_MND_headless"
@ -1606,6 +1659,71 @@ typedef struct XrViewConfigurationDepthRangeEXT {
} XrViewConfigurationDepthRangeEXT;
#define XR_EXT_conformance_automation 1
#define XR_EXT_conformance_automation_SPEC_VERSION 1
#define XR_EXT_CONFORMANCE_AUTOMATION_EXTENSION_NAME "XR_EXT_conformance_automation"
typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceActiveEXT)(XrSession session, XrPath interactionProfile, XrPath topLevelPath, XrBool32 isActive);
typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceStateBoolEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrBool32 state);
typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceStateFloatEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, float state);
typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceStateVector2fEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrVector2f state);
typedef XrResult (XRAPI_PTR *PFN_xrSetInputDeviceLocationEXT)(XrSession session, XrPath topLevelPath, XrPath inputSourcePath, XrSpace space, XrPosef pose);
#ifndef XR_NO_PROTOTYPES
XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceActiveEXT(
XrSession session,
XrPath interactionProfile,
XrPath topLevelPath,
XrBool32 isActive);
XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceStateBoolEXT(
XrSession session,
XrPath topLevelPath,
XrPath inputSourcePath,
XrBool32 state);
XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceStateFloatEXT(
XrSession session,
XrPath topLevelPath,
XrPath inputSourcePath,
float state);
XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceStateVector2fEXT(
XrSession session,
XrPath topLevelPath,
XrPath inputSourcePath,
XrVector2f state);
XRAPI_ATTR XrResult XRAPI_CALL xrSetInputDeviceLocationEXT(
XrSession session,
XrPath topLevelPath,
XrPath inputSourcePath,
XrSpace space,
XrPosef pose);
#endif
#define XR_MSFT_hand_interaction 1
#define XR_MSFT_hand_interaction_SPEC_VERSION 1
#define XR_MSFT_HAND_INTERACTION_EXTENSION_NAME "XR_MSFT_hand_interaction"
#define XR_EXT_win32_appcontainer_compatible 1
#define XR_EXT_win32_appcontainer_compatible_SPEC_VERSION 1
#define XR_EXT_WIN32_APPCONTAINER_COMPATIBLE_EXTENSION_NAME "XR_EXT_win32_appcontainer_compatible"
#define XR_EPIC_view_configuration_fov 1
#define XR_EPIC_view_configuration_fov_SPEC_VERSION 1
#define XR_EPIC_VIEW_CONFIGURATION_FOV_EXTENSION_NAME "XR_EPIC_view_configuration_fov"
typedef struct XrViewConfigurationViewFovEPIC {
XrStructureType type;
const void* XR_MAY_ALIAS next;
XrFovf recommendedMutableFov;
XrFovf maxMutableFov;
} XrViewConfigurationViewFovEPIC;
#ifdef __cplusplus
}
#endif

View file

@ -2,7 +2,9 @@
#define OPENXR_PLATFORM_H_ 1
/*
** Copyright (c) 2017-2019 The Khronos Group Inc.
** Copyright (c) 2017-2020 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@ -99,7 +101,7 @@ typedef struct XrVulkanSwapchainFormatListCreateInfoKHR {
#ifdef XR_USE_GRAPHICS_API_OPENGL
#define XR_KHR_opengl_enable 1
#define XR_KHR_opengl_enable_SPEC_VERSION 7
#define XR_KHR_opengl_enable_SPEC_VERSION 8
#define XR_KHR_OPENGL_ENABLE_EXTENSION_NAME "XR_KHR_opengl_enable"
#ifdef XR_USE_PLATFORM_WIN32
typedef struct XrGraphicsBindingOpenGLWin32KHR {
@ -302,7 +304,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 5
#define XR_KHR_D3D12_enable_SPEC_VERSION 6
#define XR_KHR_D3D12_ENABLE_EXTENSION_NAME "XR_KHR_D3D12_enable"
typedef struct XrGraphicsBindingD3D12KHR {
XrStructureType type;
@ -378,17 +380,17 @@ XRAPI_ATTR XrResult XRAPI_CALL xrConvertTimeToTimespecTimeKHR(
#ifdef XR_USE_PLATFORM_EGL
#define XR_MND_egl_enable 1
#define XR_MND_egl_enable_SPEC_VERSION 1
#define XR_MND_EGL_ENABLE_EXTENSION_NAME "XR_MND_egl_enable"
typedef struct XrGraphicsBindingEGLMND {
#define XR_MNDX_egl_enable 1
#define XR_MNDX_egl_enable_SPEC_VERSION 1
#define XR_MNDX_EGL_ENABLE_EXTENSION_NAME "XR_MNDX_egl_enable"
typedef struct XrGraphicsBindingEGLMNDX {
XrStructureType type;
const void* XR_MAY_ALIAS next;
PFNEGLGETPROCADDRESSPROC getProcAddress;
EGLDisplay display;
EGLConfig config;
EGLContext context;
} XrGraphicsBindingEGLMND;
} XrGraphicsBindingEGLMNDX;
#endif /* XR_USE_PLATFORM_EGL */

View file

@ -1,5 +1,7 @@
/*
** Copyright (c) 2017-2019 The Khronos Group Inc.
** Copyright (c) 2017-2020 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.

View file

@ -2,7 +2,9 @@
#define OPENXR_REFLECTION_H_ 1
/*
** Copyright (c) 2017-2019 The Khronos Group Inc.
** Copyright (c) 2017-2020 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@ -179,12 +181,17 @@ XR_ENUM_STR(XrResult);
_(XR_TYPE_GRAPHICS_BINDING_D3D12_KHR, 1000028000) \
_(XR_TYPE_SWAPCHAIN_IMAGE_D3D12_KHR, 1000028001) \
_(XR_TYPE_GRAPHICS_REQUIREMENTS_D3D12_KHR, 1000028002) \
_(XR_TYPE_SYSTEM_EYE_GAZE_INTERACTION_PROPERTIES_EXT, 1000030000) \
_(XR_TYPE_EYE_GAZE_SAMPLE_TIME_EXT, 1000030001) \
_(XR_TYPE_VISIBILITY_MASK_KHR, 1000031000) \
_(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_SPATIAL_ANCHOR_CREATE_INFO_MSFT, 1000039000) \
_(XR_TYPE_SPATIAL_ANCHOR_SPACE_CREATE_INFO_MSFT, 1000039001) \
_(XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT, 1000046000) \
_(XR_TYPE_GRAPHICS_BINDING_EGL_MND, 1000047004) \
_(XR_TYPE_GRAPHICS_BINDING_EGL_MNDX, 1000048004) \
_(XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC, 1000059000) \
_(XR_STRUCTURE_TYPE_MAX_ENUM, 0x7FFFFFFF)
#define XR_LIST_ENUM_XrFormFactor(_) \
@ -341,6 +348,12 @@ XR_ENUM_STR(XrResult);
_(XR_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT, 0x00000004) \
_(XR_DEBUG_UTILS_MESSAGE_TYPE_CONFORMANCE_BIT_EXT, 0x00000008)
#define XR_LIST_BITS_XrOverlaySessionCreateFlagsEXTX(_) \
_(XR_OVERLAY_SESSION_CREATE_RELAXED_DISPLAY_TIME_BIT_EXTX, 0x00000001)
#define XR_LIST_BITS_XrOverlayMainSessionFlagsEXTX(_) \
_(XR_OVERLAY_MAIN_SESSION_ENABLED_COMPOSITION_LAYER_INFO_DEPTH_BIT_EXTX, 0x00000001)
#define XR_LIST_STRUCT_XrApiLayerProperties(_) \
_(type) \
_(next) \
@ -1004,6 +1017,28 @@ XR_ENUM_STR(XrResult);
_(userCallback) \
_(userData)
#define XR_LIST_STRUCT_XrSystemEyeGazeInteractionPropertiesEXT(_) \
_(type) \
_(next) \
_(supportsEyeGazeInteraction)
#define XR_LIST_STRUCT_XrEyeGazeSampleTimeEXT(_) \
_(type) \
_(next) \
_(time)
#define XR_LIST_STRUCT_XrSessionCreateInfoOverlayEXTX(_) \
_(type) \
_(next) \
_(createFlags) \
_(sessionLayersPlacement)
#define XR_LIST_STRUCT_XrEventDataMainSessionVisibilityChangedEXTX(_) \
_(type) \
_(next) \
_(visible) \
_(flags)
#define XR_LIST_STRUCT_XrSpatialAnchorCreateInfoMSFT(_) \
_(type) \
_(next) \
@ -1025,7 +1060,7 @@ XR_ENUM_STR(XrResult);
_(recommendedFarZ) \
_(maxFarZ)
#define XR_LIST_STRUCT_XrGraphicsBindingEGLMND(_) \
#define XR_LIST_STRUCT_XrGraphicsBindingEGLMNDX(_) \
_(type) \
_(next) \
_(getProcAddress) \
@ -1033,6 +1068,12 @@ XR_ENUM_STR(XrResult);
_(config) \
_(context)
#define XR_LIST_STRUCT_XrViewConfigurationViewFovEPIC(_) \
_(type) \
_(next) \
_(recommendedMutableFov) \
_(maxMutableFov)

View file

@ -259,8 +259,8 @@ oxr_verify_XrGraphicsBindingVulkanKHR(struct oxr_logger *,
#if defined(XR_USE_PLATFORM_EGL) && defined(XR_USE_GRAPHICS_API_OPENGL)
XrResult
oxr_verify_XrGraphicsBindingEGLMND(struct oxr_logger *log,
const XrGraphicsBindingEGLMND *next);
oxr_verify_XrGraphicsBindingEGLMNDX(struct oxr_logger *log,
const XrGraphicsBindingEGLMNDX *next);
#endif // defined(XR_USE_PLATFORM_EGL) && defined(XR_USE_GRAPHICS_API_OPENGL)
/*!

View file

@ -79,15 +79,15 @@
/*
* XR_MND_egl_enable
* XR_MNDS_egl_enable
*/
#if defined(XR_MND_egl_enable) && defined(XR_USE_PLATFORM_EGL) && \
#if defined(XR_MNDX_egl_enable) && defined(XR_USE_PLATFORM_EGL) && \
defined(XR_USE_GRAPHICS_API_OPENGL)
#define OXR_HAVE_MND_egl_enable
#define OXR_EXTENSION_SUPPORT_MND_egl_enable(_) \
_(MND_egl_enable, MND_EGL_ENABLE)
#define OXR_HAVE_MNDX_egl_enable
#define OXR_EXTENSION_SUPPORT_MNDX_egl_enable(_) \
_(MNDX_egl_enable, MNDX_EGL_ENABLE)
#else
#define OXR_EXTENSION_SUPPORT_MND_egl_enable(_)
#define OXR_EXTENSION_SUPPORT_MNDX_egl_enable(_)
#endif
@ -130,6 +130,6 @@
OXR_EXTENSION_SUPPORT_KHR_opengl_enable(_) \
OXR_EXTENSION_SUPPORT_KHR_opengl_es_enable(_) \
OXR_EXTENSION_SUPPORT_KHR_vulkan_enable(_) \
OXR_EXTENSION_SUPPORT_MND_egl_enable(_) \
OXR_EXTENSION_SUPPORT_MNDX_egl_enable(_) \
OXR_EXTENSION_SUPPORT_MND_headless(_)
// clang-format on

View file

@ -828,7 +828,7 @@ oxr_swapchain_vk_create(struct oxr_logger *,
XrResult
oxr_session_populate_egl(struct oxr_logger *log,
struct oxr_system *sys,
XrGraphicsBindingEGLMND const *next,
XrGraphicsBindingEGLMNDX const *next,
struct oxr_session *sess);
#endif

View file

@ -637,9 +637,9 @@ oxr_session_create_impl(struct oxr_logger *log,
#endif
#ifdef XR_USE_PLATFORM_EGL
XrGraphicsBindingEGLMND const *egl = OXR_GET_INPUT_FROM_CHAIN(
createInfo, XR_TYPE_GRAPHICS_BINDING_EGL_MND,
XrGraphicsBindingEGLMND);
XrGraphicsBindingEGLMNDX const *egl = OXR_GET_INPUT_FROM_CHAIN(
createInfo, XR_TYPE_GRAPHICS_BINDING_EGL_MNDX,
XrGraphicsBindingEGLMNDX);
if (egl != NULL) {
OXR_SESSION_ALLOCATE(log, sys, *out_session);
return oxr_session_populate_egl(log, sys, egl, *out_session);

View file

@ -39,7 +39,7 @@ typedef EGLBoolean(EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC)(EGLDisplay dpy,
XrResult
oxr_session_populate_egl(struct oxr_logger *log,
struct oxr_system *sys,
XrGraphicsBindingEGLMND const *next,
XrGraphicsBindingEGLMNDX const *next,
struct oxr_session *sess)
{
EGLint egl_client_type;

View file

@ -497,12 +497,12 @@ oxr_verify_XrSessionCreateInfo(struct oxr_logger *log,
#endif // OXR_HAVE_KHR_vulkan_enable
#if defined(OXR_HAVE_MND_egl_enable) && defined(XR_USE_PLATFORM_EGL)
XrGraphicsBindingEGLMND const *egl = OXR_GET_INPUT_FROM_CHAIN(
XrGraphicsBindingEGLMNDX const *egl = OXR_GET_INPUT_FROM_CHAIN(
createInfo, XR_TYPE_GRAPHICS_BINDING_EGL_MND,
XrGraphicsBindingEGLMND);
XrGraphicsBindingEGLMNDX);
if (egl != NULL) {
OXR_VERIFY_EXTENSION(log, inst, MND_egl_enable);
return oxr_verify_XrGraphicsBindingEGLMND(log, egl);
return oxr_verify_XrGraphicsBindingEGLMNDX(log, egl);
}
#endif // defined(OXR_HAVE_MND_egl_enable) && defined(XR_USE_PLATFORM_EGL_KHR)
@ -580,10 +580,10 @@ oxr_verify_XrGraphicsBindingVulkanKHR(struct oxr_logger *log,
#ifdef XR_USE_PLATFORM_EGL
XrResult
oxr_verify_XrGraphicsBindingEGLMND(struct oxr_logger *log,
const XrGraphicsBindingEGLMND *next)
oxr_verify_XrGraphicsBindingEGLMNDX(struct oxr_logger *log,
const XrGraphicsBindingEGLMNDX *next)
{
if (next->type != XR_TYPE_GRAPHICS_BINDING_EGL_MND) {
if (next->type != XR_TYPE_GRAPHICS_BINDING_EGL_MNDX) {
return oxr_error(log, XR_ERROR_VALIDATION_FAILURE,
" Graphics binding has invalid type");
}