diff --git a/src/tint/writer/glsl/generator_impl.cc b/src/tint/writer/glsl/generator_impl.cc index 6bab9283c4..f0ffc53fce 100644 --- a/src/tint/writer/glsl/generator_impl.cc +++ b/src/tint/writer/glsl/generator_impl.cc @@ -2717,7 +2717,11 @@ bool GeneratorImpl::EmitUnaryOp(std::ostream& out, out << "~"; break; case ast::UnaryOp::kNot: - out << "!"; + if (TypeOf(expr)->UnwrapRef()->is_scalar()) { + out << "!"; + } else { + out << "not"; + } break; case ast::UnaryOp::kNegation: out << "-"; diff --git a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordEqual_Vector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordEqual_Vector.spvasm.expected.glsl index 795babea3b..88263dff61 100644 --- a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordEqual_Vector.spvasm.expected.glsl +++ b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordEqual_Vector.spvasm.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void main_1() { - bvec2 x_1 = !(notEqual(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); + bvec2 x_1 = not(notEqual(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); return; } @@ -16,10 +14,3 @@ void main() { tint_symbol(); return; } -Error parsing GLSL shader: -ERROR: 0:5: '!' : wrong operand type no operation '!' exists that takes an operand of type const 2-component vector of bool (or there is no acceptable conversion) -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThanEqual_Vector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThanEqual_Vector.spvasm.expected.glsl index c56133f048..52aee68b95 100644 --- a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThanEqual_Vector.spvasm.expected.glsl +++ b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThanEqual_Vector.spvasm.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void main_1() { - bvec2 x_1 = !(lessThan(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); + bvec2 x_1 = not(lessThan(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); return; } @@ -16,10 +14,3 @@ void main() { tint_symbol(); return; } -Error parsing GLSL shader: -ERROR: 0:5: '!' : wrong operand type no operation '!' exists that takes an operand of type const 2-component vector of bool (or there is no acceptable conversion) -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThan_Vector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThan_Vector.spvasm.expected.glsl index f78d5be4ed..f9b125cded 100644 --- a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThan_Vector.spvasm.expected.glsl +++ b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordGreaterThan_Vector.spvasm.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void main_1() { - bvec2 x_1 = !(lessThanEqual(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); + bvec2 x_1 = not(lessThanEqual(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); return; } @@ -16,10 +14,3 @@ void main() { tint_symbol(); return; } -Error parsing GLSL shader: -ERROR: 0:5: '!' : wrong operand type no operation '!' exists that takes an operand of type const 2-component vector of bool (or there is no acceptable conversion) -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThanEqual_Vector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThanEqual_Vector.spvasm.expected.glsl index cf5d8324cf..12919de40b 100644 --- a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThanEqual_Vector.spvasm.expected.glsl +++ b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThanEqual_Vector.spvasm.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void main_1() { - bvec2 x_1 = !(greaterThan(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); + bvec2 x_1 = not(greaterThan(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); return; } @@ -16,10 +14,3 @@ void main() { tint_symbol(); return; } -Error parsing GLSL shader: -ERROR: 0:5: '!' : wrong operand type no operation '!' exists that takes an operand of type const 2-component vector of bool (or there is no acceptable conversion) -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThan_Vector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThan_Vector.spvasm.expected.glsl index 8674bdd982..065f4b73a8 100644 --- a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThan_Vector.spvasm.expected.glsl +++ b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordLessThan_Vector.spvasm.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void main_1() { - bvec2 x_1 = !(greaterThanEqual(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); + bvec2 x_1 = not(greaterThanEqual(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); return; } @@ -16,10 +14,3 @@ void main() { tint_symbol(); return; } -Error parsing GLSL shader: -ERROR: 0:5: '!' : wrong operand type no operation '!' exists that takes an operand of type const 2-component vector of bool (or there is no acceptable conversion) -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordNotEqual_Vector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordNotEqual_Vector.spvasm.expected.glsl index b4351707ae..fdf860bfea 100644 --- a/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordNotEqual_Vector.spvasm.expected.glsl +++ b/test/tint/unittest/reader/spirv/SpvFUnordTest_FUnordNotEqual_Vector.spvasm.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void main_1() { - bvec2 x_1 = !(equal(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); + bvec2 x_1 = not(equal(vec2(50.0f, 60.0f), vec2(60.0f, 50.0f))); return; } @@ -16,10 +14,3 @@ void main() { tint_symbol(); return; } -Error parsing GLSL shader: -ERROR: 0:5: '!' : wrong operand type no operation '!' exists that takes an operand of type const 2-component vector of bool (or there is no acceptable conversion) -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - - diff --git a/test/tint/unittest/reader/spirv/SpvUnaryLogicalTest_LogicalNot_Vector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryLogicalTest_LogicalNot_Vector.spvasm.expected.glsl index 01e2b29a44..158f14c001 100644 --- a/test/tint/unittest/reader/spirv/SpvUnaryLogicalTest_LogicalNot_Vector.spvasm.expected.glsl +++ b/test/tint/unittest/reader/spirv/SpvUnaryLogicalTest_LogicalNot_Vector.spvasm.expected.glsl @@ -1,10 +1,8 @@ -SKIP: FAILED - #version 310 es precision mediump float; void main_1() { - bvec2 x_1 = !(bvec2(true, false)); + bvec2 x_1 = not(bvec2(true, false)); return; } @@ -16,10 +14,3 @@ void main() { tint_symbol(); return; } -Error parsing GLSL shader: -ERROR: 0:5: '!' : wrong operand type no operation '!' exists that takes an operand of type const 2-component vector of bool (or there is no acceptable conversion) -ERROR: 0:5: '' : compilation terminated -ERROR: 2 compilation errors. No code generated. - - -