Skip to content

Commit eeab27a

Browse files
authored
Update samples for OpenXR SDK 1.0.10 (#60)
* Update samples to SDK 1.0.10 * Update to 1.0.10.2 openxr_loader nuget * Cherry pick some vcxproj simplification.
1 parent ee63815 commit eeab27a

46 files changed

Lines changed: 2935 additions & 631 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ or choose x64 platform when running on a Windows Desktop PC with the HoloLens 2
2929
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).
3030

3131
1. [XR_MSFT_controller_model_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_controller_model_preview)
32-
1. [XR_MSFT_holographic_window_attachment_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_holographic_window_attachment_preview)
32+
33+
1. [XR_MSFT_spatial_anchor_export_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_spatial_anchor_export_preview)
34+
35+
1. [XR_MSFT_perception_anchor_interop_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_perception_anchor_interop_preview)
3336

3437
Please send feedback on preview extensions and samples at [GitHub issues](https://github.com/microsoft/OpenXR-MixedReality/issues).
3538
We are planning to incorporate your feedback and finalize these extensions as vendor extensions (MSFT) or cross-vendor extensions (EXT)
@@ -65,7 +68,7 @@ demos the usage of [XR_MSFT_controller_model_preview](https://microsoft.github.i
6568

6669
- **Holographic window attachment** <br/>
6770
The [SampleSceneUwp/Main.cpp](https://github.com/microsoft/OpenXR-MixedReality/blob/master/samples/SampleSceneUwp/Main.cpp) file demos protocol activation for XR apps,
68-
and using [XR_MSFT_holographic_window_attachment_preview](https://microsoft.github.io/OpenXR-MixedReality/openxr_preview/specs/openxr.html#XR_MSFT_holographic_window_attachment_preview) extension
71+
and using [XR_MSFT_holographic_window_attachment](https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_MSFT_holographic_window_attachment) extension
6972
to interop with CoreWindow in order to support [keyboard inputs](https://docs.microsoft.com/en-us/windows/mixed-reality/keyboard-mouse-and-controller-input-in-directx#subscribe-for-corewindow-input-events)
7073
and [TextEditingContext](https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Text.Core.CoreTextEditContext?view=winrt-19041).
7174

openxr_preview/include/openxr/openxr.h

Lines changed: 95 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@
44
/*
55
** Copyright (c) 2017-2020 The Khronos Group Inc.
66
**
7-
** SPDX-License-Identifier: Apache-2.0
8-
**
9-
** Licensed under the Apache License, Version 2.0 (the "License");
10-
** you may not use this file except in compliance with the License.
11-
** You may obtain a copy of the License at
12-
**
13-
** http://www.apache.org/licenses/LICENSE-2.0
14-
**
15-
** Unless required by applicable law or agreed to in writing, software
16-
** distributed under the License is distributed on an "AS IS" BASIS,
17-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18-
** See the License for the specific language governing permissions and
19-
** limitations under the License.
7+
** SPDX-License-Identifier: Apache-2.0 OR MIT
208
*/
219

2210
/*
@@ -37,7 +25,7 @@ extern "C" {
3725
((((major) & 0xffffULL) << 48) | (((minor) & 0xffffULL) << 32) | ((patch) & 0xffffffffULL))
3826

3927
// OpenXR current version number.
40-
#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 9)
28+
#define XR_CURRENT_API_VERSION XR_MAKE_VERSION(1, 0, 10)
4129

4230
#define XR_VERSION_MAJOR(version) (uint16_t)(((uint64_t)(version) >> 48)& 0xffffULL)
4331
#define XR_VERSION_MINOR(version) (uint16_t)(((uint64_t)(version) >> 32) & 0xffffULL)
@@ -198,6 +186,9 @@ typedef enum XrResult {
198186
XR_ERROR_SECONDARY_VIEW_CONFIGURATION_TYPE_NOT_ENABLED_MSFT = -1000053000,
199187
XR_ERROR_CONTROLLER_MODEL_UNAVAILABLE_MSFT = -1000055000,
200188
XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT = -1000055001,
189+
XR_SPATIAL_ANCHOR_EXPORT_DATA_UNAVAILABLE_MSFT = 1000062000,
190+
XR_ERROR_SPATIAL_ANCHOR_EXPORT_FAILED_MSFT = -1000062000,
191+
XR_ERROR_SPATIAL_ANCHOR_SUFFICIENCY_QUERY_FAILED_MSFT = -1000062001,
201192
XR_RESULT_MAX_ENUM = 0x7FFFFFFF
202193
} XrResult;
203194

@@ -309,12 +300,15 @@ typedef enum XrStructureType {
309300
XR_TYPE_SECONDARY_VIEW_CONFIGURATION_LAYER_INFO_MSFT = 1000053004,
310301
XR_TYPE_SECONDARY_VIEW_CONFIGURATION_SWAPCHAIN_CREATE_INFO_MSFT = 1000053005,
311302
XR_TYPE_VIEW_CONFIGURATION_VIEW_FOV_EPIC = 1000059000,
303+
XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT = 1000063000,
304+
XR_TYPE_INTERACTION_PROFILE_ANALOG_THRESHOLD_VALVE = 1000079000,
312305
XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT = 1000055000,
313306
XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT = 1000055001,
314307
XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT = 1000055002,
315308
XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT = 1000055003,
316309
XR_TYPE_CONTROLLER_MODEL_STATE_MSFT = 1000055004,
317-
XR_TYPE_HOLOGRAPHIC_WINDOW_ATTACHMENT_MSFT = 1000063000,
310+
XR_TYPE_SPATIAL_ANCHOR_EXPORT_PURPOSE_INFO_MSFT = 1000062000,
311+
XR_TYPE_SPATIAL_ANCHOR_EXPORT_SUFFICIENCY_MSFT = 1000062001,
318312
XR_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
319313
} XrStructureType;
320314

@@ -387,6 +381,7 @@ typedef enum XrObjectType {
387381
XR_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT = 1000019000,
388382
XR_OBJECT_TYPE_SPATIAL_ANCHOR_MSFT = 1000039000,
389383
XR_OBJECT_TYPE_HAND_TRACKER_EXT = 1000051000,
384+
XR_OBJECT_TYPE_SPATIAL_ANCHOR_NEIGHBORHOOD_DATA_STREAM_MSFT = 1000062000,
390385
XR_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF
391386
} XrObjectType;
392387
typedef XrFlags64 XrInstanceCreateFlags;
@@ -427,6 +422,7 @@ static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_TRANSFER_SRC_BIT = 0x00000
427422
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT = 0x00000010;
428423
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_SAMPLED_BIT = 0x00000020;
429424
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_MUTABLE_FORMAT_BIT = 0x00000040;
425+
static const XrSwapchainUsageFlags XR_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_MND = 0x00000080;
430426

431427
typedef XrFlags64 XrCompositionLayerFlags;
432428

@@ -2105,10 +2101,94 @@ typedef struct XrViewConfigurationViewFovEPIC {
21052101

21062102

21072103

2104+
#define XR_MSFT_spatial_anchor_export_preview 1
2105+
2106+
XR_DEFINE_HANDLE(XrSpatialAnchorNeighborhoodDataStreamMSFT)
2107+
2108+
#define XR_MSFT_spatial_anchor_export_preview_SPEC_VERSION 1
2109+
#define XR_MSFT_SPATIAL_ANCHOR_EXPORT_PREVIEW_EXTENSION_NAME "XR_MSFT_spatial_anchor_export_preview"
2110+
2111+
typedef enum XrSpatialAnchorExportPurposeMSFT {
2112+
XR_SPATIAL_ANCHOR_EXPORT_PURPOSE_RELOCALIZATION_MSFT = 0,
2113+
XR_SPATIAL_ANCHOR_EXPORT_PURPOSE_SHARING_MSFT = 1,
2114+
XR_SPATIAL_ANCHOR_EXPORT_PURPOSE_MAX_ENUM_MSFT = 0x7FFFFFFF
2115+
} XrSpatialAnchorExportPurposeMSFT;
2116+
typedef struct XrSpatialAnchorExportPurposeInfoMSFT {
2117+
XrStructureType type;
2118+
const void* XR_MAY_ALIAS next;
2119+
XrSpatialAnchorExportPurposeMSFT exportPurpose;
2120+
} XrSpatialAnchorExportPurposeInfoMSFT;
2121+
2122+
typedef struct XrSpatialAnchorExportSufficiencyMSFT {
2123+
XrStructureType type;
2124+
const void* XR_MAY_ALIAS next;
2125+
XrBool32 isMinimallySufficient;
2126+
float recommendedSufficiencyLevel;
2127+
float sufficiencyLevel;
2128+
} XrSpatialAnchorExportSufficiencyMSFT;
2129+
2130+
typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorNeighborhoodDataStreamMSFT)(XrSpatialAnchorMSFT spatialAnchor, const XrSpatialAnchorExportPurposeInfoMSFT* exportPurposeInfo, XrSpatialAnchorNeighborhoodDataStreamMSFT* neighborhoodDataStream);
2131+
typedef XrResult (XRAPI_PTR *PFN_xrDestroySpatialAnchorNeighborhoodDataStreamMSFT)(XrSpatialAnchorNeighborhoodDataStreamMSFT neighborhoodDataStream);
2132+
typedef XrResult (XRAPI_PTR *PFN_xrReadSpatialAnchorNeighborhoodDataMSFT)(XrSpatialAnchorNeighborhoodDataStreamMSFT neighborhoodDataStream, uint32_t bytesToRead, uint32_t* bytesRead, void* buffer);
2133+
typedef XrResult (XRAPI_PTR *PFN_xrGetSpatialAnchorExportSufficiencyMSFT)(XrSpatialAnchorMSFT spatialAnchor, const XrSpatialAnchorExportPurposeInfoMSFT* exportPurposeInfo, XrSpatialAnchorExportSufficiencyMSFT* exportSufficiency);
2134+
2135+
#ifndef XR_NO_PROTOTYPES
2136+
XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorNeighborhoodDataStreamMSFT(
2137+
XrSpatialAnchorMSFT spatialAnchor,
2138+
const XrSpatialAnchorExportPurposeInfoMSFT* exportPurposeInfo,
2139+
XrSpatialAnchorNeighborhoodDataStreamMSFT* neighborhoodDataStream);
2140+
2141+
XRAPI_ATTR XrResult XRAPI_CALL xrDestroySpatialAnchorNeighborhoodDataStreamMSFT(
2142+
XrSpatialAnchorNeighborhoodDataStreamMSFT neighborhoodDataStream);
2143+
2144+
XRAPI_ATTR XrResult XRAPI_CALL xrReadSpatialAnchorNeighborhoodDataMSFT(
2145+
XrSpatialAnchorNeighborhoodDataStreamMSFT neighborhoodDataStream,
2146+
uint32_t bytesToRead,
2147+
uint32_t* bytesRead,
2148+
void* XR_MAY_ALIAS buffer);
2149+
2150+
XRAPI_ATTR XrResult XRAPI_CALL xrGetSpatialAnchorExportSufficiencyMSFT(
2151+
XrSpatialAnchorMSFT spatialAnchor,
2152+
const XrSpatialAnchorExportPurposeInfoMSFT* exportPurposeInfo,
2153+
XrSpatialAnchorExportSufficiencyMSFT* exportSufficiency);
2154+
#endif
2155+
2156+
21082157
#define XR_HUAWEI_controller_interaction 1
21092158
#define XR_HUAWEI_controller_interaction_SPEC_VERSION 1
21102159
#define XR_HUAWEI_CONTROLLER_INTERACTION_EXTENSION_NAME "XR_HUAWEI_controller_interaction"
21112160

2161+
2162+
#define XR_VALVE_analog_threshold 1
2163+
#define XR_VALVE_analog_threshold_SPEC_VERSION 1
2164+
#define XR_VALVE_ANALOG_THRESHOLD_EXTENSION_NAME "XR_VALVE_analog_threshold"
2165+
typedef struct XrInteractionProfileAnalogThresholdVALVE {
2166+
XrStructureType type;
2167+
const void* XR_MAY_ALIAS next;
2168+
XrAction action;
2169+
XrPath binding;
2170+
float onThreshold;
2171+
float offThreshold;
2172+
const XrHapticBaseHeader* onHaptic;
2173+
const XrHapticBaseHeader* offHaptic;
2174+
} XrInteractionProfileAnalogThresholdVALVE;
2175+
2176+
2177+
2178+
#define XR_EXT_samsung_odyssey_controller 1
2179+
#define XR_EXT_samsung_odyssey_controller_SPEC_VERSION 1
2180+
#define XR_EXT_SAMSUNG_ODYSSEY_CONTROLLER_EXTENSION_NAME "XR_EXT_samsung_odyssey_controller"
2181+
2182+
2183+
#define XR_EXT_hp_mixed_reality_controller 1
2184+
#define XR_EXT_hp_mixed_reality_controller_SPEC_VERSION 1
2185+
#define XR_EXT_HP_MIXED_REALITY_CONTROLLER_EXTENSION_NAME "XR_EXT_hp_mixed_reality_controller"
2186+
2187+
2188+
#define XR_MND_swapchain_usage_input_attachment_bit 1
2189+
#define XR_MND_swapchain_usage_input_attachment_bit_SPEC_VERSION 2
2190+
#define XR_MND_SWAPCHAIN_USAGE_INPUT_ATTACHMENT_BIT_EXTENSION_NAME "XR_MND_swapchain_usage_input_attachment_bit"
2191+
21122192
#ifdef __cplusplus
21132193
}
21142194
#endif

openxr_preview/include/openxr/openxr_platform.h

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,7 @@
44
/*
55
** Copyright (c) 2017-2020 The Khronos Group Inc.
66
**
7-
** SPDX-License-Identifier: Apache-2.0
8-
**
9-
** Licensed under the Apache License, Version 2.0 (the "License");
10-
** you may not use this file except in compliance with the License.
11-
** You may obtain a copy of the License at
12-
**
13-
** http://www.apache.org/licenses/LICENSE-2.0
14-
**
15-
** Unless required by applicable law or agreed to in writing, software
16-
** distributed under the License is distributed on an "AS IS" BASIS,
17-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18-
** See the License for the specific language governing permissions and
19-
** limitations under the License.
7+
** SPDX-License-Identifier: Apache-2.0 OR MIT
208
*/
219

2210
/*
@@ -396,9 +384,30 @@ typedef struct XrGraphicsBindingEGLMNDX {
396384

397385
#ifdef XR_USE_PLATFORM_WIN32
398386

399-
#define XR_MSFT_holographic_window_attachment_preview 1
400-
#define XR_MSFT_holographic_window_attachment_preview_SPEC_VERSION 1
401-
#define XR_MSFT_HOLOGRAPHIC_WINDOW_ATTACHMENT_PREVIEW_EXTENSION_NAME "XR_MSFT_holographic_window_attachment_preview"
387+
#define XR_MSFT_perception_anchor_interop_preview 1
388+
#define XR_MSFT_perception_anchor_interop_preview_SPEC_VERSION 1
389+
#define XR_MSFT_PERCEPTION_ANCHOR_INTEROP_PREVIEW_EXTENSION_NAME "XR_MSFT_perception_anchor_interop_preview"
390+
typedef XrResult (XRAPI_PTR *PFN_xrCreateSpatialAnchorFromPerceptionAnchorMSFT)(XrSession session, IUnknown* perceptionAnchor, XrSpatialAnchorMSFT* anchor);
391+
typedef XrResult (XRAPI_PTR *PFN_xrTryGetPerceptionAnchorFromSpatialAnchorMSFT)(XrSession session, XrSpatialAnchorMSFT anchor, IUnknown** perceptionAnchor);
392+
393+
#ifndef XR_NO_PROTOTYPES
394+
XRAPI_ATTR XrResult XRAPI_CALL xrCreateSpatialAnchorFromPerceptionAnchorMSFT(
395+
XrSession session,
396+
IUnknown* perceptionAnchor,
397+
XrSpatialAnchorMSFT* anchor);
398+
399+
XRAPI_ATTR XrResult XRAPI_CALL xrTryGetPerceptionAnchorFromSpatialAnchorMSFT(
400+
XrSession session,
401+
XrSpatialAnchorMSFT anchor,
402+
IUnknown** perceptionAnchor);
403+
#endif
404+
#endif /* XR_USE_PLATFORM_WIN32 */
405+
406+
#ifdef XR_USE_PLATFORM_WIN32
407+
408+
#define XR_MSFT_holographic_window_attachment 1
409+
#define XR_MSFT_holographic_window_attachment_SPEC_VERSION 1
410+
#define XR_MSFT_HOLOGRAPHIC_WINDOW_ATTACHMENT_EXTENSION_NAME "XR_MSFT_holographic_window_attachment"
402411
#ifdef XR_USE_PLATFORM_WIN32
403412
typedef struct XrHolographicWindowAttachmentMSFT {
404413
XrStructureType type;

openxr_preview/include/openxr/openxr_platform_defines.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
/*
22
** Copyright (c) 2017-2020 The Khronos Group Inc.
33
**
4-
** SPDX-License-Identifier: Apache-2.0
5-
**
6-
** Licensed under the Apache License, Version 2.0 (the "License");
7-
** you may not use this file except in compliance with the License.
8-
** You may obtain a copy of the License at
9-
**
10-
** http://www.apache.org/licenses/LICENSE-2.0
11-
**
12-
** Unless required by applicable law or agreed to in writing, software
13-
** distributed under the License is distributed on an "AS IS" BASIS,
14-
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
** See the License for the specific language governing permissions and
16-
** limitations under the License.
4+
** SPDX-License-Identifier: Apache-2.0 OR MIT
175
*/
186

197
#ifndef OPENXR_PLATFORM_DEFINES_H_

0 commit comments

Comments
 (0)