Skip to content

Commit 59e83a5

Browse files
committed
OpenXR: Fix building with vulkan=no
1 parent f5918a9 commit 59e83a5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/openxr/extensions/openxr_fb_foveation_extension.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ OpenXRFBFoveationExtension::OpenXRFBFoveationExtension(const String &p_rendering
6363
meta_foveation_eye_tracked_properties.next = nullptr;
6464
meta_foveation_eye_tracked_properties.supportsFoveationEyeTracked = XR_FALSE;
6565

66+
#ifdef VULKAN_ENABLED
6667
meta_vulkan_swapchain_create_info.type = XR_TYPE_VULKAN_SWAPCHAIN_CREATE_INFO_META;
6768
meta_vulkan_swapchain_create_info.next = nullptr;
6869
meta_vulkan_swapchain_create_info.additionalCreateFlags = VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM;
6970
meta_vulkan_swapchain_create_info.additionalUsageFlags = 0;
71+
#endif
7072

7173
if (rendering_driver == "opengl3") {
7274
swapchain_create_info_foveation_fb.flags = XR_SWAPCHAIN_CREATE_FOVEATION_SCALED_BIN_BIT_FB;
@@ -144,10 +146,12 @@ void *OpenXRFBFoveationExtension::set_swapchain_create_info_and_get_next_pointer
144146
swapchain_create_info_foveation_fb.next = next;
145147
next = &swapchain_create_info_foveation_fb;
146148

149+
#ifdef VULKAN_ENABLED
147150
if (meta_foveation_eye_tracked_ext && meta_vulkan_swapchain_create_info_ext && meta_foveation_eye_tracked_properties.supportsFoveationEyeTracked) {
148151
meta_vulkan_swapchain_create_info.next = next;
149152
next = &meta_vulkan_swapchain_create_info;
150153
}
154+
#endif
151155
}
152156

153157
return next;

modules/openxr/extensions/openxr_fb_foveation_extension.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ class OpenXRFBFoveationExtension : public OpenXRExtensionWrapper {
107107
// Enable eye tracked foveation
108108
XrSystemFoveationEyeTrackedPropertiesMETA meta_foveation_eye_tracked_properties;
109109
XrFoveationEyeTrackedProfileCreateInfoMETA meta_foveation_eye_tracked_create_info;
110+
#ifdef VULKAN_ENABLED
110111
XrVulkanSwapchainCreateInfoMETA meta_vulkan_swapchain_create_info;
112+
#endif
111113

112114
// OpenXR API call wrappers
113115
EXT_PROTO_XRRESULT_FUNC3(xrCreateFoveationProfileFB, (XrSession), session, (const XrFoveationProfileCreateInfoFB *), create_info, (XrFoveationProfileFB *), profile);

0 commit comments

Comments
 (0)