visionOS: Handle a layered layout with a single view
The visionOS 27 simulator reports the layered layout as supported, so
Qt enables multiview rendering and hands the viewport two eye cameras.
The simulator still delivers a single view, however, so the drawable
has a texture array with one slice and a view count of one. The render
target is then created without multiview and the shaders are generated
for a single view, while the camera data is uploaded for two views. This
was caught by the uniform size check in QSSGRhiContext:
ASSERT: Uniform block member 'qt_cameraPosition' got 32 bytes
whereas the true size is 12
Make the render target, the depth texture and the camera setup follow
the number of views the drawable holds per texture instead of the
configured layout. With the layered layout that is the drawable's view
count, with the dedicated layout it is one. A single view per texture is
rendered as a plain 2D target with one camera, which is what the
simulator used to get with the dedicated layout. The threading model and
the multiViewRenderingEnabled property still follow the configured
layout.
Pick-to: 6.12
Change-Id: Ie70ecac3e2d6994386c52ebf3ad09b26c089b51b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>