Merge pull request #98471 from dsnopek/openxr-composition-layers-visibility-bug

Fix bug with OpenXR composition layers added after OpenXR is running
This commit is contained in:
Clay John 2024-10-24 18:45:23 -07:00 committed by GitHub
commit 7ebb3a4d68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,6 +56,10 @@ OpenXRCompositionLayer::OpenXRCompositionLayer(XrCompositionLayerBaseHeader *p_c
openxr_api = OpenXRAPI::get_singleton(); openxr_api = OpenXRAPI::get_singleton();
composition_layer_extension = OpenXRCompositionLayerExtension::get_singleton(); composition_layer_extension = OpenXRCompositionLayerExtension::get_singleton();
if (openxr_api) {
openxr_session_running = openxr_api->is_running();
}
Ref<OpenXRInterface> openxr_interface = XRServer::get_singleton()->find_interface("OpenXR"); Ref<OpenXRInterface> openxr_interface = XRServer::get_singleton()->find_interface("OpenXR");
if (openxr_interface.is_valid()) { if (openxr_interface.is_valid()) {
openxr_interface->connect("session_begun", callable_mp(this, &OpenXRCompositionLayer::_on_openxr_session_begun)); openxr_interface->connect("session_begun", callable_mp(this, &OpenXRCompositionLayer::_on_openxr_session_begun));