Skip to content

Commit

Permalink
[wgsl-in] Always flush expressions in function call (#1478)
Browse files Browse the repository at this point in the history
  • Loading branch information
JCapucho authored Oct 25, 2021
1 parent f8d3c4b commit 8c071ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validation-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'tests/out/glsl/*.glsl'
- 'tests/out/dot/*.dot'
- 'tests/out/wgsl/*.wgsl'
- 'src/front/wgsl/*'

jobs:
validate-linux:
Expand Down
8 changes: 4 additions & 4 deletions src/front/wgsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1891,12 +1891,12 @@ impl Parser {
match self.parse_local_function_call(lexer, name, ctx.reborrow())? {
Some((function, arguments)) => {
let span = NagaSpan::from(self.peek_scope(lexer));
ctx.block.extend(ctx.emitter.finish(ctx.expressions));
let result = ctx.functions[function].result.as_ref().map(|_| {
ctx.interrupt_emitter(
crate::Expression::CallResult(function),
span,
)
ctx.expressions
.append(crate::Expression::CallResult(function), span)
});
ctx.emitter.start(ctx.expressions);
ctx.block.push(
crate::Statement::Call {
function,
Expand Down

0 comments on commit 8c071ef

Please sign in to comment.