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>
commit1372256f2364d8d2284b8ce8a275ce02f634b2fe
parent27690d535b2d3ef27e5d0efb005aeac11af96808
authorLaszlo Agocs <laszlo.agocs@qt.io>
committerLaszlo Agocs <laszlo.agocs@qt.io>
commit timeWed, 19 Aug 2026 09:32:34 +0000