st/oxr: handle unavailable bounds case in function

Only `XRT_SPACE_BOUNDS_UNAVAILABLE` should return `XR_SPACE_BOUNDS_UNAVAILABLE`
with the bounds set to 0.

Otherwise the function should return `XR_ERROR_REFERENCE_SPACE_UNSUPPORTED` if
the supplied `reference_space_type` is not supported or implemented.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2244>
This commit is contained in:
Simon Zeni 2024-06-11 11:29:14 -04:00 committed by Marge Bot
parent abc9461960
commit d7c1f7f138

View file

@ -175,7 +175,9 @@ oxr_space_get_reference_bounds_rect(struct oxr_logger *log,
enum xrt_reference_space_type reference_space_type = xr_ref_space_to_xrt(referenceSpaceType);
xrt_result_t xret = xrt_comp_get_reference_bounds_rect(xc, reference_space_type, (struct xrt_vec2 *)bounds);
if (xret == XRT_ERROR_COMPOSITOR_FUNCTION_NOT_IMPLEMENTED || xret == XRT_SPACE_BOUNDS_UNAVAILABLE) {
if (xret == XRT_SPACE_BOUNDS_UNAVAILABLE) {
// `bounds` must be set to 0 on XR_SPACE_BOUNDS_UNAVAILABLE
*bounds = (XrExtent2Df){0};
return XR_SPACE_BOUNDS_UNAVAILABLE;
}
OXR_CHECK_XRET(log, sess, xret, oxr_space_get_reference_bounds_rect);