diff --git a/naga/src/back/msl/writer.rs b/naga/src/back/msl/writer.rs index 83d937d486..19e56a8a6e 100644 --- a/naga/src/back/msl/writer.rs +++ b/naga/src/back/msl/writer.rs @@ -803,14 +803,21 @@ impl Writer { } self.loop_reachable_macro_name = self.namer.call("LOOP_IS_REACHABLE"); - let loop_reachable_volatile_name = self.namer.call("unpredictable_jump_over_loop"); - writeln!( - self.out, - "#define {} if (volatile bool {} = true; {})", - self.loop_reachable_macro_name, - loop_reachable_volatile_name, - loop_reachable_volatile_name, - )?; + #[cfg(target_arch = "wasm32")] + { + let loop_reachable_volatile_name = self.namer.call("unpredictable_jump_over_loop"); + writeln!( + self.out, + "#define {} if (volatile bool {} = true; {})", + self.loop_reachable_macro_name, + loop_reachable_volatile_name, + loop_reachable_volatile_name, + )?; + } + #[cfg(not(target_arch = "wasm32"))] + { + writeln!(self.out, "#define {}", self.loop_reachable_macro_name,)?; + } Ok(()) }