Commit 28a29f81 authored by Christoph Haag's avatar Christoph Haag
Browse files

st/oxr: Fix xrGetSystemProperties crash in headless mode

fixes #125

v2: Handle sys->xsysc being NULL
parent 4ff7fb74
......@@ -194,9 +194,14 @@ oxr_system_get_properties(struct oxr_logger *log, struct oxr_system *sys, XrSyst
snprintf(properties->systemName, XR_MAX_SYSTEM_NAME_SIZE, "Monado: %.*s", 247, xdev->str);
// Get from compositor.
struct xrt_system_compositor_info *info = &sys->xsysc->info;
struct xrt_system_compositor_info *info = sys->xsysc ? &sys->xsysc->info : NULL;
properties->graphicsProperties.maxLayerCount = info->max_layers;
if (info) {
properties->graphicsProperties.maxLayerCount = info->max_layers;
} else {
// probably using the headless extension, but the extension does not modify the 16 layer minimum.
properties->graphicsProperties.maxLayerCount = 16;
}
properties->graphicsProperties.maxSwapchainImageWidth = 1024 * 16;
properties->graphicsProperties.maxSwapchainImageHeight = 1024 * 16;
properties->trackingProperties.orientationTracking = xdev->orientation_tracking_supported;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment