visionOS: Set an explicit depth range for the compositor layer
The depth range was taken from the compositor's default and handed to
the eye cameras as is. The default is not documented, and the far plane
it reports is infinite; this is what visionOS 27 reports, and the same
has been reported for visionOS 1.0, so we have most likely been running
with an infinite far plane all along. The projection matrix can
represent that, but Quick3D also uses the clip distances as plain
values, for shadow cascades, fog and depth linearization among others,
and all of those break down with an infinite far plane.
Sanitize the range the compositor reports, falling back to the defaults
used by the OpenXR backend, and set the resulting range explicitly on
the layer configuration so that the drawables report the same finite
values. The per-frame range read from the drawable is sanitized the same
way and, if it needed fixing up, written back on the drawable before the
projection is computed, as the projection is built from the drawable's
own range and would otherwise disagree with the clip distances the
cameras get.
Note that the range is in Quick3D scene units, i.e. centimeters, and not
in the meters the CompositorServices API nominally expects. That is not
a change in behavior, and it works out because the eye transforms are
scaled to centimeters as well, but it is now spelled out in a comment.
Pick-to: 6.12
Change-Id: I6565efd05676f82e4e56999de9a1eda1952c646a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>