apply_lowerings

Function apply_lowerings 

Source
fn apply_lowerings(src: &str) -> String
Expand description

Collect every “WGSL-output” lowering edit against a single parse of src, then apply them in one pass. Splitting these across separate pipeline steps would corrupt the second step: once the first emits var name: array<…> (or var i: i32), the source is no longer valid HLSL and a fresh parse_hlsl call returns Err, silently skipping the later passes. The for-int init rewrite once turned that latent hazard into a real regression on the Stahlregen + suksma dotes pair (the for-int rewrite ran first, then lower_array_globals couldn’t re-parse). The combined pass below avoids the order trap.