Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

OpenXR: Fix composition layer fallback mesh not created without OpenXR

David Snopekb908bccb6f9e
diff --git a/modules/openxr/scene/openxr_composition_layer.cpp b/modules/openxr/scene/openxr_composition_layer.cpp
index 852eeabff81..85ac90d6ed4 100644
--- a/modules/openxr/scene/openxr_composition_layer.cpp
+++ b/modules/openxr/scene/openxr_composition_layer.cpp
@@ -266,8 +266,12 @@ void OpenXRCompositionLayer::_on_openxr_session_begun() {
if (_should_register()) {
_setup_composition_layer();
}
- if (!fallback && _should_use_fallback_node()) {
- _create_fallback_node();
+ if (_should_use_fallback_node()) {
+ if (!fallback) {
+ _create_fallback_node();
+ } else {
+ should_update_fallback_mesh = true;
+ }
}
}
@@ -716,6 +720,11 @@ void OpenXRCompositionLayer::_notification(int p_what) {
composition_layer_extension->composition_layer_set_extension_property_values(composition_layer, extension_property_values);
}
} break;
+ case NOTIFICATION_READY: {
+ if (!fallback && _should_use_fallback_node()) {
+ _create_fallback_node();
+ }
+ } break;
case NOTIFICATION_INTERNAL_PROCESS: {
if (fallback) {
if (should_update_fallback_mesh) {