Make text rendering work with OpenGL 3.0 and 3.1
For OpenGL (non-ES), we require OpenGL 3.0 (GLSL 130) at minimum,
as reflected in the qc_add_shaders implementation. However, text
rendering relies on an OpenGL>=3.2 feature at the moment,
glDrawElementsBaseVertex.
Remedy this with a runtime feature check and branching: when not
supported, bake the base vertex (the value added to each index value)
in to the index buffer itself. Whereas in most cases we continue to
use the base vertex variant, so we do not have to manually offset the
index values and can just memcpy instead.
Add an autotest. The issue was in fact originally uncovered by
this autotest in the Qt CI, because Windows VMs use old Mesa
llvmpipe builds that provide OpenGL 3.0 only. Text rendering was
not functional there.
On a normal machine, the issue can be reproduced by running with
QT_OPENGL=software (in addition to requesting OpenGL), as long
as the pre-built opengl32sw.dll shipped with the official Qt
is present.
In addition, set EnableDebugMarkers on the QRhi only when
FRAME_CAPTURE is defined. The Android emulator in CI seems
to have problems with setting the Vulkan object names.
Fixes: QTBUG-143315
Pick-to: 6.11
Change-Id: I7337667ff26837e7551082cda41184069474b727
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>