mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
st/oxr: Tidy code
The CHECK_LAYER_TYPE tests would falsely pass on the IPC layer as it always implements all of the functions.
This commit is contained in:
parent
f326ec8fc3
commit
cb51b32ff1
|
@ -100,9 +100,9 @@ oxr_xrCreateInstance(const XrInstanceCreateInfo *createInfo, XrInstance *out_ins
|
|||
OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, createInfo, XR_TYPE_INSTANCE_CREATE_INFO);
|
||||
const uint32_t major = XR_VERSION_MAJOR(XR_CURRENT_API_VERSION);
|
||||
const uint32_t minor = XR_VERSION_MINOR(XR_CURRENT_API_VERSION);
|
||||
#if 0
|
||||
const uint32_t patch = XR_VERSION_PATCH(XR_CURRENT_API_VERSION);
|
||||
#endif
|
||||
(void)patch; // Not used for now.
|
||||
|
||||
|
||||
if (createInfo->applicationInfo.apiVersion < XR_MAKE_VERSION(major, minor, 0)) {
|
||||
return oxr_error(&log, XR_ERROR_API_VERSION_UNSUPPORTED,
|
||||
|
|
|
@ -1065,6 +1065,7 @@ oxr_action_cache_update(struct oxr_logger *log,
|
|||
break;
|
||||
}
|
||||
#if 0
|
||||
// Untested, we have no VEC3 input.
|
||||
case XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE: {
|
||||
changed = (combined.value.vec3.x != last.vec3.x) ||
|
||||
(combined.value.vec3.y != last.vec3.y) ||
|
||||
|
|
|
@ -311,42 +311,6 @@ oxr_instance_create(struct oxr_logger *log, const XrInstanceCreateInfo *createIn
|
|||
oxr_instance_destroy(log, &inst->handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Make sure that the compositor we were given can do all the
|
||||
// things the build config promised.
|
||||
#define CHECK_LAYER_TYPE(NAME, MEMBER_NAME) \
|
||||
do { \
|
||||
if (sys->xcn->base.MEMBER_NAME == NULL) { \
|
||||
ret = oxr_error(log, XR_ERROR_INITIALIZATION_FAILED, \
|
||||
"Logic error: build config " \
|
||||
"advertised support for " NAME \
|
||||
" but compositor does not " \
|
||||
"implement " #MEMBER_NAME); \
|
||||
oxr_instance_destroy(log, &inst->handle); \
|
||||
assert(false && "Build configured with unsupported layers"); \
|
||||
return ret; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// Keep this list in sync with types in xrt_config_build.h
|
||||
#ifdef XRT_FEATURE_OPENXR_LAYER_CUBE
|
||||
CHECK_LAYER_TYPE("cube layers", layer_cube);
|
||||
#endif
|
||||
#ifdef XRT_FEATURE_OPENXR_LAYER_CYLINDER
|
||||
CHECK_LAYER_TYPE("cylinder layers", layer_cylinder);
|
||||
#endif
|
||||
#ifdef XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||
CHECK_LAYER_TYPE("projection layers with depth images", layer_stereo_projection_depth);
|
||||
#endif
|
||||
#ifdef XRT_FEATURE_OPENXR_LAYER_EQUIRECT1
|
||||
CHECK_LAYER_TYPE("equirect1 layers", layer_equirect1);
|
||||
#endif
|
||||
#ifdef XRT_FEATURE_OPENXR_LAYER_EQUIRECT2
|
||||
CHECK_LAYER_TYPE("equirect2 layers", layer_equirect2);
|
||||
#endif
|
||||
#undef CHECK_LAYER_TYPE
|
||||
#endif
|
||||
}
|
||||
|
||||
ret = oxr_system_fill_in(log, inst, 1, &inst->system);
|
||||
|
|
|
@ -30,12 +30,14 @@ check_reference_space_type(struct oxr_logger *log, XrReferenceSpaceType type)
|
|||
switch (type) {
|
||||
case XR_REFERENCE_SPACE_TYPE_VIEW: return XR_SUCCESS;
|
||||
case XR_REFERENCE_SPACE_TYPE_LOCAL: return XR_SUCCESS;
|
||||
case XR_REFERENCE_SPACE_TYPE_STAGE: return XR_SUCCESS;
|
||||
#if 0
|
||||
case XR_REFERENCE_SPACE_TYPE_STAGE:
|
||||
// For now stage space is always supported.
|
||||
if (true) {
|
||||
return XR_SUCCESS;
|
||||
}
|
||||
return oxr_error(log, XR_ERROR_REFERENCE_SPACE_UNSUPPORTED,
|
||||
"(createInfo->referenceSpaceType = "
|
||||
"XR_REFERENCE_SPACE_TYPE_STAGE)");
|
||||
#endif
|
||||
"(createInfo->referenceSpaceType == XR_REFERENCE_SPACE_TYPE_STAGE)"
|
||||
" Stage space is unsupported on this device.");
|
||||
default:
|
||||
return oxr_error(log, XR_ERROR_REFERENCE_SPACE_UNSUPPORTED,
|
||||
"(createInfo->referenceSpaceType == 0x%08x)", type);
|
||||
|
|
Loading…
Reference in a new issue