mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
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:
parent
abc9461960
commit
d7c1f7f138
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue