commit | 2d261a56b00a19d16781441f2433c940b4ecb8a8 | [log] [tgz] |
---|---|---|
author | Nicolas Capens <capn@google.com> | Wed Jan 10 22:34:19 2018 -0500 |
committer | Nicolas Capens <nicolascapens@google.com> | Thu Jan 11 16:15:05 2018 +0000 |
tree | f63c4889c96ae037ab07bb7bbe1613a64f2f40d3 | |
parent | cb302f9210f2998447ea8d0784f13c231fe17351 [diff] |
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;