mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
Validate binary operations
This change validates that the operand types and result type of every binary operation is valid. * Added two unit tests which test all valid and invalid param combos. I also removed the old tests, many of which failed once I added this validation, and the rest are obviated by the new tests. * Fixed VertexPulling transform, as well as many tests, that were using invalid operand types for binary operations. Fixed: tint:354 Change-Id: Ia3f48384256993da61b341f17ba5583741011819 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44341 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
1691401179
commit
be0fc4e929
@@ -92,6 +92,10 @@ bool Type::is_float_scalar_or_vector() const {
|
||||
return is_float_scalar() || is_float_vector();
|
||||
}
|
||||
|
||||
bool Type::is_float_scalar_or_vector_or_matrix() const {
|
||||
return is_float_scalar() || is_float_vector() || is_float_matrix();
|
||||
}
|
||||
|
||||
bool Type::is_integer_scalar() const {
|
||||
return IsAnyOf<U32, I32>();
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ class Type : public Castable<Type, Cloneable> {
|
||||
bool is_float_vector() const;
|
||||
/// @returns true if this type is a float scalar or vector
|
||||
bool is_float_scalar_or_vector() const;
|
||||
/// @returns true if this type is a float scalar or vector or matrix
|
||||
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 vector
|
||||
|
||||
Reference in New Issue
Block a user