The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: Verify that the compositor created can actually do the layer types claimed.

+34
+34
src/xrt/state_trackers/oxr/oxr_instance.c
··· 15 15 16 16 #include "xrt/xrt_instance.h" 17 17 #include "xrt/xrt_config_os.h" 18 + #include "xrt/xrt_config_build.h" 18 19 19 20 20 21 #ifdef XRT_OS_ANDROID ··· 349 350 oxr_instance_destroy(log, &inst->handle); 350 351 return ret; 351 352 } 353 + 354 + // Make sure that the compositor we were given can do all the 355 + // things the build config promised. 356 + #define CHECK_LAYER_TYPE(NAME, MEMBER_NAME) \ 357 + do { \ 358 + if (sys->xcn->base.MEMBER_NAME == NULL) { \ 359 + ret = oxr_error(log, XR_ERROR_INITIALIZATION_FAILED, \ 360 + "Logic error: build config " \ 361 + "advertised support for " NAME \ 362 + " but compositor does not " \ 363 + "implement " #MEMBER_NAME); \ 364 + oxr_instance_destroy(log, &inst->handle); \ 365 + assert(false && \ 366 + "Build configured with unsupported layers"); \ 367 + return ret; \ 368 + } \ 369 + } while (0) 370 + 371 + // Keep this list in sync with types in xrt_config_build.h 372 + #ifdef XRT_FEATURE_OPENXR_LAYER_CUBE 373 + CHECK_LAYER_TYPE("cube layers", layer_cube); 374 + #endif 375 + #ifdef XRT_FEATURE_OPENXR_LAYER_CYLINDER 376 + CHECK_LAYER_TYPE("cylinder layers", layer_cylinder); 377 + #endif 378 + #ifdef XRT_FEATURE_OPENXR_LAYER_DEPTH 379 + CHECK_LAYER_TYPE("projection layers with depth images", 380 + layer_stereo_projection_depth); 381 + #endif 382 + #ifdef XRT_FEATURE_OPENXR_LAYER_EQUIRECT 383 + CHECK_LAYER_TYPE("equirect layers", layer_equirect); 384 + #endif 385 + #undef CHECK_LAYER_TYPE 352 386 } 353 387 354 388 ret = oxr_system_fill_in(log, inst, 1, &inst->system);