fix(naga wgsl-out): Emit wgpu_cooperative_matrix extension when needed

This commit is contained in:
Andy Leiserson authored and Teodor Tanasoaia committed 2026-01-19 10:38:47 +01:00
1 parent b40c01a018
commit 2d56ec6cdc
2 files changed
+10

No files matched your search

+8
View File
@@ -279,6 +279,7 @@ impl<W: Write> Writer<W> {
let mut needs_dual_source_blending = false;
let mut needs_clip_distances = false;
let mut needs_mesh_shaders = false;
let mut needs_cooperative_matrix = false;
// Determine which `enable` declarations are needed
for (_, ty) in module.types.iter() {
@@ -322,6 +323,9 @@ impl<W: Write> Writer<W> {
}
}
}
TypeInner::CooperativeMatrix { .. } => {
needs_cooperative_matrix = true;
}
_ => {}
}
}
@@ -360,6 +364,10 @@ impl<W: Write> Writer<W> {
writeln!(self.out, "enable wgpu_mesh_shader;")?;
any_written = true;
}
if needs_cooperative_matrix {
writeln!(self.out, "enable wgpu_cooperative_matrix;")?;
any_written = true;
}
if any_written {
// Empty line for readability
writeln!(self.out)?;
@@ -1,3 +1,5 @@
enable wgpu_cooperative_matrix;
var<private> a: coop_mat8x8<f32,A>;
var<private> b: coop_mat8x8<f32,B>;
@group(0) @binding(0)