Cache the envLightCount uniform id in updateLightUniforms
The last statement of RenderView::updateLightUniforms (OpenGL) and of
the environment light block in RenderView::setShaderAndUniforms (RHI)
looked up "envLightCount" through StringToInt::lookupId for every
render command of every frame. Every other id in those functions is
cached in a static; this one hashed a QString and took the shared lock
of the global StringToInt cache each time, from all the job threads.
Measured on an Apple M1 with Qt 6.11.2 and an application rendering
about 650 commands a frame: StringToInt::lookupId was 16-20% of the
process CPU in a Time Profiler trace, all of it from this call. With the
id cached it no longer shows in the profile, and the process used about
12% less CPU over the same 8 s workload.
Fixes: QTBUG-150764
Pick-to: 6.12 6.11 6.10
Change-Id: I719064e0092f7306c9b288ea10680c1ad2394f49
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>