[inspector] Add better support for remapped entry point names

Add remapped_name to entry point structure, also supply method to find
the remapped name for individual entry points.

BUG=tint:312

Change-Id: I5f2cc02bc37c17e99c453b16108bc8e10c602fba
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32383
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ryan Harrison
2020-11-11 21:35:36 +00:00
committed by Commit Bot service account
parent f8cf585582
commit 2b706110f6
4 changed files with 91 additions and 11 deletions

View File

@@ -48,9 +48,9 @@ std::vector<EntryPoint> Inspector::GetEntryPoints() {
continue;
}
Namer namer;
EntryPoint entry_point;
entry_point.name = namer.NameFor(func->name());
entry_point.name = func->name();
entry_point.remapped_name = namer_.NameFor(func->name());
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();
@@ -68,6 +68,15 @@ std::vector<EntryPoint> Inspector::GetEntryPoints() {
return result;
}
std::string Inspector::GetRemappedNamedForEntryPoint(
const std::string& entry_point) {
auto* func = FindEntryPointByName(entry_point);
if (!func) {
return {};
}
return namer_.NameFor(entry_point);
}
std::map<uint32_t, Scalar> Inspector::GetConstantIDs() {
std::map<uint32_t, Scalar> result;
for (auto& var : module_.global_variables()) {