mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
ast: Support non-literal workgroup_size parameters
Change the type of the values in an ast::WorkgroupDecoration to be ast::Expression nodes, so that they can represent both ast::ScalarExpression (literal) and ast::IdentifierExpression (module-scope constant). The Resolver processes these nodes to produce a uint32_t for the default value on each dimension, and captures a reference to the module-scope constant if it is overridable (which will soon be used by the inspector and backends). The WGSL parser now uses `primary_expression` to parse arguments to workgroup_size. Also added some WorkgroupSize() helpers to ProgramBuilder. Bug: tint:713 Change-Id: I44b7b0021b925c84f25f65e26dc7da6b19ede508 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51262 Commit-Queue: James Price <jrprice@google.com> Auto-Submit: James Price <jrprice@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
40ac15f157
commit
70f80bb13d
@@ -828,10 +828,8 @@ TEST_F(InspectorGetEntryPointTest, DefaultWorkgroupSize) {
|
||||
}
|
||||
|
||||
TEST_F(InspectorGetEntryPointTest, NonDefaultWorkgroupSize) {
|
||||
MakeEmptyBodyFunction("foo", ast::DecorationList{
|
||||
Stage(ast::PipelineStage::kCompute),
|
||||
create<ast::WorkgroupDecoration>(8u, 2u, 1u),
|
||||
});
|
||||
MakeEmptyBodyFunction(
|
||||
"foo", {Stage(ast::PipelineStage::kCompute), WorkgroupSize(8, 2, 1)});
|
||||
|
||||
Inspector& inspector = Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user