Merge pull request #94550 from dsnopek/openxr-passthrough-project-settings

OpenXR: Fix enabling passthrough via environment blend mode in project settings
This commit is contained in:
Rémi Verschelde 2024-07-22 14:12:56 +02:00
commit 4be1529049
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 7 additions and 7 deletions

View File

@ -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;
}