mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[wgsl-in] Consolidate array and struct cases in construction.
This commit is contained in:
@@ -466,20 +466,18 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
|
||||
crate::Expression::Compose { ty, components }
|
||||
}
|
||||
|
||||
// Array constructor
|
||||
(components, ConcreteConstructor::Type(ty, &crate::TypeInner::Array { .. })) => {
|
||||
// Array or Struct constructor
|
||||
(
|
||||
components,
|
||||
ConcreteConstructor::Type(
|
||||
ty,
|
||||
&crate::TypeInner::Array { .. } | &crate::TypeInner::Struct { .. },
|
||||
),
|
||||
) => {
|
||||
let components = components.into_components_vec();
|
||||
crate::Expression::Compose { ty, components }
|
||||
}
|
||||
|
||||
// Struct constructor
|
||||
(components, ConcreteConstructor::Type(ty, &crate::TypeInner::Struct { .. })) => {
|
||||
crate::Expression::Compose {
|
||||
ty,
|
||||
components: components.into_components_vec(),
|
||||
}
|
||||
}
|
||||
|
||||
// ERRORS
|
||||
|
||||
// Bad conversion (type cast)
|
||||
|
||||
Reference in New Issue
Block a user