The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: Fix xrGetSystemProperties crash in headless mode

fixes #125

v2: Handle sys->xsysc being NULL

+7 -2
+7 -2
src/xrt/state_trackers/oxr/oxr_system.c
··· 194 194 snprintf(properties->systemName, XR_MAX_SYSTEM_NAME_SIZE, "Monado: %.*s", 247, xdev->str); 195 195 196 196 // Get from compositor. 197 - struct xrt_system_compositor_info *info = &sys->xsysc->info; 197 + struct xrt_system_compositor_info *info = sys->xsysc ? &sys->xsysc->info : NULL; 198 198 199 - properties->graphicsProperties.maxLayerCount = info->max_layers; 199 + if (info) { 200 + properties->graphicsProperties.maxLayerCount = info->max_layers; 201 + } else { 202 + // probably using the headless extension, but the extension does not modify the 16 layer minimum. 203 + properties->graphicsProperties.maxLayerCount = 16; 204 + } 200 205 properties->graphicsProperties.maxSwapchainImageWidth = 1024 * 16; 201 206 properties->graphicsProperties.maxSwapchainImageHeight = 1024 * 16; 202 207 properties->trackingProperties.orientationTracking = xdev->orientation_tracking_supported;