mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[msl-out]: avoid inner structure for run-time array sizes
This commit is contained in:
committed by
Dzmitry Malyshau
parent
ec64eaae6b
commit
c398102332
@@ -801,12 +801,15 @@ impl<W: Write> Writer<W> {
|
||||
crate::TypeInner::ValuePointer { .. } | crate::TypeInner::Vector { .. } => {
|
||||
write!(self.out, ".{}", back::COMPONENTS[index as usize])?;
|
||||
}
|
||||
crate::TypeInner::Matrix { .. } => {
|
||||
write!(self.out, "[{}]", index)?;
|
||||
}
|
||||
crate::TypeInner::Array { .. } => {
|
||||
crate::TypeInner::Array {
|
||||
size: crate::ArraySize::Constant(_),
|
||||
..
|
||||
} => {
|
||||
write!(self.out, ".{}[{}]", WRAPPED_ARRAY_FIELD, index)?;
|
||||
}
|
||||
crate::TypeInner::Array { .. } | crate::TypeInner::Matrix { .. } => {
|
||||
write!(self.out, "[{}]", index)?;
|
||||
}
|
||||
_ => {
|
||||
// unexpected indexing, should fail validation
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user