From f081f06f54fab2cfdf636258b26670995861468e Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:31:44 +0200 Subject: [PATCH] fix expected min arg count of `textureLoad` --- src/front/wgsl/lower/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/front/wgsl/lower/mod.rs b/src/front/wgsl/lower/mod.rs index 631db7d26b..c5db0663fd 100644 --- a/src/front/wgsl/lower/mod.rs +++ b/src/front/wgsl/lower/mod.rs @@ -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); @@ -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