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 authored and jimblandy committed Oct 23, 2023
1 parent 528bca7 commit f081f06
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 @@ -2099,7 +2099,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 @@ -2117,7 +2117,10 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {

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

let sample = class
Expand Down

0 comments on commit f081f06

Please sign in to comment.