Make per-target shader baking reproducible
In per-target compilation mode bake() generates a separate SPIR-V binary
for each requested target, and then has to pick one of them to generate
the single QShaderDescription of the resulting QShader from. That pick
was the first element of a QHash, and so depended on the per-process
randomized QHash seed: invoking qsb twice with the very same arguments
could produce .qsb files that differ in their reflection info. That in
turn defeats reproducible builds and content-addressed build caches.
Use ordered maps instead. As a bonus this makes the choice a sensible
one, not merely a stable one: QShader::SpirvShader is the first Source
enum value, hence the reflection info now always comes from the plain
SPIR-V target whenever one was requested (which qsb always does).
Note that when a shader declares its resources differently depending on
the QSHADER_SPIRV/GLSL/HLSL/MSL macros, the reflection info can only
ever be correct for one of the targets. Nothing to do about that, given
that a QShader has one QShaderDescription, but at least the result is
now consistent between runs.
Pick-to: 6.12
Change-Id: Ieb95afe4d243cc6d6572a8beae72cc0bc3faab05
Reviewed-by: Andy Nichols <andy.nichols@qt.io>