Skip to content

Commit

Permalink
Update OpenXR to 1.0.24 and Oculus SDK to 40.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiaanOlij authored and m4gr3d committed Jul 4, 2022
1 parent eb9d15c commit 02f9d56
Show file tree
Hide file tree
Showing 78 changed files with 7,507 additions and 921 deletions.
4 changes: 2 additions & 2 deletions demo/addons/godot-openxr/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Changes to the Godot OpenXR asset
- Fixed invalid pose data when controllers are becoming inactive.
- Added Quest 2 controller models to the demo.
- Add support for the hand tracking aim state extension.
- OpenXR updated to 1.0.22
- Oculus OpenXR mobile SDK version 39 update.
- OpenXR updated to 1.0.24
- Oculus OpenXR mobile SDK version 40 update.

1.2.0
-------------------
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Godots CPP bindings library (submoduled)
This is a copy of the Oculus OpenXR mobile SDK downloaded from [here](https://developer.oculus.com/downloads/package/oculus-openxr-mobile-sdk).

- Upstream: https://developer.oculus.com/downloads/package/oculus-openxr-mobile-sdk
- Version: 38.0.0
- Version: 40.0.0
- License: https://developer.oculus.com/licenses/oculussdk/

## OpenXR loader

This is a copy of the Khronos OpenXR loader library for Windows. We use the include files for all platforms.

- Upstream: https://github.com/KhronosGroup/OpenXR-SDK/releases
- Version 1.0.20
- Version 1.0.24
- License: Apache 2.0 or MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/************************************************************************************
Filename : fb_composition_layer_depth_test.h
Content : Extension to control if a layer will participate in depth testing. If
extension is not used no layer will participate in depth testing.
Language : C99 Copyright
Copyright(c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*************************************************************************************/
#pragma once

#include <openxr/openxr_extension_helpers.h>

/*
Extension 213 XR_FB_composition_layer_depth_test
*/

#if defined(__cplusplus)
extern "C" {
#endif

#ifndef XR_FB_composition_layer_depth_test

// This extension enables depth-tested layer composition. The compositor will maintain a depth
// buffer in addition to a color buffer. The depth buffer is cleared to a depth corresponding to the
// infinitely far distance at the beginning of composition.

// When composing each layer, if depth testing is requested, the incoming layer depths are
// transformed into the compositor window space depth and compared to the depth stored in the frame
// buffer. If the depth test fails, the fragment is discarded. If the depth test passes the depth
// buffer is updated if depth writes are enabled, and color processing continues.

// Depth testing requires depth values for the layer. For projection layers, this can be supplied
// via the XR_KHR_composition_layer_depth extension. For geometric primitive layers, the runtime
// computes the depth of the sample directly from the layer parameters.
// XrCompositionLayerDepthTestFB may only be chained to layers that support depth.

#if defined(XR_FB_composition_layer_depth_test_EXPERIMENTAL_VERSION)
#if XR_FB_composition_layer_depth_test_EXPERIMENTAL_VERSION != 1
#error \
"unknown experimental version number for XR_FB_composition_layer_depth_test_EXPERIMENTAL_VERSION"
#endif

#define XR_FB_composition_layer_depth_test 1
#define XR_FB_composition_layer_depth_test_SPEC_VERSION 1
#define XR_FB_COMPOSITION_LAYER_DEPTH_TEST_EXTENSION_NAME "XR_FBX1_composition_layer_depth_test"

typedef enum XrCompareOpFB {
XR_COMPARE_OP_NEVER_FB = 0,
XR_COMPARE_OP_LESS_FB = 1,
XR_COMPARE_OP_EQUAL_FB = 2,
XR_COMPARE_OP_LESS_OR_EQUAL_FB = 3,
XR_COMPARE_OP_GREATER_FB = 4,
XR_COMPARE_OP_NOT_EQUAL_FB = 5,
XR_COMPARE_OP_GREATER_OR_EQUAL_FB = 6,
XR_COMPARE_OP_ALWAYS_FB = 7,
} XrCompareOpFB;

// To specify that a layer should be depth tested, a XrCompositionLayerDepthTestFB structure must be
// passed via the polymorphic XrCompositionLayerBaseHeader structure’s next parameter chain.

// Valid Usage (Implicit)
// * The XR_FB_composition_layer_depth_test extension must be enabled prior to using
// XrCompositionLayerDepthTestFB
// * type must be XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_FB
// * next must be NULL or a valid pointer to the next structure in a structure chain
// * compareOp must be a valid XrCompareOpFB value

XR_STRUCT_ENUM(XR_TYPE_COMPOSITION_LAYER_DEPTH_TEST_FB, 1000212000);
typedef struct XrCompositionLayerDepthTestFB {
XrStructureType type;
void* XR_MAY_ALIAS next;
XrBool32 depthMask;
XrCompareOpFB compareOp;
} XrCompositionLayerDepthTestFB;

#endif // defined(XR_FB_composition_layer_depth_test_EXPERIMENTAL_VERSION)

#endif // XR_FB_composition_layer_depth_test

#ifdef __cplusplus
}
#endif
183 changes: 183 additions & 0 deletions thirdparty/oculus_mobile_sdk/OpenXR/Include/openxr/fb_scene.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
/************************************************************************************
Filename : fb_scene.h
Content : This header defines spatial entity components and functions used to obtain
information from Scene Model.
Language : C99
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*************************************************************************************/

#pragma once

#if defined(__cplusplus)
extern "C" {
#endif

// Extension 176

#ifndef XR_FB_scene
#define XR_FB_scene 1


#ifndef XR_FB_scene_EXPERIMENTAL_VERSION
#define XR_FB_scene_SPEC_VERSION 1
#define XR_FB_SCENE_EXTENSION_NAME "XR_FB_scene"
#else
#error "unknown experimental version number for XR_FB_scene_EXPERIMENTAL_VERSION"
#endif

// Helper structs to define a 3D bounding box, similar to the 2D counterparts.
typedef struct XrExtent3DfFB {
float width;
float height;
float depth;
} XrExtent3DfFB;

typedef struct XrOffset3DfFB {
float x;
float y;
float z;
} XrOffset3DfFB;

typedef struct XrRect3DfFB {
XrOffset3DfFB offset;
XrExtent3DfFB extent;
} XrRect3DfFB;

// Semantic labels component for two-call idiom with xrGetSpaceSemanticLabelsFB.
static const XrStructureType XR_TYPE_SEMANTIC_LABELS_FB = (XrStructureType)1000175000;
typedef struct XrSemanticLabelsFB {
XrStructureType type;
const void* XR_MAY_ALIAS next;

// Input, capacity of the label buffer in byte.
uint32_t byteCapacityInput;

// Output, size of the label buffer in byte.
uint32_t byteCountOutput;

// Multiple labels represented by raw string, separated by comma (,).
char* labels;
} XrSemanticLabelsFB;

// Room layout component for two-call idiom with xrGetSpaceRoomLayoutFB.
static const XrStructureType XR_TYPE_ROOM_LAYOUT_FB = (XrStructureType)1000175001;
typedef struct XrRoomLayoutFB {
XrStructureType type;
const void* XR_MAY_ALIAS next;

// Floor of the room layout.
XrUuidEXT floorUuid;

// Ceiling of the room layout.
XrUuidEXT ceilingUuid;

// Input, capacity of wall list buffer.
uint32_t wallUuidCapacityInput;

// Output, number of walls included in the list.
uint32_t wallUuidCountOutput;

// Ordered list of walls of the room layout.
XrUuidEXT* wallUuids;
} XrRoomLayoutFB;

// 2D boundary for two-call idiom with xrGetSpaceBoundary2DFB.
static const XrStructureType XR_TYPE_BOUNDARY_2D_FB = (XrStructureType)1000175002;
typedef struct XrBoundary2DFB {
XrStructureType type;
const void* XR_MAY_ALIAS next;

// Input, capacity of the vertex buffer.
uint32_t vertexCapacityInput;

// Output, size of the vertex buffer.
uint32_t vertexCountOutput;
// Vertices of the polygonal boundary in the coordinate frame of the associated space.
// Currently only support outer bounds.
XrVector2f* vertices;
} XrBoundary2DFB;

// Get 2D bounding box associated with space that has bounded 2D component enabled.
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceBoundingBox2DFB)(
XrSession session,
XrSpace space,
XrRect2Df* boundingBox2DOutput);

// Get 3D bounding box associated with space that has bounded 3D component enabled.
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceBoundingBox3DFB)(
XrSession session,
XrSpace space,
XrRect3DfFB* boundingBox3DOutput);

