Skip to content

Commit

Permalink
Merge pull request #94550 from dsnopek/openxr-passthrough-project-set…
Browse files Browse the repository at this point in the history
…tings

OpenXR: Fix enabling passthrough via environment blend mode in project settings
  • Loading branch information
akien-mga committed Jul 22, 2024
2 parents f640ba6 + 22a6303 commit 4be1529
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions modules/openxr/openxr_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 4be1529

Please sign in to comment.