diff --git a/src/back/msl/writer.rs b/src/back/msl/writer.rs index ee5b9522ce..2964a92449 100644 --- a/src/back/msl/writer.rs +++ b/src/back/msl/writer.rs @@ -1189,17 +1189,13 @@ impl Writer { crate::ConstantInner::Composite { ty, ref components } => { let name = &self.names[&NameKey::Constant(handle)]; let ty_name = &self.names[&NameKey::Type(ty)]; - write!( - self.out, - "constexpr constant {} {} = {}(", - ty_name, name, ty_name - )?; + write!(self.out, "constexpr constant {} {} = {{", ty_name, name,)?; for (i, &sub_handle) in components.iter().enumerate() { let separator = if i != 0 { ", " } else { "" }; let sub_name = &self.names[&NameKey::Constant(sub_handle)]; write!(self.out, "{}{}", separator, sub_name)?; } - writeln!(self.out, ");")?; + writeln!(self.out, "}};")?; } } } diff --git a/tests/out/shadow.msl.snap b/tests/out/shadow.msl.snap index 906e53bfd0..c03bf1cdaf 100644 --- a/tests/out/shadow.msl.snap +++ b/tests/out/shadow.msl.snap @@ -34,7 +34,7 @@ typedef uint type6; typedef float type7; typedef metal::float2 type8; typedef metal::float3 type9; -constexpr constant type9 c_ambient = type9(const_0_05f, const_0_05f, const_0_05f); +constexpr constant type9 c_ambient = {const_0_05f, const_0_05f, const_0_05f}; type7 fetch_shadow( type6 light_id, type2 homogeneous_coords,