[inspector] Include component type information for stage variables

BUG=tint:630

Change-Id: Ib30221e7a2d35e77a164969428ed6bfc07bc2a8e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44340
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ryan Harrison
2021-03-11 16:37:32 +00:00
committed by Commit Bot service account
parent a0d48382cb
commit f1773c6700
3 changed files with 65 additions and 9 deletions

View File

@@ -208,6 +208,17 @@ std::vector<EntryPoint> Inspector::GetEntryPoints() {
StageVariable stage_variable;
stage_variable.name = name;
stage_variable.component_type = ComponentType::kUnknown;
auto* type = var->Declaration()->type()->UnwrapAll();
if (type->is_float_scalar_or_vector() || type->is_float_matrix()) {
stage_variable.component_type = ComponentType::kFloat;
} else if (type->is_unsigned_scalar_or_vector()) {
stage_variable.component_type = ComponentType::kUInt;
} else if (type->is_signed_scalar_or_vector()) {
stage_variable.component_type = ComponentType::kSInt;
}
auto* location_decoration = decl->GetLocationDecoration();
if (location_decoration) {
stage_variable.has_location_decoration = true;