mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
glsl-out: Write correct argument name when skipping samplers
This commit is contained in:
committed by
Dzmitry Malyshau
parent
955e02eb17
commit
b42bf8768e
@@ -1178,12 +1178,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
|
||||
@@ -1221,7 +1222,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