mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
glsl-out: Write correct argument name when skipping samplers
This commit is contained in:
1 parent
70599c46f6
commit
91bd26eb2c
1 file changed
+4
-3
@@ -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(())
|
||||
})?;
|
||||
|
||||
Reference in new issue
Block a user