瀏覽代碼

Enable composition layer fallback in non-editor desktop player

Mauricio Narvaez 8 月之前
父節點
當前提交
18fd37d4a8
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/openxr/scene/openxr_composition_layer.cpp

+ 2 - 2
modules/openxr/scene/openxr_composition_layer.cpp

@@ -192,7 +192,7 @@ void OpenXRCompositionLayer::_bind_methods() {
 }
 }
 
 
 bool OpenXRCompositionLayer::_should_use_fallback_node() {
 bool OpenXRCompositionLayer::_should_use_fallback_node() {
-	if (Engine::get_singleton()->is_editor_hint()) {
+	if (Engine::get_singleton()->is_editor_hint() || openxr_api == nullptr) {
 		return true;
 		return true;
 	} else if (openxr_session_running) {
 	} else if (openxr_session_running) {
 		return enable_hole_punch || (!is_natively_supported() && !use_android_surface);
 		return enable_hole_punch || (!is_natively_supported() && !use_android_surface);
@@ -399,7 +399,7 @@ bool OpenXRCompositionLayer::get_alpha_blend() const {
 }
 }
 
 
 bool OpenXRCompositionLayer::is_natively_supported() const {
 bool OpenXRCompositionLayer::is_natively_supported() const {
-	if (composition_layer_extension) {
+	if (composition_layer_extension && openxr_api) {
 		return composition_layer_extension->is_available(openxr_layer_provider->get_openxr_type());
 		return composition_layer_extension->is_available(openxr_layer_provider->get_openxr_type());
 	}
 	}
 	return false;
 	return false;