summaryrefslogtreecommitdiffstats
path: root/modules/openxr/openxr_api.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-02-03 23:19:24 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-02-03 23:19:24 +0100
commit673f1614c4def695df28e0e2dc2efba785ef0ad2 (patch)
tree3f4a07e4b95449e3a6b5fd9a2b783329b32b2345 /modules/openxr/openxr_api.cpp
parent04650278789bfd23ec0f01755f96e5c02883a291 (diff)
parente74a0f4b0986bb6054e4ebad05fb793f64a105e1 (diff)
downloadredot-engine-673f1614c4def695df28e0e2dc2efba785ef0ad2.tar.gz
Merge pull request #87630 from dsnopek/openxr-passthrough-from-gdextension
OpenXR: Allow moving vendor passthrough extensions to GDExtension
Diffstat (limited to 'modules/openxr/openxr_api.cpp')
-rw-r--r--modules/openxr/openxr_api.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp
index 491a419525..80ddfe703f 100644
--- a/modules/openxr/openxr_api.cpp
+++ b/modules/openxr/openxr_api.cpp
@@ -56,7 +56,6 @@
#include "extensions/openxr_composition_layer_depth_extension.h"
#include "extensions/openxr_fb_display_refresh_rate_extension.h"
#include "extensions/openxr_fb_foveation_extension.h"
-#include "extensions/openxr_fb_passthrough_extension_wrapper.h"
#include "extensions/openxr_fb_update_swapchain_extension.h"
#ifdef ANDROID_ENABLED
@@ -3122,11 +3121,30 @@ bool OpenXRAPI::is_environment_blend_mode_supported(XrEnvironmentBlendMode p_ble
}
bool OpenXRAPI::set_environment_blend_mode(XrEnvironmentBlendMode p_blend_mode) {
+ if (emulate_environment_blend_mode_alpha_blend && p_blend_mode == XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND) {
+ requested_environment_blend_mode = XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND;
+ environment_blend_mode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE;
+ return true;
+ }
// We allow setting this when not initialized and will check if it is supported when initializing.
// After OpenXR is initialized we verify we're setting a supported blend mode.
- if (!is_initialized() || is_environment_blend_mode_supported(p_blend_mode)) {
+ else if (!is_initialized() || is_environment_blend_mode_supported(p_blend_mode)) {
+ requested_environment_blend_mode = p_blend_mode;
environment_blend_mode = p_blend_mode;
return true;
}
return false;
}
+
+void OpenXRAPI::set_emulate_environment_blend_mode_alpha_blend(bool p_enabled) {
+ emulate_environment_blend_mode_alpha_blend = p_enabled;
+}
+
+OpenXRAPI::OpenXRAlphaBlendModeSupport OpenXRAPI::is_environment_blend_mode_alpha_blend_supported() {
+ if (is_environment_blend_mode_supported(XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND)) {
+ return OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL;
+ } else if (emulate_environment_blend_mode_alpha_blend) {
+ return OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING;
+ }
+ return OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE;
+}