DescriptionOptimize QuadF's PointIsInTriangle function
The original version required 34 float ops (16mul + 11sub + 5add + 2div).
This version removes some of the intermediate dot products, reducing the
max number of operations to 19 (6mul + 2div + 11sub). It also avoids using
doubles, warranted by the removal of several intermediate operations that might
otherwise incur significance loss.
In local (release build) benchmarks, this reduced the typical CPU cost of a call to
QuadF::Contains(...) by 2/3, both with GCC and Clang on an ARM v7 device.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271088
Patch Set 1 #Patch Set 2 : Cleanup #
Total comments: 4
Patch Set 3 : Add comment with equations #
Messages
Total messages: 10 (0 generated)
|