summaryrefslogtreecommitdiffstats
path: root/thirdparty/openxr/src
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/openxr/src')
-rw-r--r--thirdparty/openxr/src/common/platform_utils.hpp84
-rw-r--r--thirdparty/openxr/src/common/xr_dependencies.h6
-rw-r--r--thirdparty/openxr/src/common/xr_linear.h20
-rw-r--r--thirdparty/openxr/src/loader/.gitignore5
-rw-r--r--thirdparty/openxr/src/loader/api_layer_interface.cpp30
-rw-r--r--thirdparty/openxr/src/loader/loader_core.cpp2
-rw-r--r--thirdparty/openxr/src/loader/loader_instance.cpp2
-rw-r--r--thirdparty/openxr/src/loader/manifest_file.cpp77
-rw-r--r--thirdparty/openxr/src/loader/runtime_interface.cpp45
-rw-r--r--thirdparty/openxr/src/loader/xr_generated_loader.cpp2
-rw-r--r--thirdparty/openxr/src/xr_generated_dispatch_table.c12
-rw-r--r--thirdparty/openxr/src/xr_generated_dispatch_table.h10
-rw-r--r--thirdparty/openxr/src/xr_generated_dispatch_table_core.c112
-rw-r--r--thirdparty/openxr/src/xr_generated_dispatch_table_core.h119
14 files changed, 420 insertions, 106 deletions
diff --git a/thirdparty/openxr/src/common/platform_utils.hpp b/thirdparty/openxr/src/common/platform_utils.hpp
index 219d19789d..883baef82d 100644
--- a/thirdparty/openxr/src/common/platform_utils.hpp
+++ b/thirdparty/openxr/src/common/platform_utils.hpp
@@ -37,6 +37,44 @@
#include "common_config.h"
#endif // OPENXR_HAVE_COMMON_CONFIG
+#if defined(__x86_64__) && defined(__ILP32__)
+#define XR_ARCH_ABI "x32"
+#elif defined(_M_X64) || defined(__x86_64__)
+#define XR_ARCH_ABI "x86_64"
+#elif defined(_M_IX86) || defined(__i386__) || defined(_X86_)
+#define XR_ARCH_ABI "i686"
+#elif (defined(__aarch64__) && defined(__LP64__)) || defined(_M_ARM64)
+#define XR_ARCH_ABI "aarch64"
+#elif (defined(__ARM_ARCH) && __ARM_ARCH >= 7 && (defined(__ARM_PCS_VFP) || defined(__ANDROID__))) || defined(_M_ARM)
+#define XR_ARCH_ABI "armv7a-vfp"
+#elif defined(__ARM_ARCH_5TE__)
+#define XR_ARCH_ABI "armv5te"
+#elif defined(__mips64)
+#define XR_ARCH_ABI "mips64"
+#elif defined(__mips)
+#define XR_ARCH_ABI "mips"
+#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+#define XR_ARCH_ABI "ppc64"
+#elif defined(__powerpc__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define XR_ARCH_ABI "ppc64el"
+#elif defined(__s390x__) || defined(__zarch__)
+#define XR_ARCH_ABI "s390x"
+#elif defined(__hppa__)
+#define XR_ARCH_ABI "hppa"
+#elif defined(__alpha__)
+#define XR_ARCH_ABI "alpha"
+#elif defined(__ia64__) || defined(_M_IA64)
+#define XR_ARCH_ABI "ia64"
+#elif defined(__m68k__)
+#define XR_ARCH_ABI "m68k"
+#elif defined(__riscv_xlen) && (__riscv_xlen == 64)
+#define XR_ARCH_ABI "riscv64"
+#elif defined(__sparc__) && defined(__arch64__)
+#define XR_ARCH_ABI "sparc64"
+#else
+#error "No architecture string known!"
+#endif
+
// Consumers of this file must ensure this function is implemented. For example, the loader will implement this function so that it
// can route messages through the loader's logging system.
void LogPlatformUtilsError(const std::string& message);
@@ -47,6 +85,7 @@ void LogPlatformUtilsError(const std::string& message);
#include <unistd.h>
#include <fcntl.h>
#include <iostream>
+#include <sys/stat.h>
namespace detail {
@@ -72,6 +111,31 @@ static inline char* ImplGetSecureEnv(const char* name) {
} // namespace detail
#endif // defined(XR_OS_LINUX) || defined(XR_OS_APPLE)
+
+#if defined(XR_OS_ANDROID) || defined(XR_OS_APPLE)
+
+#include <sys/stat.h>
+
+namespace detail {
+
+static inline bool ImplTryRuntimeFilename(const char* rt_dir_prefix, uint16_t major_version, std::string& file_name) {
+ auto decorated_path = rt_dir_prefix + std::to_string(major_version) + "/active_runtime." XR_ARCH_ABI ".json";
+ auto undecorated_path = rt_dir_prefix + std::to_string(major_version) + "/active_runtime.json";
+
+ struct stat buf {};
+ if (0 == stat(decorated_path.c_str(), &buf)) {
+ file_name = decorated_path;
+ return true;
+ }
+ if (0 == stat(undecorated_path.c_str(), &buf)) {
+ file_name = undecorated_path;
+ return true;
+ }
+ return false;
+}
+
+} // namespace detail
+#endif // defined(XR_OS_ANDROID) || defined(XR_OS_APPLE)
#if defined(XR_OS_LINUX)
static inline std::string PlatformUtilsGetEnv(const char* name) {
@@ -130,15 +194,8 @@ static inline bool PlatformUtilsSetEnv(const char* name, const char* value) {
return (result == 0);
}
-// Prefix for the Apple global runtime JSON file name
-static const std::string rt_dir_prefix = "/usr/local/share/openxr/";
-static const std::string rt_filename = "/active_runtime.json";
-
static inline bool PlatformGetGlobalRuntimeFileName(uint16_t major_version, std::string& file_name) {
- file_name = rt_dir_prefix;
- file_name += std::to_string(major_version);
- file_name += rt_filename;
- return true;
+ return detail::ImplTryRuntimeFilename("/usr/local/share/openxr/", major_version, file_name);
}
#elif defined(XR_OS_WINDOWS)
@@ -311,22 +368,19 @@ static inline bool PlatformUtilsSetEnv(const char* /* name */, const char* /* va
return false;
}
-#include <sys/stat.h>
-
// Intended to be only used as a fallback on Android, with a more open, "native" technique used in most cases
static inline bool PlatformGetGlobalRuntimeFileName(uint16_t major_version, std::string& file_name) {
// Prefix for the runtime JSON file name
static const char* rt_dir_prefixes[] = {"/product", "/odm", "/oem", "/vendor", "/system"};
- static const std::string rt_filename = "/active_runtime.json";
+
static const std::string subdir = "/etc/openxr/";
for (const auto prefix : rt_dir_prefixes) {
- auto path = prefix + subdir + std::to_string(major_version) + rt_filename;
- struct stat buf;
- if (0 == stat(path.c_str(), &buf)) {
- file_name = path;
+ const std::string rt_dir_prefix = prefix + subdir;
+ if (detail::ImplTryRuntimeFilename(rt_dir_prefix.c_str(), major_version, file_name)) {
return true;
}
}
+
return false;
}
#else // Not Linux, Apple, nor Windows
diff --git a/thirdparty/openxr/src/common/xr_dependencies.h b/thirdparty/openxr/src/common/xr_dependencies.h
index 5c7bd04774..6c9cf2d05f 100644
--- a/thirdparty/openxr/src/common/xr_dependencies.h
+++ b/thirdparty/openxr/src/common/xr_dependencies.h
@@ -76,7 +76,10 @@
#include "wayland-client.h"
#endif // XR_USE_PLATFORM_WAYLAND
-#ifdef XR_USE_GRAPHICS_API_OPENGL
+#ifdef XR_USE_PLATFORM_EGL
+#include <EGL/egl.h>
+#endif // XR_USE_PLATFORM_EGL
+
#if defined(XR_USE_PLATFORM_XLIB) || defined(XR_USE_PLATFORM_XCB)
#ifdef Success
#undef Success
@@ -90,4 +93,3 @@
#undef None
#endif // None
#endif // defined(XR_USE_PLATFORM_XLIB) || defined(XR_USE_PLATFORM_XCB)
-#endif // XR_USE_GRAPHICS_API_OPENGL
diff --git a/thirdparty/openxr/src/common/xr_linear.h b/thirdparty/openxr/src/common/xr_linear.h
index 5b0da645ac..ce65f8ddfb 100644
--- a/thirdparty/openxr/src/common/xr_linear.h
+++ b/thirdparty/openxr/src/common/xr_linear.h
@@ -1,5 +1,5 @@
-// Copyright (c) 2017 The Khronos Group Inc.
-// Copyright (c) 2016 Oculus VR, LLC.
+// Copyright (c) 2017-2023, The Khronos Group Inc.
+// Copyright (c) 2016, Oculus VR, LLC.
//
// SPDX-License-Identifier: Apache-2.0
//
@@ -23,15 +23,17 @@
#include <openxr/openxr.h>
+/* REUSE-IgnoreStart */
+/* The following has copyright notices that duplicate the header above */
+
/*
================================================================================================
-Description : Vector, matrix and quaternion math.
-Author : J.M.P. van Waveren
-Date : 12/10/2016
-Language : C99
-Format : Indent 4 spaces - no tabs.
-Copyright : Copyright (c) 2016 Oculus VR, LLC. All Rights reserved.
+Description : Vector, matrix and quaternion math.
+Orig. Author : J.M.P. van Waveren
+Orig. Date : 12/10/2016
+Language : C99
+Copyright : Copyright (c) 2016 Oculus VR, LLC. All Rights reserved.
DESCRIPTION
@@ -145,6 +147,8 @@ inline static float XrRcpSqrt(const float x) {
return rcp;
}
+inline static float XrVector2f_Length(const XrVector2f* v) { return sqrtf(v->x * v->x + v->y * v->y); }
+
inline static void XrVector3f_Set(XrVector3f* v, const float value) {
v->x = value;
v->y = value;
diff --git a/thirdparty/openxr/src/loader/.gitignore b/thirdparty/openxr/src/loader/.gitignore
deleted file mode 100644
index 5e8e0ba3a4..0000000000
--- a/thirdparty/openxr/src/loader/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright (c) 2020 The Khronos Group Inc.
-#
-# SPDX-License-Identifier: Apache-2.0
-
-!openxr_loader_for_android.pom
diff --git a/thirdparty/openxr/src/loader/api_layer_interface.cpp b/thirdparty/openxr/src/loader/api_layer_interface.cpp
index 5560c31a52..c9e24ec40b 100644
--- a/thirdparty/openxr/src/loader/api_layer_interface.cpp
+++ b/thirdparty/openxr/src/loader/api_layer_interface.cpp
@@ -237,21 +237,23 @@ XrResult ApiLayerInterface::LoadApiLayers(const std::string& openxr_command, uin
for (const auto& layer_name : enabled_explicit_api_layer_names) {
bool found_this_layer = false;
- for (auto it = explicit_layer_manifest_files.begin(); it != explicit_layer_manifest_files.end();) {
- bool erased_layer_manifest_file = false;
-
- if (layers_already_found.count(layer_name) > 0) {
- found_this_layer = true;
- } else if (layer_name == (*it)->LayerName()) {
- found_this_layer = true;
- layers_already_found.insert(layer_name);
- enabled_layer_manifest_files_in_init_order.push_back(std::move(*it));
- it = explicit_layer_manifest_files.erase(it);
- erased_layer_manifest_file = true;
- }
+ if (layers_already_found.count(layer_name) > 0) {
+ found_this_layer = true;
+ } else {
+ for (auto it = explicit_layer_manifest_files.begin(); it != explicit_layer_manifest_files.end();) {
+ bool erased_layer_manifest_file = false;
+
+ if (layer_name == (*it)->LayerName()) {
+ found_this_layer = true;
+ layers_already_found.insert(layer_name);
+ enabled_layer_manifest_files_in_init_order.push_back(std::move(*it));
+ it = explicit_layer_manifest_files.erase(it);
+ erased_layer_manifest_file = true;
+ }
- if (!erased_layer_manifest_file) {
- it++;
+ if (!erased_layer_manifest_file) {
+ it++;
+ }
}
}
diff --git a/thirdparty/openxr/src/loader/loader_core.cpp b/thirdparty/openxr/src/loader/loader_core.cpp
index 98d3fa971a..06e6870053 100644
--- a/thirdparty/openxr/src/loader/loader_core.cpp
+++ b/thirdparty/openxr/src/loader/loader_core.cpp
@@ -19,7 +19,7 @@
#include "loader_logger.hpp"
#include "loader_platform.hpp"
#include "runtime_interface.hpp"
-#include "xr_generated_dispatch_table.h"
+#include "xr_generated_dispatch_table_core.h"
#include "xr_generated_loader.hpp"
#include <openxr/openxr.h>
diff --git a/thirdparty/openxr/src/loader/loader_instance.cpp b/thirdparty/openxr/src/loader/loader_instance.cpp
index badd39193c..ce5c205505 100644
--- a/thirdparty/openxr/src/loader/loader_instance.cpp
+++ b/thirdparty/openxr/src/loader/loader_instance.cpp
@@ -18,7 +18,7 @@
#include "loader_interfaces.h"
#include "loader_logger.hpp"
#include "runtime_interface.hpp"
-#include "xr_generated_dispatch_table.h"
+#include "xr_generated_dispatch_table_core.h"
#include "xr_generated_loader.hpp"
#include <openxr/openxr.h>
diff --git a/thirdparty/openxr/src/loader/manifest_file.cpp b/thirdparty/openxr/src/loader/manifest_file.cpp
index 99f4e84104..0683bc166a 100644
--- a/thirdparty/openxr/src/loader/manifest_file.cpp
+++ b/thirdparty/openxr/src/loader/manifest_file.cpp
@@ -274,16 +274,45 @@ static std::string GetXDGEnvAbsolute(const char *name, const char *fallback_path
return fallback_paths;
}
+/// @param rt_dir_prefix Directory prefix with a trailing slash
+static bool FindEitherActiveRuntimeFilename(const char *prefix_desc, const std::string &rt_dir_prefix, uint16_t major_version,
+ std::string &out) {
+ {
+ std::ostringstream oss;
+ oss << "Looking for active_runtime." XR_ARCH_ABI ".json or active_runtime.json in ";
+ oss << prefix_desc;
+ oss << ": ";
+ oss << rt_dir_prefix;
+
+ LoaderLogger::LogInfoMessage("", oss.str());
+ }
+ {
+ auto decorated_path = rt_dir_prefix + std::to_string(major_version) + "/active_runtime." XR_ARCH_ABI ".json";
+
+ if (FileSysUtilsPathExists(decorated_path)) {
+ out = decorated_path;
+ return true;
+ }
+ }
+ {
+ auto undecorated_path = rt_dir_prefix + std::to_string(major_version) + "/active_runtime.json";
+
+ if (FileSysUtilsPathExists(undecorated_path)) {
+ out = undecorated_path;
+ return true;
+ }
+ }
+ return false;
+}
// Return the first instance of relative_path occurring in an XDG config dir according to standard
// precedence order.
-static bool FindXDGConfigFile(const std::string &relative_path, std::string &out) {
- out = GetXDGEnvHome("XDG_CONFIG_HOME", ".config");
- if (!out.empty()) {
- out += "/";
- out += relative_path;
-
- LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in XDG_CONFIG_HOME: " + out);
- if (FileSysUtilsPathExists(out)) {
+static bool FindXDGConfigFile(const char *relative_dir, uint16_t major_version, std::string &out) {
+ const std::string message{"Looking for active_runtime." XR_ARCH_ABI ".json or active_runtime.json"};
+ std::string dir_prefix = GetXDGEnvHome("XDG_CONFIG_HOME", ".config");
+ if (!dir_prefix.empty()) {
+ dir_prefix += "/";
+ dir_prefix += relative_dir;
+ if (FindEitherActiveRuntimeFilename("XDG_CONFIG_HOME", dir_prefix, major_version, out)) {
return true;
}
}
@@ -294,29 +323,26 @@ static bool FindXDGConfigFile(const std::string &relative_path, std::string &out
if (path.empty()) {
continue;
}
- out = path;
- out += "/";
- out += relative_path;
- LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in an entry of XDG_CONFIG_DIRS: " + out);
- if (FileSysUtilsPathExists(out)) {
+ dir_prefix = std::move(path);
+ dir_prefix += "/";
+ dir_prefix += relative_dir;
+ if (FindEitherActiveRuntimeFilename("an entry of XDG_CONFIG_DIRS", dir_prefix, major_version, out)) {
return true;
}
}
- out = SYSCONFDIR;
- out += "/";
- out += relative_path;
- LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in compiled-in SYSCONFDIR: " + out);
- if (FileSysUtilsPathExists(out)) {
+ dir_prefix = SYSCONFDIR;
+ dir_prefix += "/";
+ dir_prefix += relative_dir;
+ if (FindEitherActiveRuntimeFilename("compiled-in SYSCONFDIR", dir_prefix, major_version, out)) {
return true;
}
#if defined(EXTRASYSCONFDIR)
- out = EXTRASYSCONFDIR;
- out += "/";
- out += relative_path;
- LoaderLogger::LogInfoMessage("", "Looking for " + relative_path + " in compiled-in EXTRASYSCONFDIR: " + out);
- if (FileSysUtilsPathExists(out)) {
+ dir_prefix = EXTRASYSCONFDIR;
+ dir_prefix += "/";
+ dir_prefix += relative_dir;
+ if (FindEitherActiveRuntimeFilename("compiled-in EXTRASYSCONFDIR", dir_prefix, major_version, out)) {
return true;
}
#endif
@@ -632,9 +658,8 @@ XrResult RuntimeManifestFile::FindManifestFiles(std::vector<std::unique_ptr<Runt
LoaderLogger::LogInfoMessage("",
"RuntimeManifestFile::FindManifestFiles - using registry-specified runtime file " + filename);
#elif defined(XR_OS_LINUX)
- const std::string relative_path =
- "openxr/" + std::to_string(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION)) + "/active_runtime.json";
- if (!FindXDGConfigFile(relative_path, filename)) {
+
+ if (!FindXDGConfigFile("openxr/", XR_VERSION_MAJOR(XR_CURRENT_API_VERSION), filename)) {
LoaderLogger::LogErrorMessage(
"", "RuntimeManifestFile::FindManifestFiles - failed to determine active runtime file path for this environment");
return XR_ERROR_RUNTIME_UNAVAILABLE;
diff --git a/thirdparty/openxr/src/loader/runtime_interface.cpp b/thirdparty/openxr/src/loader/runtime_interface.cpp
index d9ab86bb58..8312b15ba4 100644
--- a/thirdparty/openxr/src/loader/runtime_interface.cpp
+++ b/thirdparty/openxr/src/loader/runtime_interface.cpp
@@ -13,7 +13,7 @@
#include "loader_interfaces.h"
#include "loader_logger.hpp"
#include "loader_platform.hpp"
-#include "xr_generated_dispatch_table.h"
+#include "xr_generated_dispatch_table_core.h"
#include <openxr/openxr.h>
@@ -29,6 +29,10 @@
#include "android_utilities.h"
#include <android/asset_manager_jni.h>
#include <json/value.h>
+
+// Needed for the loader init struct
+#include <xr_dependencies.h>
+#include <openxr/openxr_platform.h>
#endif // XR_USE_PLATFORM_ANDROID
#ifdef XR_KHR_LOADER_INIT_SUPPORT
@@ -105,33 +109,22 @@ XrResult LoaderInitData::initialize(const XrLoaderInitInfoBaseHeaderKHR* info) {
if (cast_info->applicationContext == nullptr) {
return XR_ERROR_VALIDATION_FAILURE;
}
+
+ // Copy and store the JVM pointer and Android Context, ensuring the JVM is initialised.
_data = *cast_info;
- jni::init((jni::JavaVM*)_data.applicationVM);
_data.next = nullptr;
- JNIEnv* Env;
- ((jni::JavaVM*)(cast_info->applicationVM))->AttachCurrentThread(&Env, nullptr);
- const jclass contextClass = Env->GetObjectClass((jobject)_data.applicationContext);
-
- const jmethodID getAssetsMethod = Env->GetMethodID(contextClass, "getAssets", "()Landroid/content/res/AssetManager;");
- const jobject AssetManagerObject = Env->CallObjectMethod((jobject)_data.applicationContext, getAssetsMethod);
- _android_asset_manager = AAssetManager_fromJava(Env, AssetManagerObject);
-
- const jmethodID getApplicationContextMethod =
- Env->GetMethodID(contextClass, "getApplicationContext", "()Landroid/content/Context;");
- const jobject contextObject = Env->CallObjectMethod((jobject)_data.applicationContext, getApplicationContextMethod);
- const jmethodID getApplicationInfoMethod =
- Env->GetMethodID(contextClass, "getApplicationInfo", "()Landroid/content/pm/ApplicationInfo;");
- const jobject applicationInfoObject = Env->CallObjectMethod(contextObject, getApplicationInfoMethod);
- const jfieldID nativeLibraryDirField =
- Env->GetFieldID(Env->GetObjectClass(applicationInfoObject), "nativeLibraryDir", "Ljava/lang/String;");
- const jobject nativeLibraryDirObject = Env->GetObjectField(applicationInfoObject, nativeLibraryDirField);
- const jmethodID getBytesMethod =
- Env->GetMethodID(Env->GetObjectClass(nativeLibraryDirObject), "getBytes", "(Ljava/lang/String;)[B");
- const auto bytesObject =
- static_cast<jbyteArray>(Env->CallObjectMethod(nativeLibraryDirObject, getBytesMethod, Env->NewStringUTF("UTF-8")));
- const size_t length = Env->GetArrayLength(bytesObject);
- const jbyte* const bytes = Env->GetByteArrayElements(bytesObject, nullptr);
- _native_library_path = std::string(reinterpret_cast<const char*>(bytes), length);
+ jni::init(static_cast<jni::JavaVM*>(_data.applicationVM));
+ const jni::Object context = jni::Object{static_cast<jni::jobject>(_data.applicationContext)};
+
+ // Retrieve a reference to the Android AssetManager.
+ const auto assetManager = context.call<jni::Object>("getAssets()Landroid/content/res/AssetManager;");
+ _android_asset_manager = AAssetManager_fromJava(jni::env(), assetManager.getHandle());
+
+ // Retrieve the path to the native libraries.
+ const auto applicationContext = context.call<jni::Object>("getApplicationContext()Landroid/content/Context;");
+ const auto applicationInfo = context.call<jni::Object>("getApplicationInfo()Landroid/content/pm/ApplicationInfo;");
+ _native_library_path = applicationInfo.get<std::string>("nativeLibraryDir");
+
_initialized = true;
return XR_SUCCESS;
}
diff --git a/thirdparty/openxr/src/loader/xr_generated_loader.cpp b/thirdparty/openxr/src/loader/xr_generated_loader.cpp
index e7767fd30a..8c79afddc5 100644
--- a/thirdparty/openxr/src/loader/xr_generated_loader.cpp
+++ b/thirdparty/openxr/src/loader/xr_generated_loader.cpp
@@ -36,7 +36,7 @@
#include "loader_logger.hpp"
#include "loader_platform.hpp"
#include "runtime_interface.hpp"
-#include "xr_generated_dispatch_table.h"
+#include "xr_generated_dispatch_table_core.h"
#include "xr_dependencies.h"
#include <openxr/openxr.h>
diff --git a/thirdparty/openxr/src/xr_generated_dispatch_table.c b/thirdparty/openxr/src/xr_generated_dispatch_table.c
index 302bed31f5..6e43a29724 100644
--- a/thirdparty/openxr/src/xr_generated_dispatch_table.c
+++ b/thirdparty/openxr/src/xr_generated_dispatch_table.c
@@ -1,7 +1,9 @@
// Copyright (c) 2017-2023, The Khronos Group Inc.
-// Copyright (c) 2017-2019 Valve Corporation
-// Copyright (c) 2017-2019 LunarG, Inc.
+// Copyright (c) 2017-2019, Valve Corporation
+// Copyright (c) 2017-2019, LunarG, Inc.
+
// SPDX-License-Identifier: Apache-2.0 OR MIT
+
// *********** THIS FILE IS GENERATED - DO NOT EDIT ***********
// See utility_source_generator.py for modifications
// ************************************************************
@@ -29,9 +31,6 @@
#include <time.h>
#include "xr_generated_dispatch_table.h"
-#include "xr_dependencies.h"
-#include <openxr/openxr.h>
-#include <openxr/openxr_platform.h>
#ifdef __cplusplus
@@ -404,6 +403,9 @@ void GeneratedXrPopulateDispatchTable(struct XrGeneratedDispatchTable *table,
// ---- XR_FB_haptic_pcm extension commands
(get_inst_proc_addr(instance, "xrGetDeviceSampleRateFB", (PFN_xrVoidFunction*)&table->GetDeviceSampleRateFB));
+ // ---- XR_META_passthrough_preferences extension commands
+ (get_inst_proc_addr(instance, "xrGetPassthroughPreferencesMETA", (PFN_xrVoidFunction*)&table->GetPassthroughPreferencesMETA));
+
// ---- XR_META_virtual_keyboard extension commands
(get_inst_proc_addr(instance, "xrCreateVirtualKeyboardMETA", (PFN_xrVoidFunction*)&table->CreateVirtualKeyboardMETA));
(get_inst_proc_addr(instance, "xrDestroyVirtualKeyboardMETA", (PFN_xrVoidFunction*)&table->DestroyVirtualKeyboardMETA));
diff --git a/thirdparty/openxr/src/xr_generated_dispatch_table.h b/thirdparty/openxr/src/xr_generated_dispatch_table.h
index b6e17f98d4..a385f81906 100644
--- a/thirdparty/openxr/src/xr_generated_dispatch_table.h
+++ b/thirdparty/openxr/src/xr_generated_dispatch_table.h
@@ -1,7 +1,9 @@
// Copyright (c) 2017-2023, The Khronos Group Inc.
-// Copyright (c) 2017-2019 Valve Corporation
-// Copyright (c) 2017-2019 LunarG, Inc.
+// Copyright (c) 2017-2019, Valve Corporation
+// Copyright (c) 2017-2019, LunarG, Inc.
+
// SPDX-License-Identifier: Apache-2.0 OR MIT
+
// *********** THIS FILE IS GENERATED - DO NOT EDIT ***********
// See utility_source_generator.py for modifications
// ************************************************************
@@ -28,6 +30,7 @@
//
#pragma once
+
#include "xr_dependencies.h"
#include <openxr/openxr.h>
#include <openxr/openxr_platform.h>
@@ -406,6 +409,9 @@ struct XrGeneratedDispatchTable {
// ---- XR_FB_haptic_pcm extension commands
PFN_xrGetDeviceSampleRateFB GetDeviceSampleRateFB;
+ // ---- XR_META_passthrough_preferences extension commands
+ PFN_xrGetPassthroughPreferencesMETA GetPassthroughPreferencesMETA;
+
// ---- XR_META_virtual_keyboard extension commands
PFN_xrCreateVirtualKeyboardMETA CreateVirtualKeyboardMETA;
PFN_xrDestroyVirtualKeyboardMETA DestroyVirtualKeyboardMETA;
diff --git a/thirdparty/openxr/src/xr_generated_dispatch_table_core.c b/thirdparty/openxr/src/xr_generated_dispatch_table_core.c
new file mode 100644
index 0000000000..b3f34e68a9
--- /dev/null
+++ b/thirdparty/openxr/src/xr_generated_dispatch_table_core.c
@@ -0,0 +1,112 @@
+// Copyright (c) 2017-2023, The Khronos Group Inc.
+// Copyright (c) 2017-2019, Valve Corporation
+// Copyright (c) 2017-2019, LunarG, Inc.
+
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// *********** THIS FILE IS GENERATED - DO NOT EDIT ***********
+// See utility_source_generator.py for modifications
+// ************************************************************
+
+// Copyright (c) 2017-2023, The Khronos Group Inc.
+// Copyright (c) 2017-2019 Valve Corporation
+// Copyright (c) 2017-2019 LunarG, 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Mark Young <marky@lunarg.com>
+//
+
+#include "xr_generated_dispatch_table_core.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+// Helper function to populate an instance dispatch table
+void GeneratedXrPopulateDispatchTable(struct XrGeneratedDispatchTable *table,
+ XrInstance instance,
+ PFN_xrGetInstanceProcAddr get_inst_proc_addr) {
+
+ // ---- Core 1.0 commands
+ table->GetInstanceProcAddr = get_inst_proc_addr;
+ (get_inst_proc_addr(instance, "xrCreateInstance", (PFN_xrVoidFunction*)&table->CreateInstance));
+ (get_inst_proc_addr(instance, "xrDestroyInstance", (PFN_xrVoidFunction*)&table->DestroyInstance));
+ (get_inst_proc_addr(instance, "xrGetInstanceProperties", (PFN_xrVoidFunction*)&table->GetInstanceProperties));
+ (get_inst_proc_addr(instance, "xrPollEvent", (PFN_xrVoidFunction*)&table->PollEvent));
+ (get_inst_proc_addr(instance, "xrResultToString", (PFN_xrVoidFunction*)&table->ResultToString));
+ (get_inst_proc_addr(instance, "xrStructureTypeToString", (PFN_xrVoidFunction*)&table->StructureTypeToString));
+ (get_inst_proc_addr(instance, "xrGetSystem", (PFN_xrVoidFunction*)&table->GetSystem));
+ (get_inst_proc_addr(instance, "xrGetSystemProperties", (PFN_xrVoidFunction*)&table->GetSystemProperties));
+ (get_inst_proc_addr(instance, "xrEnumerateEnvironmentBlendModes", (PFN_xrVoidFunction*)&table->EnumerateEnvironmentBlendModes));
+ (get_inst_proc_addr(instance, "xrCreateSession", (PFN_xrVoidFunction*)&table->CreateSession));
+ (get_inst_proc_addr(instance, "xrDestroySession", (PFN_xrVoidFunction*)&table->DestroySession));
+ (get_inst_proc_addr(instance, "xrEnumerateReferenceSpaces", (PFN_xrVoidFunction*)&table->EnumerateReferenceSpaces));
+ (get_inst_proc_addr(instance, "xrCreateReferenceSpace", (PFN_xrVoidFunction*)&table->CreateReferenceSpace));
+ (get_inst_proc_addr(instance, "xrGetReferenceSpaceBoundsRect", (PFN_xrVoidFunction*)&table->GetReferenceSpaceBoundsRect));
+ (get_inst_proc_addr(instance, "xrCreateActionSpace", (PFN_xrVoidFunction*)&table->CreateActionSpace));
+ (get_inst_proc_addr(instance, "xrLocateSpace", (PFN_xrVoidFunction*)&table->LocateSpace));
+ (get_inst_proc_addr(instance, "xrDestroySpace", (PFN_xrVoidFunction*)&table->DestroySpace));
+ (get_inst_proc_addr(instance, "xrEnumerateViewConfigurations", (PFN_xrVoidFunction*)&table->EnumerateViewConfigurations));
+ (get_inst_proc_addr(instance, "xrGetViewConfigurationProperties", (PFN_xrVoidFunction*)&table->GetViewConfigurationProperties));
+ (get_inst_proc_addr(instance, "xrEnumerateViewConfigurationViews", (PFN_xrVoidFunction*)&table->EnumerateViewConfigurationViews));
+ (get_inst_proc_addr(instance, "xrEnumerateSwapchainFormats", (PFN_xrVoidFunction*)&table->EnumerateSwapchainFormats));
+ (get_inst_proc_addr(instance, "xrCreateSwapchain", (PFN_xrVoidFunction*)&table->CreateSwapchain));
+ (get_inst_proc_addr(instance, "xrDestroySwapchain", (PFN_xrVoidFunction*)&table->DestroySwapchain));
+ (get_inst_proc_addr(instance, "xrEnumerateSwapchainImages", (PFN_xrVoidFunction*)&table->EnumerateSwapchainImages));
+ (get_inst_proc_addr(instance, "xrAcquireSwapchainImage", (PFN_xrVoidFunction*)&table->AcquireSwapchainImage));
+ (get_inst_proc_addr(instance, "xrWaitSwapchainImage", (PFN_xrVoidFunction*)&table->WaitSwapchainImage));
+ (get_inst_proc_addr(instance, "xrReleaseSwapchainImage", (PFN_xrVoidFunction*)&table->ReleaseSwapchainImage));
+ (get_inst_proc_addr(instance, "xrBeginSession", (PFN_xrVoidFunction*)&table->BeginSession));
+ (get_inst_proc_addr(instance, "xrEndSession", (PFN_xrVoidFunction*)&table->EndSession));
+ (get_inst_proc_addr(instance, "xrRequestExitSession", (PFN_xrVoidFunction*)&table->RequestExitSession));
+ (get_inst_proc_addr(instance, "xrWaitFrame", (PFN_xrVoidFunction*)&table->WaitFrame));
+ (get_inst_proc_addr(instance, "xrBeginFrame", (PFN_xrVoidFunction*)&table->BeginFrame));
+ (get_inst_proc_addr(instance, "xrEndFrame", (PFN_xrVoidFunction*)&table->EndFrame));
+ (get_inst_proc_addr(instance, "xrLocateViews", (PFN_xrVoidFunction*)&table->LocateViews));
+ (get_inst_proc_addr(instance, "xrStringToPath", (PFN_xrVoidFunction*)&table->StringToPath));
+ (get_inst_proc_addr(instance, "xrPathToString", (PFN_xrVoidFunction*)&table->PathToString));
+ (get_inst_proc_addr(instance, "xrCreateActionSet", (PFN_xrVoidFunction*)&table->CreateActionSet));
+ (get_inst_proc_addr(instance, "xrDestroyActionSet", (PFN_xrVoidFunction*)&table->DestroyActionSet));
+ (get_inst_proc_addr(instance, "xrCreateAction", (PFN_xrVoidFunction*)&table->CreateAction));
+ (get_inst_proc_addr(instance, "xrDestroyAction", (PFN_xrVoidFunction*)&table->DestroyAction));
+ (get_inst_proc_addr(instance, "xrSuggestInteractionProfileBindings", (PFN_xrVoidFunction*)&table->SuggestInteractionProfileBindings));
+ (get_inst_proc_addr(instance, "xrAttachSessionActionSets", (PFN_xrVoidFunction*)&table->AttachSessionActionSets));
+ (get_inst_proc_addr(instance, "xrGetCurrentInteractionProfile", (PFN_xrVoidFunction*)&table->GetCurrentInteractionProfile));
+ (get_inst_proc_addr(instance, "xrGetActionStateBoolean", (PFN_xrVoidFunction*)&table->GetActionStateBoolean));
+ (get_inst_proc_addr(instance, "xrGetActionStateFloat", (PFN_xrVoidFunction*)&table->GetActionStateFloat));
+ (get_inst_proc_addr(instance, "xrGetActionStateVector2f", (PFN_xrVoidFunction*)&table->GetActionStateVector2f));
+ (get_inst_proc_addr(instance, "xrGetActionStatePose", (PFN_xrVoidFunction*)&table->GetActionStatePose));
+ (get_inst_proc_addr(instance, "xrSyncActions", (PFN_xrVoidFunction*)&table->SyncActions));
+ (get_inst_proc_addr(instance, "xrEnumerateBoundSourcesForAction", (PFN_xrVoidFunction*)&table->EnumerateBoundSourcesForAction));
+ (get_inst_proc_addr(instance, "xrGetInputSourceLocalizedName", (PFN_xrVoidFunction*)&table->GetInputSourceLocalizedName));
+ (get_inst_proc_addr(instance, "xrApplyHapticFeedback", (PFN_xrVoidFunction*)&table->ApplyHapticFeedback));
+ (get_inst_proc_addr(instance, "xrStopHapticFeedback", (PFN_xrVoidFunction*)&table->StopHapticFeedback));
+
+ // ---- XR_EXT_debug_utils extension commands
+ (get_inst_proc_addr(instance, "xrSetDebugUtilsObjectNameEXT", (PFN_xrVoidFunction*)&table->SetDebugUtilsObjectNameEXT));
+ (get_inst_proc_addr(instance, "xrCreateDebugUtilsMessengerEXT", (PFN_xrVoidFunction*)&table->CreateDebugUtilsMessengerEXT));
+ (get_inst_proc_addr(instance, "xrDestroyDebugUtilsMessengerEXT", (PFN_xrVoidFunction*)&table->DestroyDebugUtilsMessengerEXT));
+ (get_inst_proc_addr(instance, "xrSubmitDebugUtilsMessageEXT", (PFN_xrVoidFunction*)&table->SubmitDebugUtilsMessageEXT));
+ (get_inst_proc_addr(instance, "xrSessionBeginDebugUtilsLabelRegionEXT", (PFN_xrVoidFunction*)&table->SessionBeginDebugUtilsLabelRegionEXT));
+ (get_inst_proc_addr(instance, "xrSessionEndDebugUtilsLabelRegionEXT", (PFN_xrVoidFunction*)&table->SessionEndDebugUtilsLabelRegionEXT));
+ (get_inst_proc_addr(instance, "xrSessionInsertDebugUtilsLabelEXT", (PFN_xrVoidFunction*)&table->SessionInsertDebugUtilsLabelEXT));
+}
+
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
diff --git a/thirdparty/openxr/src/xr_generated_dispatch_table_core.h b/thirdparty/openxr/src/xr_generated_dispatch_table_core.h
new file mode 100644
index 0000000000..0f3e7e0502
--- /dev/null
+++ b/thirdparty/openxr/src/xr_generated_dispatch_table_core.h
@@ -0,0 +1,119 @@
+// Copyright (c) 2017-2023, The Khronos Group Inc.
+// Copyright (c) 2017-2019, Valve Corporation
+// Copyright (c) 2017-2019, LunarG, Inc.
+
+// SPDX-License-Identifier: Apache-2.0 OR MIT
+
+// *********** THIS FILE IS GENERATED - DO NOT EDIT ***********
+// See utility_source_generator.py for modifications
+// ************************************************************
+
+// Copyright (c) 2017-2023, The Khronos Group Inc.
+// Copyright (c) 2017-2019 Valve Corporation
+// Copyright (c) 2017-2019 LunarG, 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Author: Mark Young <marky@lunarg.com>
+//
+
+#pragma once
+
+#include <openxr/openxr.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+// Generated dispatch table
+struct XrGeneratedDispatchTable {
+
+ // ---- Core 1.0 commands
+ PFN_xrGetInstanceProcAddr GetInstanceProcAddr;
+ PFN_xrEnumerateApiLayerProperties EnumerateApiLayerProperties;
+ PFN_xrEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
+ PFN_xrCreateInstance CreateInstance;
+ PFN_xrDestroyInstance DestroyInstance;
+ PFN_xrGetInstanceProperties GetInstanceProperties;
+ PFN_xrPollEvent PollEvent;
+ PFN_xrResultToString ResultToString;
+ PFN_xrStructureTypeToString StructureTypeToString;
+ PFN_xrGetSystem GetSystem;
+ PFN_xrGetSystemProperties GetSystemProperties;
+ PFN_xrEnumerateEnvironmentBlendModes EnumerateEnvironmentBlendModes;
+ PFN_xrCreateSession CreateSession;
+ PFN_xrDestroySession DestroySession;
+ PFN_xrEnumerateReferenceSpaces EnumerateReferenceSpaces;
+ PFN_xrCreateReferenceSpace CreateReferenceSpace;
+ PFN_xrGetReferenceSpaceBoundsRect GetReferenceSpaceBoundsRect;
+ PFN_xrCreateActionSpace CreateActionSpace;
+ PFN_xrLocateSpace LocateSpace;
+ PFN_xrDestroySpace DestroySpace;
+ PFN_xrEnumerateViewConfigurations EnumerateViewConfigurations;
+ PFN_xrGetViewConfigurationProperties GetViewConfigurationProperties;
+ PFN_xrEnumerateViewConfigurationViews EnumerateViewConfigurationViews;
+ PFN_xrEnumerateSwapchainFormats EnumerateSwapchainFormats;
+ PFN_xrCreateSwapchain CreateSwapchain;
+ PFN_xrDestroySwapchain DestroySwapchain;
+ PFN_xrEnumerateSwapchainImages EnumerateSwapchainImages;
+ PFN_xrAcquireSwapchainImage AcquireSwapchainImage;
+ PFN_xrWaitSwapchainImage WaitSwapchainImage;
+ PFN_xrReleaseSwapchainImage ReleaseSwapchainImage;
+ PFN_xrBeginSession BeginSession;
+ PFN_xrEndSession EndSession;
+ PFN_xrRequestExitSession RequestExitSession;
+ PFN_xrWaitFrame WaitFrame;
+ PFN_xrBeginFrame BeginFrame;
+ PFN_xrEndFrame EndFrame;
+ PFN_xrLocateViews LocateViews;
+ PFN_xrStringToPath StringToPath;
+ PFN_xrPathToString PathToString;
+ PFN_xrCreateActionSet CreateActionSet;
+ PFN_xrDestroyActionSet DestroyActionSet;
+ PFN_xrCreateAction CreateAction;
+ PFN_xrDestroyAction DestroyAction;
+ PFN_xrSuggestInteractionProfileBindings SuggestInteractionProfileBindings;
+ PFN_xrAttachSessionActionSets AttachSessionActionSets;
+ PFN_xrGetCurrentInteractionProfile GetCurrentInteractionProfile;
+ PFN_xrGetActionStateBoolean GetActionStateBoolean;
+ PFN_xrGetActionStateFloat GetActionStateFloat;
+ PFN_xrGetActionStateVector2f GetActionStateVector2f;
+ PFN_xrGetActionStatePose GetActionStatePose;
+ PFN_xrSyncActions SyncActions;
+ PFN_xrEnumerateBoundSourcesForAction EnumerateBoundSourcesForAction;
+ PFN_xrGetInputSourceLocalizedName GetInputSourceLocalizedName;
+ PFN_xrApplyHapticFeedback ApplyHapticFeedback;
+ PFN_xrStopHapticFeedback StopHapticFeedback;
+
+ // ---- XR_EXT_debug_utils extension commands
+ PFN_xrSetDebugUtilsObjectNameEXT SetDebugUtilsObjectNameEXT;
+ PFN_xrCreateDebugUtilsMessengerEXT CreateDebugUtilsMessengerEXT;
+ PFN_xrDestroyDebugUtilsMessengerEXT DestroyDebugUtilsMessengerEXT;
+ PFN_xrSubmitDebugUtilsMessageEXT SubmitDebugUtilsMessageEXT;
+ PFN_xrSessionBeginDebugUtilsLabelRegionEXT SessionBeginDebugUtilsLabelRegionEXT;
+ PFN_xrSessionEndDebugUtilsLabelRegionEXT SessionEndDebugUtilsLabelRegionEXT;
+ PFN_xrSessionInsertDebugUtilsLabelEXT SessionInsertDebugUtilsLabelEXT;
+};
+
+
+// Prototype for dispatch table helper function
+void GeneratedXrPopulateDispatchTable(struct XrGeneratedDispatchTable *table,
+ XrInstance instance,
+ PFN_xrGetInstanceProcAddr get_inst_proc_addr);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+