Fix exp2 for integer input. exp2(x) should be exact for integer values of x. For example exp(1.0) should produce 2.0. Change-Id: I9d6d1d388c23e813e09b7b5788c929ff07189357 Reviewed-on: https://swiftshader-review.googlesource.com/16188 Tested-by: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Shader/ShaderCore.cpp b/src/Shader/ShaderCore.cpp index 559208c..c763404 100644 --- a/src/Shader/ShaderCore.cpp +++ b/src/Shader/ShaderCore.cpp
@@ -139,7 +139,7 @@ x1 *= x0; x1 += As<Float4>(Int4(0x3F31727B)); // 6.9315308e-1f x1 *= x0; - x1 += As<Float4>(Int4(0x3F7FFFFF)); // 9.9999994e-1f + x1 += Float4(1.0f); x1 *= As<Float4>(x2); return x1;