Quick answer: SPIR-V Cross emitted GLSL unrolling a [unroll(4)] loop only on NVIDIA, not AMD? Vendor compilers differ - hand-unroll critical loops or use explicit constant bounds.
Raymarch loop with [unroll(8)] runs as a loop on Radeon GPUs. PSO compile time spikes.
Hand-unroll
Write 8 lines instead of a loop. Compilers all unroll; portable.
Use constexpr-style bounds
Macro for the bound. Same value everywhere; compilers more likely to respect.
Verify with timing
Per-vendor performance test. Manual-unroll variant should be at parity.
“Compiler pragmas are hints. Hints get ignored.”
For hot shader code, audit per-vendor. Performance gaps are real; the audit closes them.