diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index 408ea4b2eb..1bdb0adb9c 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -615,6 +615,8 @@ uint32_t Builder::GenerateBinaryExpression(ast::BinaryExpression* expr) { } } else if (expr->IsNotEqual()) { op = lhs_is_float_or_vec ? spv::Op::OpFOrdNotEqual : spv::Op::OpINotEqual; + } else if (expr->IsOr()) { + op = spv::Op::OpBitwiseOr; } else { return 0; } diff --git a/src/writer/spirv/builder_binary_expression_test.cc b/src/writer/spirv/builder_binary_expression_test.cc index 8da3eb8c49..2ee5a0e938 100644 --- a/src/writer/spirv/builder_binary_expression_test.cc +++ b/src/writer/spirv/builder_binary_expression_test.cc @@ -122,7 +122,8 @@ INSTANTIATE_TEST_SUITE_P( BuilderTest, BinaryArithIntegerTest, testing::Values(BinaryData{ast::BinaryOp::kAdd, "OpIAdd"}, - BinaryData{ast::BinaryOp::kAnd, "OpBitwiseAnd"})); + BinaryData{ast::BinaryOp::kAnd, "OpBitwiseAnd"}, + BinaryData{ast::BinaryOp::kOr, "OpBitwiseOr"})); using BinaryArithFloatTest = testing::TestWithParam; TEST_P(BinaryArithFloatTest, Scalar) {