Add ESSL 3.10 integer math built-ins
This adds built-ins found in ESSL 3.10 section 8.8 Integer functions.
This includes constant folding support for functions that may be
constant folded, and support for both GLSL and HLSL output. In HLSL
several of the functions need to be emulated.
The precision qualification for the return value of some of these
functions is determined by special rules, that are now part of type
promotion for TIntermUnary nodes and determining the type of
TIntermAggregate nodes.
BUG=angleproject:1730
TEST=angle_unittests
TEST=dEQP-GLES31.functional.shaders.builtin_functions.integer.*
Change-Id: Ib0056c17671c42b6496c2f0ef059b99f8f25c122
Reviewed-on: https://chromium-review.googlesource.com/431310
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index a2cef1c..0c3b501 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -725,6 +725,10 @@
case EOpAny:
case EOpAll:
case EOpLogicalNotComponentWise:
+ case EOpBitfieldReverse:
+ case EOpBitCount:
+ case EOpFindLSB:
+ case EOpFindMSB:
writeBuiltInFunctionTriplet(visit, node->getOp(), node->getUseEmulatedFunction());
return true;
default:
@@ -935,6 +939,12 @@
case EOpRefract:
case EOpMulMatrixComponentWise:
case EOpOuterProduct:
+ case EOpBitfieldExtract:
+ case EOpBitfieldInsert:
+ case EOpUaddCarry:
+ case EOpUsubBorrow:
+ case EOpUmulExtended:
+ case EOpImulExtended:
case EOpBarrier:
case EOpMemoryBarrier:
case EOpMemoryBarrierAtomicCounter: