Move workgroup_size property into sem::Function

The workgroup size should not be a property of the function in the
AST, and this lays the groundwork for allowing both literals and
module-scope constants to be used for this attribute.

Bug: tint:713
Change-Id: I014be879e2adb81cfc5b0ea0e221035fae626223
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51261
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-05-19 08:15:18 +00:00
committed by Commit Bot service account
parent 594075a2f0
commit ce8f868815
11 changed files with 109 additions and 51 deletions

View File

@@ -198,8 +198,16 @@ std::vector<EntryPoint> Inspector::GetEntryPoints() {
entry_point.name = program_->Symbols().NameFor(func->symbol());
entry_point.remapped_name = program_->Symbols().NameFor(func->symbol());
entry_point.stage = func->pipeline_stage();
std::tie(entry_point.workgroup_size_x, entry_point.workgroup_size_y,
entry_point.workgroup_size_z) = func->workgroup_size();
auto wgsize = sem->workgroup_size();
entry_point.workgroup_size_x = wgsize[0].value;
entry_point.workgroup_size_y = wgsize[1].value;
entry_point.workgroup_size_z = wgsize[2].value;
if (wgsize[0].overridable_const || wgsize[1].overridable_const ||
wgsize[2].overridable_const) {
// TODO(crbug.com/tint/713): Handle overridable constants.
TINT_ASSERT(false);
}
for (auto* param : sem->Parameters()) {
AddEntryPointInOutVariables(