// Get semantic labels associated with space that has semantic labels component enabled.
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceSemanticLabelsFB)(
XrSession session,
XrSpace space,
XrSemanticLabelsFB* semanticLabelsOutput);

// Get 2D boundary associated with space that has bounded 2D component enabled.
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceBoundary2DFB)(
XrSession session,
XrSpace space,
XrBoundary2DFB* boundary2DOutput);

// Get room layout associated with space that has room layout component enabled.
typedef XrResult(XRAPI_PTR* PFN_xrGetSpaceRoomLayoutFB)(
XrSession session,
XrSpace space,
XrRoomLayoutFB* roomLayoutOutput);

#ifndef XR_NO_PROTOTYPES
#ifdef XR_EXTENSION_PROTOTYPES

// Get 2D bounding box associated with space that has bounded 2D component enabled.
XRAPI_ATTR XrResult XRAPI_CALL
xrGetSpaceBoundingBox2DFB(XrSession session, XrSpace space, XrRect2Df* boundingBox2DOutput);

// Get 3D bounding box associated with space that has bounded 3D component enabled.
XRAPI_ATTR XrResult XRAPI_CALL
xrGetSpaceBoundingBox3DFB(XrSession session, XrSpace space, XrRect3DfFB* boundingBox3DOutput);

