diff --git a/naga/src/front/wgsl/to_wgsl.rs b/naga/src/front/wgsl/to_wgsl.rs index 7af3debc4..bfff363b3 100644 --- a/naga/src/front/wgsl/to_wgsl.rs +++ b/naga/src/front/wgsl/to_wgsl.rs @@ -57,16 +57,14 @@ impl crate::TypeInner { format!("atomic<{}>", scalar.to_wgsl()) } Ti::Pointer { base, .. } => { - let base = &gctx.types[base]; - let name = base.name.as_deref().unwrap_or("unknown"); + let name = base.to_wgsl(gctx); format!("ptr<{name}>") } Ti::ValuePointer { scalar, .. } => { format!("ptr<{}>", scalar.to_wgsl()) } Ti::Array { base, size, .. } => { - let member_type = &gctx.types[base]; - let base = member_type.name.as_deref().unwrap_or("unknown"); + let base = base.to_wgsl(gctx); match size { crate::ArraySize::Constant(size) => format!("array<{base}, {size}>"), crate::ArraySize::Dynamic => format!("array<{base}>"),