mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Add Castsable::IsAnyOf<T1, T2, ...>()
This makes it a little easier to check if an object is one of any of the types provided. Updated Type query functions to make use of IsAnyOf. Added tests. Change-Id: I12ea62b32042b6675d998ab85b86f2fe15861330 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44462 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
81a4753c38
commit
a089a56c73
@@ -71,7 +71,7 @@ Type* Type::UnwrapAll() {
|
||||
}
|
||||
|
||||
bool Type::is_scalar() const {
|
||||
return is_float_scalar() || is_integer_scalar() || Is<Bool>();
|
||||
return IsAnyOf<F32, U32, I32, Bool>();
|
||||
}
|
||||
|
||||
bool Type::is_float_scalar() const {
|
||||
@@ -91,7 +91,7 @@ bool Type::is_float_scalar_or_vector() const {
|
||||
}
|
||||
|
||||
bool Type::is_integer_scalar() const {
|
||||
return Is<U32>() || Is<I32>();
|
||||
return IsAnyOf<U32, I32>();
|
||||
}
|
||||
|
||||
bool Type::is_unsigned_integer_vector() const {
|
||||
@@ -123,7 +123,7 @@ bool Type::is_bool_scalar_or_vector() const {
|
||||
}
|
||||
|
||||
bool Type::is_handle() const {
|
||||
return Is<type::Sampler>() || Is<type::Texture>();
|
||||
return IsAnyOf<Sampler, Texture>();
|
||||
}
|
||||
|
||||
} // namespace type
|
||||
|
||||
Reference in New Issue
Block a user