// Get semantic labels associated with space that has semantic labels component enabled.
// Note: This functions uses two-call idiom:
// 1) When byteCapacityInput == 0, only byteCountOutput will be updated and no semantic label string
// will be copied;
// 2) When byteCapacityInput >= byteCountOutput, semantic labels will be copied to labels as a
// string;
// 3) Otherwise returns XR_ERROR_SIZE_INSUFFICIENT.
XRAPI_ATTR XrResult XRAPI_CALL xrGetSpaceSemanticLabelsFB(
XrSession session,
XrSpace space,
XrSemanticLabelsFB* semanticLabelsOutput);

// Get 2D boundary associated with space that has bounded 2D component enabled.
// Note: This functions uses two-call idiom:
// 1) When vertexCapacityInput == 0, only vertexCountOutput will be updated and no vertices will
// be copied;
// 2) When vertexCapacityInput >= vertexCountOutput, vertices will be copied to boundary2DOutput;
// 3) Otherwise returns XR_ERROR_SIZE_INSUFFICIENT.
XRAPI_ATTR XrResult XRAPI_CALL
xrGetSpaceBoundary2DFB(XrSession session, XrSpace space, XrBoundary2DFB* boundary2DOutput);

// Get room layout associated with space that has room layout component enabled.
// Note: This functions uses two-call idiom:
// 1) When uuidWallsCapacityInput == 0, only uuidWallsCountOutput will be updated and no UUIDs will
// be copied;
// 2) When uuidWallsCapacityInput >= uuidWallsCountOutput, UUIDs will be copied to
// entityContainerOutput;
// 3) Otherwise returns XR_ERROR_SIZE_INSUFFICIENT.
XRAPI_ATTR XrResult XRAPI_CALL
xrGetSpaceRoomLayoutFB(XrSession session, XrSpace space, XrRoomLayoutFB* roomLayoutOutput);

#endif // XR_EXTENSION_PROTOTYPES
#endif // !XR_NO_PROTOTYPES


#endif // XR_FB_scene

#ifdef __cplusplus
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/************************************************************************************
Filename : fb_scene_capture.h
Content : Scene Capture functionality.
Language : C99
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
*************************************************************************************/

#pragma once

#include <openxr/fb_spatial_entity.h>

#if defined(__cplusplus)
extern "C" {
#endif

// Extension 199

#ifndef XR_FB_scene_capture
#define XR_FB_scene_capture 1


#ifndef XR_FB_scene_capture_EXPERIMENTAL_VERSION
#define XR_FB_scene_capture_SPEC_VERSION 1
#define XR_FB_SCENE_CAPTURE_EXTENSION_NAME "XR_FB_scene_capture"
#else
#error "unknown experimental version number for XR_FB_scene_capture_EXPERIMENTAL_VERSION"
#endif

// Events.
static const XrStructureType XR_TYPE_EVENT_DATA_SCENE_CAPTURE_COMPLETE_FB =
(XrStructureType)1000198001;

// Struct of scene capture complete event
// The event struct contains the result of the scene capture operation
typedef struct XrEventDataSceneCaptureCompleteFB {
XrStructureType type; // XR_TYPE_EVENT_DATA_SCENE_CAPTURE_COMPLETE_FB
const void* XR_MAY_ALIAS next;
XrAsyncRequestIdFB requestId;
XrResult result;
} XrEventDataSceneCaptureCompleteFB;

// Struct for requesting scene capture.
static const XrStructureType XR_TYPE_SCENE_CAPTURE_REQUEST_INFO_FB = (XrStructureType)1000198050;
typedef struct XrSceneCaptureRequestInfoFB {
XrStructureType type;
const void* XR_MAY_ALIAS next;

// Length of request buffer.
uint32_t requestByteCount;

// Request buffer.
const char* request;
} XrSceneCaptureRequestInfoFB;

// Request scene capture to the system.
typedef XrResult(XRAPI_PTR* PFN_xrRequestSceneCaptureFB)(
XrSession session,
const XrSceneCaptureRequestInfoFB* request,
XrAsyncRequestIdFB* requestId);

#ifndef XR_NO_PROTOTYPES
#ifdef XR_EXTENSION_PROTOTYPES

// Request scene capture to the system.
XRAPI_ATTR XrResult XRAPI_CALL xrRequestSceneCaptureFB(
XrSession session,
const XrSceneCaptureRequestInfoFB* request,
XrAsyncRequestIdFB* requestId);

#endif // XR_EXTENSION_PROTOTYPES
#endif // !XR_NO_PROTOTYPES


#endif // XR_FB_scene_capture

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 02f9d56

Please sign in to comment.