summaryrefslogtreecommitdiffstats
path: root/modules/openxr
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-07-19 16:20:01 -0500
committerDavid Snopek <dsnopek@gmail.com>2024-07-19 19:04:51 -0500
commit22a6303fa06f82ade4154b6001bac36e09740f3e (patch)
tree6982e342da3fc9251f883e849f75c45026083ce0 /modules/openxr
parentf135f729b91e61e6844159a535a7474335ec8d52 (diff)
downloadredot-engine-22a6303fa06f82ade4154b6001bac36e09740f3e.tar.gz
OpenXR: Fix enabling passthrough via environment blend mode in project settings
Diffstat (limited to 'modules/openxr')
-rw-r--r--modules/openxr/openxr_api.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp
index 04edde8300..98e5484157 100644
--- a/modules/openxr/openxr_api.cpp
+++ b/modules/openxr/openxr_api.cpp
@@ -707,13 +707,6 @@ bool OpenXRAPI::load_supported_environmental_blend_modes() {
print_verbose(String("OpenXR: Found environmental blend mode ") + OpenXRUtil::get_environment_blend_mode_name(supported_environment_blend_modes[i]));
}
- // Check value we loaded at startup...
- if (!is_environment_blend_mode_supported(environment_blend_mode)) {
- print_verbose(String("OpenXR: ") + OpenXRUtil::get_environment_blend_mode_name(environment_blend_mode) + String(" isn't supported, defaulting to ") + OpenXRUtil::get_environment_blend_mode_name(supported_environment_blend_modes[0]));
-
- environment_blend_mode = supported_environment_blend_modes[0];
- }
-
return true;
}
@@ -837,6 +830,13 @@ bool OpenXRAPI::create_session() {
wrapper->on_session_created(session);
}
+ // Check our environment blend mode. This needs to happen after we call `on_session_created()`
+ // on the extension wrappers, so they can emulate alpha blend mode.
+ if (!set_environment_blend_mode(environment_blend_mode)) {
+ print_verbose(String("OpenXR: ") + OpenXRUtil::get_environment_blend_mode_name(environment_blend_mode) + String(" isn't supported, defaulting to ") + OpenXRUtil::get_environment_blend_mode_name(supported_environment_blend_modes[0]));
+ set_environment_blend_mode(supported_environment_blend_modes[0]);
+ }
+
return true;
}