Implement missing variants of abs/sign
This change adds ANGLE support for abs/sign variants introduced
in ESSL3.
BUG=angle:923
TEST=Unit tests, dEQP tests
Unit Tests:
TypeTrackingTest.BuiltInAbsSignFunctionFloatResultTypeAndPrecision
TypeTrackingTest.BuiltInAbsSignFunctionIntResultTypeAndPrecision
dEQP tests passing 100% because of this change:
dEQP-GLES3.functional.shaders.builtin_functions.common.abs
dEQP-GLES3.functional.shaders.builtin_functions.common.sign
Change-Id: I2a3b028611f0eaaac3c031f8926d34a0e146663d
Reviewed-on: https://chromium-review.googlesource.com/251491
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp
index cf22164..6ebe86f 100644
--- a/src/compiler/translator/IntermNode.cpp
+++ b/src/compiler/translator/IntermNode.cpp
@@ -337,7 +337,8 @@
return false;
break;
- // operators for built-ins are already type checked against their prototype
+ // Operators for built-ins are already type checked against their prototype
+ // and some of them get the type of their return value assigned elsewhere.
case EOpAny:
case EOpAll:
case EOpVectorLogicalNot:
@@ -348,6 +349,10 @@
case EOpUnpackHalf2x16:
return true;
+ case EOpAbs:
+ case EOpSign:
+ break;
+
default:
if (mOperand->getBasicType() != EbtFloat)
return false;