Quick answer: SPIR-V validation rejecting a shader loop with 'cannot bound iteration count'? Validators require explicit iteration bounds for safety - use a compile-time max or LoopHint.
Raymarch loop has data-dependent termination. Validation: cannot determine iteration count.
Add explicit max bound
for (int i = 0; i < MAX_STEPS; i++) {
if (hit) break;
}Compile-time max bound satisfies validators while preserving the early-exit behavior.
Use loop_hint
HLSL: [loop][allow_uav_condition]. Tells the compiler the loop is intentional; bypasses some validators.
Profile loop max
MAX_STEPS = 64 may be too low for landscape shots, too high for close-ups. Tune per-content; not just compile.
“Shader loops are bounded by hardware. The bound has to be visible to validators.”
Build a small shader test that hits the max-step bound. If it's not visible (no shimmer), MAX_STEPS is fine; if it shimmers, raise it.