Browse Source

Upgraded openxr dependency to 1.1.41. (#823)

This update makes it straightforward to build O3DE
applications for Meta Quest devices, because the developer
is not required anymore to download and decompress the `Oculus OpenXR Mobile SDK`.

To understand this change, let's review a little bit of history:
When making O3DE apps for Meta Quest devices, the developer
was instructed to manually download and decompress the
 `Oculus OpenXR Mobile SDK` into a particular directory of the `OpenXRVk` Gem.
Those instructions worked well until SDK v62.

Starting SDK v63+ (It's currently at v72)
Meta stopped distributing pre-compiled OpenXR Loader libraries, and now applications are simply
required to get the OpenXR Loader directly from github:
https://github.com/KhronosGroup/OpenXR-SDK

In particular, this PR picks version 1.1.41 because that's the version used
by `v72` of `Oculus OpenXR Mobile SDK`.
In other words, with this change, OpenXR is now supported in its purest form,
because there are no custom steps for a particular vendor.

Updated to rev2 of openxr-1.1.41 package
which was recompiled by the 3p-package-source
with NDK 25.

Signed-off-by: galibzon <[email protected]>
galibzon 4 months ago
parent
commit
f0d7cc3474

+ 2 - 9
Gems/OpenXRVk/3rdParty/Platform/Android/BuiltInPackages_android.cmake

@@ -6,12 +6,5 @@
 #
 #
 #
 #
 
 
-set(ANDROID_USE_OCULUS_OPENXR OFF CACHE BOOL "When ON it uses OpenXR library from Oculus SDK.")
-
-if(ANDROID_USE_OCULUS_OPENXR)
-    include(${CMAKE_CURRENT_LIST_DIR}/FindOpenXROculus.cmake)
-    set(openxr_dependency 3rdParty::OpenXROculus)
-else()
-    ly_associate_package(PACKAGE_NAME OpenXR-1.0.22-rev1-android    TARGETS OpenXR  PACKAGE_HASH 1227204583ce224c7e3843e82bb36deb576df6b458eecce46740cb8941902f21)
-    set(openxr_dependency 3rdParty::OpenXR)
-endif()
+ly_associate_package(PACKAGE_NAME OpenXR-1.1.41-rev2-android    TARGETS OpenXR  PACKAGE_HASH ffd5b4c4a7f9f1af1bd2f58dfd9907c91ffad92e0eacaaabf1779607ecf673f4)
+set(openxr_dependency 3rdParty::OpenXR)

+ 0 - 42
Gems/OpenXRVk/3rdParty/Platform/Android/FindOpenXROculus.cmake

@@ -1,42 +0,0 @@
-#
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-# 
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-#
-
-# this file actually ingests the library and defines targets.
-set(TARGET_WITH_NAMESPACE "3rdParty::OpenXROculus")
-if (TARGET ${TARGET_WITH_NAMESPACE})
-    return()
-endif()
-
-set(MY_NAME "OpenXROculus")
-
-get_property(openxrvk_gem_root GLOBAL PROPERTY "@GEMROOT:OpenXRVk@")
-
-set(OculusOpenXRSDKPath ${openxrvk_gem_root}/External/OculusOpenXRMobileSDK)
-
-set(${MY_NAME}_INCLUDE_DIR 
-    ${OculusOpenXRSDKPath}/3rdParty/khronos/openxr/OpenXR-SDK/include
-    ${OculusOpenXRSDKPath}/OpenXR/Include)
-
-set(PATH_TO_SHARED_LIBS ${OculusOpenXRSDKPath}/OpenXR/Libs/Android/arm64-v8a)
-
-if(NOT EXISTS ${PATH_TO_SHARED_LIBS}/Release/libopenxr_loader.so)
-    message(FATAL_ERROR
-        "Oculus OpenXR loader library not found at ${PATH_TO_SHARED_LIBS}/Release. "
-        "Oculus OpenXR Mobile SDK needs to be downloaded via https://developer.oculus.com/downloads/native-android/ "
-        "and uncompressed into OpenXRVk/External/OculusOpenXRMobileSDK folder.")
-    return()
-endif()
-
-add_library(${TARGET_WITH_NAMESPACE} SHARED IMPORTED GLOBAL)
-ly_target_include_system_directories(TARGET ${TARGET_WITH_NAMESPACE} INTERFACE ${${MY_NAME}_INCLUDE_DIR})
-set_target_properties(${TARGET_WITH_NAMESPACE}
-    PROPERTIES
-        IMPORTED_LOCATION ${PATH_TO_SHARED_LIBS}/Release/libopenxr_loader.so
-        IMPORTED_LOCATION_DEBUG ${PATH_TO_SHARED_LIBS}/Debug/libopenxr_loader.so)
-
-set(${MY_NAME}_FOUND True)

+ 2 - 2
Gems/OpenXRVk/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake

@@ -6,6 +6,6 @@
 #
 #
 #
 #
 
 
-ly_associate_package(PACKAGE_NAME OpenXR-1.0.22-rev1-windows    TARGETS OpenXR  PACKAGE_HASH 55235d77253efe1af046a4a3e7dd7a8e5f6768401326d5e077c827cce323cd11)
-
+ly_associate_package(PACKAGE_NAME OpenXR-1.1.41-rev2-windows    TARGETS OpenXR  PACKAGE_HASH 3fabbf5db71fa75d296417861bb7df2bd782d8a7bb7a60c7854cdf768dcdca53)
 set(openxr_dependency 3rdParty::OpenXR)
 set(openxr_dependency 3rdParty::OpenXR)
+

+ 0 - 7
Gems/OpenXRVk/External/OculusOpenXRMobileSDK/README.md

@@ -1,7 +0,0 @@
-# Oculus OpenXR Mobile SDK
-
-The Oculus OpenXR Mobile SDK is not included as part of O3DE.
-
-When enabling OpenXRVk Gem, download the SDK and uncompress it in the following folder within the gem: `OpenXRVk\External\OculusOpenXRMobileSDK`
-
-The Oculus OpenXR Mobile SDK can be found in the following link: https://developer.oculus.com/downloads/native-android/

+ 2 - 1
Projects/OpenXRTest/Registry/autoexec.game.setreg

@@ -2,7 +2,8 @@
     "O3DE": {
     "O3DE": {
         "Autoexec": {
         "Autoexec": {
             "ConsoleCommands": {
             "ConsoleCommands": {
-                "LoadLevel": "DefaultLevel"
+                //"LoadLevel": "DefaultLevel"
+                "LoadLevel": "XR_Office"
             }
             }
         }
         }
     }
     }