mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[msl] fix constant array initialization
This commit is contained in:
committed by
Dzmitry Malyshau
parent
057fa336a8
commit
baccfc68f5
@@ -1189,17 +1189,13 @@ impl<W: Write> Writer<W> {
|
||||
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, "}};")?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user