[naga wgsl-out] Correctly include width in matrix constructions.

When generating WGSL for an `Expression::Compose` constructing a
matrix, consult `TypeInner::Matrix::width` when writing the
type name in the construction expression, rather than just always
writing `matNxM<f32>`.

Fixes #4681.
This commit is contained in:
Jim Blandy 2023-11-14 09:55:35 -08:00
parent 721e611b79
commit 16965f64e5

View File

@ -524,14 +524,14 @@ impl<W: Write> Writer<W> {
TypeInner::Matrix {
columns,
rows,
width: _,
width,
} => {
write!(
self.out,
//TODO: Can matrix be other than f32?
"mat{}x{}<f32>",
"mat{}x{}<{}>",
back::vector_size_str(columns),
back::vector_size_str(rows),
scalar_kind_str(crate::Scalar::float(width))
)?;
}
TypeInner::Pointer { base, space } => {