From 9f4db24ef4cf15d019ed2601aa6374bd1d1b28e4 Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Tue, 9 Dec 2025 15:51:56 +1100 Subject: [PATCH] OpenXR: only obtain xrCreateSwapchainAndroidSurfaceKHR pointer if extension is available --- .../openxr/extensions/openxr_composition_layer_extension.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/openxr/extensions/openxr_composition_layer_extension.cpp b/modules/openxr/extensions/openxr_composition_layer_extension.cpp index 26fb9723a13..23d0eb4cb88 100644 --- a/modules/openxr/extensions/openxr_composition_layer_extension.cpp +++ b/modules/openxr/extensions/openxr_composition_layer_extension.cpp @@ -72,7 +72,9 @@ HashMap OpenXRCompositionLayerExtension::get_requested_extension void OpenXRCompositionLayerExtension::on_instance_created(const XrInstance p_instance) { #ifdef ANDROID_ENABLED EXT_INIT_XR_FUNC(xrDestroySwapchain); - EXT_INIT_XR_FUNC(xrCreateSwapchainAndroidSurfaceKHR); + if (android_surface_ext_available) { + EXT_INIT_XR_FUNC(xrCreateSwapchainAndroidSurfaceKHR); + } #endif }