From b2c41341130d758887e7c4dd72203075cd374677 Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Sun, 17 Mar 2024 22:32:28 +0100 Subject: [PATCH] c/main: Check xdev view_count early and add error message --- src/xrt/compositor/main/comp_compositor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c index da610e19c..53d176cc7 100644 --- a/src/xrt/compositor/main/comp_compositor.c +++ b/src/xrt/compositor/main/comp_compositor.c @@ -964,6 +964,11 @@ comp_main_create_system_compositor(struct xrt_device *xdev, COMP_DEBUG(c, "Doing init %p", (void *)c); + if (xdev->hmd->view_count == 0) { + U_LOG_E("Bug detected: HMD \"%s\" does not set xdev->hmd.view_count. Value must be > 0!", xdev->str); + assert(xdev->hmd->view_count > 0); + } + // Do this as early as possible. comp_base_init(&c->base);