When all three vertices of a triangle have depth 0, the maximum exponent e is 0. We can't just use (e - n) << n as the bit pattern for 2^(e - n), because the exponent field underflows and creates a negative value. All triangles where all depth values have a bias-adjusted exponent less than 23 have this issue (note 2^(23 - 127) = 4.9e-32). The fix is to perform 2^(e - n) as 2^e * 2^(-n). The multiplication handles the underflow of the exponent either by creating a subnormal, or zero. Bug: b/139341727 Change-Id: I44b87feb55f61c5fa18ba235e9ec211926de3b3e Fixes: b/174051829 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51148 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| build_overrides | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| infra/config | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| tools/cmake_generate_graphviz | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CMakeSettings.json | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| codereview.settings | Loading commit data... |