glsl-out: Write correct argument name when skipping samplers

This commit is contained in:
João Capucho authored and Dzmitry Malyshau committed 2022-01-20 19:58:29 -05:00
1 parent 70599c46f6
commit 91bd26eb2c
1 file changed
+4 -3
+4 -3
View File
@@ -1148,12 +1148,13 @@ impl<'a, W: Write> Writer<'a, W> {
};
let arguments: Vec<_> = arguments
.iter()
.filter(|arg| match self.module.types[arg.ty].inner {
.enumerate()
.filter(|&(_, arg)| match self.module.types[arg.ty].inner {
TypeInner::Sampler { .. } => false,
_ => true,
})
.collect();
self.write_slice(&arguments, |this, i, arg| {
self.write_slice(&arguments, |this, _, &(i, arg)| {
// Write the argument type
match this.module.types[arg.ty].inner {
// We treat images separately because they might require
@@ -1191,7 +1192,7 @@ impl<'a, W: Write> Writer<'a, W> {
// Write the argument name
// The leading space is important
write!(this.out, " {}", &this.names[&ctx.argument_key(i)])?;
write!(this.out, " {}", &this.names[&ctx.argument_key(i as u32)])?;
Ok(())
})?;