mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 14:31:08 +01:00
fix(naga wgsl-out): Emit wgpu_cooperative_matrix extension when needed
This commit is contained in:
1 parent
b40c01a018
commit
2d56ec6cdc
2 files changed
+10
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user