[tint] Implement subgroupAll and subgroupAny
Implement subgroupAll and subgroupAny builtins for WGSL, SPIR-V IR
backend (not AST), MSL AST and IR backends and HLSL AST and IR backends.
Subgroup builtins are not yet implemented for the GLSL backend.
Bug: 354738715
Change-Id: I9b3d1401ccca9b56e361f2b893812e3d3a42b4e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/201916
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Natalie Chouinard <chouinard@google.com>
diff --git a/src/tint/lang/core/builtin_fn.cc b/src/tint/lang/core/builtin_fn.cc
index dd3b048..ad8a8a8 100644
--- a/src/tint/lang/core/builtin_fn.cc
+++ b/src/tint/lang/core/builtin_fn.cc
@@ -432,6 +432,12 @@
if (name == "subgroupMax") {
return BuiltinFn::kSubgroupMax;
}
+ if (name == "subgroupAll") {
+ return BuiltinFn::kSubgroupAll;
+ }
+ if (name == "subgroupAny") {
+ return BuiltinFn::kSubgroupAny;
+ }
return BuiltinFn::kNone;
}
@@ -701,6 +707,10 @@
return "subgroupMin";
case BuiltinFn::kSubgroupMax:
return "subgroupMax";
+ case BuiltinFn::kSubgroupAll:
+ return "subgroupAll";
+ case BuiltinFn::kSubgroupAny:
+ return "subgroupAny";
}
return "<unknown>";
}