Skip to content

Commit 7de43c7

Browse files
fix(msl-out): print resolved binding before array length
This only really applies to `[[clip_distances]]` right now, but Teo and I are pretty sure this is the right order for other attributes we might add for array types, too.
1 parent 0ca8ba0 commit 7de43c7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

naga/src/back/msl/writer.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7190,10 +7190,14 @@ template <typename A>
71907190
};
71917191
let resolved = options.resolve_local_binding(binding, out_mode)?;
71927192
write!(self.out, "{}{} {}", back::INDENT, ty_name, name)?;
7193+
let binding_attr_comes_before_array = matches!(
7194+
resolved,
7195+
super::ResolvedBinding::BuiltIn(crate::BuiltIn::ClipDistances)
7196+
);
7197+
resolved.try_fmt(&mut self.out)?;
71937198
if let Some(array_len) = array_len {
71947199
write!(self.out, " [{array_len}]")?;
71957200
}
7196-
resolved.try_fmt(&mut self.out)?;
71977201
writeln!(self.out, ";")?;
71987202
}
71997203

0 commit comments

Comments
 (0)