Skip to content

Commit

Permalink
Update writer.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rudderbucky committed Nov 11, 2024
1 parent 6a60458 commit 7561726
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions naga/src/back/msl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -803,14 +803,21 @@ impl<W: Write> Writer<W> {
}

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(())
}
Expand Down

0 comments on commit 7561726

Please sign in to comment.