mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-10-30 05:51:42 +00:00
Naga(msl): Clear named expressions after writing each function (#4594)
This appears to match other backends, and fixes fix the case where expressions which were named in earlier functions are used in local variable declarations
This commit is contained in:
parent
ea8b619ba4
commit
7709010a79
@ -44,11 +44,14 @@ For naga changelogs at or before v0.14.0. See [naga's changelog](naga/CHANGELOG.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
#### WGL
|
||||
|
||||
- Create a hidden window per `wgpu::Instance` instead of sharing a global one.
|
||||
|
||||
#### Naga MSL-OUT
|
||||
|
||||
- Fix issue where local variables were sometimes using variable names from previous functions.
|
||||
|
||||
## v0.18.0 (2023-10-25)
|
||||
|
||||
### Desktop OpenGL 3.3+ Support on Windows
|
||||
|
@ -3643,10 +3643,10 @@ impl<W: Write> Writer<W> {
|
||||
writeln!(self.out, ";")?;
|
||||
}
|
||||
|
||||
self.named_expressions.clear();
|
||||
self.update_expressions_to_bake(fun, fun_info, &context.expression);
|
||||
self.put_block(back::Level(1), &fun.body, &context)?;
|
||||
writeln!(self.out, "}}")?;
|
||||
self.named_expressions.clear();
|
||||
}
|
||||
|
||||
let mut info = TranslationInfo {
|
||||
@ -4313,13 +4313,13 @@ impl<W: Write> Writer<W> {
|
||||
writeln!(self.out, ";")?;
|
||||
}
|
||||
|
||||
self.named_expressions.clear();
|
||||
self.update_expressions_to_bake(fun, fun_info, &context.expression);
|
||||
self.put_block(back::Level(1), &fun.body, &context)?;
|
||||
writeln!(self.out, "}}")?;
|
||||
if ep_index + 1 != module.entry_points.len() {
|
||||
writeln!(self.out)?;
|
||||
}
|
||||
self.named_expressions.clear();
|
||||
}
|
||||
|
||||
Ok(info)
|
||||
|
Loading…
Reference in New Issue
Block a user