Skip to content

Commit

Permalink
fix expected min arg count of textureLoad
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Oct 23, 2023
1 parent 29ca531 commit d95636c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/front/wgsl/lower/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
return Ok(None);
}
"textureLoad" => {
let mut args = ctx.prepare_args(arguments, 3, span);
let mut args = ctx.prepare_args(arguments, 2, span);

let image = args.next()?;
let image_span = ctx.ast_expressions.get_span(image);
Expand All @@ -2139,7 +2139,10 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {

let level = class
.is_mipmapped()
.then(|| self.expression(args.next()?, ctx.reborrow()))
.then(|| {
args.min_args += 1;
self.expression(args.next()?, ctx.reborrow())
})
.transpose()?;

let sample = class
Expand Down

0 comments on commit d95636c

Please sign in to comment.