mesa: Changes to 'master'

Eric Anholt anholt at
Wed Feb 6 15:44:36 PST 2008

 src/mesa/drivers/dri/i915/i915_fragprog.c |  228 +++++++++++++++++++-----------
 1 file changed, 151 insertions(+), 77 deletions(-)

commit diffs at;a=summary

New commits:
commit 700a77fb48f364f85e013cf5fb68c04eb83317e7
Author: Eric Anholt <eric at>
Date:   Wed Feb 6 15:41:04 2008 -0800

    [915] Fix COS function using same plan as SIN.
    The previous COS function failed badly outside of [-pi/2, pi/2].

commit 2551a5ee80ab523006618c79766e2409b2a62d84
Author: Eric Anholt <eric at>
Date:   Wed Feb 6 15:38:16 2008 -0800

    [915] Use a quartic term to improve the accuracy of SIN results.
    This is described in the link in the comment, and is the same technique that
    r300 uses.

commit d98abcbef0bd4200fc0fd30fc0524bf452df3572
Author: Eric Anholt <eric at>
Date:   Wed Feb 6 11:34:14 2008 -0800

    [915] Fix fp SIN function, and use a quadratic approximation instead of Taylor.
    The Taylor series notably fails at producing sin(pi) == 0, which leads to
    discontinuity every 2*pi.  The quadratic gets us sin(pi) == 0 behavior, at the
    expense of going from 2.4% THD with working Taylor series to 3.8% THD (easily
    seen on comparative graphs of the two).  However, our previous implementation
    was producing sin(pi) < -1 and worse, so any reasonable approximation is an
    improvement.  This also fixes the repeating behavior, where the previous
    implementation would repeat sin(x) for x>pi as sin(x % pi) and the opposite
    for x < -pi.

More information about the mesa-commit mailing list