Expose interpolation and dimensional data about IO variables

BUG=tint:859

Change-Id: I12da0fa49d7384bc321d27e84bad76b23081a56e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56623
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ryan Harrison
2021-06-30 21:07:42 +00:00
committed by Tint LUCI CQ
parent 62c8f2a9d6
commit d4c64af117
6 changed files with 319 additions and 46 deletions

View File

@@ -86,14 +86,22 @@ bool Type::is_integer_scalar() const {
return IsAnyOf<U32, I32>();
}
bool Type::is_unsigned_integer_vector() const {
return Is<Vector>([](const Vector* v) { return v->type()->Is<U32>(); });
bool Type::is_signed_integer_scalar() const {
return Is<I32>();
}
bool Type::is_unsigned_integer_scalar() const {
return Is<U32>();
}
bool Type::is_signed_integer_vector() const {
return Is<Vector>([](const Vector* v) { return v->type()->Is<I32>(); });
}
bool Type::is_unsigned_integer_vector() const {
return Is<Vector>([](const Vector* v) { return v->type()->Is<U32>(); });
}
bool Type::is_unsigned_scalar_or_vector() const {
return Is<U32>() || is_unsigned_integer_vector();
}

View File

@@ -69,6 +69,10 @@ class Type : public Castable<Type, Node> {
bool is_float_scalar_or_vector_or_matrix() const;
/// @returns true if this type is an integer scalar
bool is_integer_scalar() const;
/// @returns true if this type is a signed integer scalar
bool is_signed_integer_scalar() const;
/// @returns true if this type is an unsigned integer scalar
bool is_unsigned_integer_scalar() const;
/// @returns true if this type is a signed integer vector
bool is_signed_integer_vector() const;
/// @returns true if this type is an unsigned vector