mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 06:45:16 +00:00
Fix integer vector bitwise ops not being allowed
Bug: 768 Change-Id: Id5023cd32b9368e9c0634bdad884ad199f17aa80 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/52943 Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
2871ad9138
commit
0895c238e3
@@ -2221,7 +2221,7 @@ bool Resolver::Binary(ast::BinaryExpression* expr) {
|
||||
|
||||
// Binary bitwise operations
|
||||
if (expr->IsBitwise()) {
|
||||
if (matching_types && lhs_type->IsAnyOf<I32, U32>()) {
|
||||
if (matching_types && lhs_type->is_integer_scalar_or_vector()) {
|
||||
SetType(expr, lhs_type);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1438,9 +1438,6 @@ static constexpr Params all_valid_cases[] = {
|
||||
Params{Op::kGreaterThanEqual, ast_vec3<f32>, ast_vec3<f32>,
|
||||
sem_vec3<sem_bool>},
|
||||
|
||||
// Bit expressions
|
||||
// https://gpuweb.github.io/gpuweb/wgsl.html#bit-expr
|
||||
|
||||
// Binary bitwise operations
|
||||
Params{Op::kOr, ast_i32, ast_i32, sem_i32},
|
||||
Params{Op::kAnd, ast_i32, ast_i32, sem_i32},
|
||||
@@ -1450,6 +1447,14 @@ static constexpr Params all_valid_cases[] = {
|
||||
Params{Op::kAnd, ast_u32, ast_u32, sem_u32},
|
||||
Params{Op::kXor, ast_u32, ast_u32, sem_u32},
|
||||
|
||||
Params{Op::kOr, ast_vec3<i32>, ast_vec3<i32>, sem_vec3<sem_i32>},
|
||||
Params{Op::kAnd, ast_vec3<i32>, ast_vec3<i32>, sem_vec3<sem_i32>},
|
||||
Params{Op::kXor, ast_vec3<i32>, ast_vec3<i32>, sem_vec3<sem_i32>},
|
||||
|
||||
Params{Op::kOr, ast_vec3<u32>, ast_vec3<u32>, sem_vec3<sem_u32>},
|
||||
Params{Op::kAnd, ast_vec3<u32>, ast_vec3<u32>, sem_vec3<sem_u32>},
|
||||
Params{Op::kXor, ast_vec3<u32>, ast_vec3<u32>, sem_vec3<sem_u32>},
|
||||
|
||||
// Bit shift expressions
|
||||
Params{Op::kShiftLeft, ast_i32, ast_u32, sem_i32},
|
||||
Params{Op::kShiftLeft, ast_vec3<i32>, ast_vec3<u32>, sem_vec3<sem_i32>},
|
||||
|
||||
Reference in New Issue
Block a user