c/main: Check xdev view_count early and add error message

This commit is contained in:
Christoph Haag 2024-03-17 22:32:28 +01:00
parent 06ff114a7d
commit b2c4134113

View file

@ -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);