summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i810/i810render.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-02-06 11:34:14 -0800
committerEric Anholt <eric@anholt.net>2008-02-06 15:26:00 -0800
commitd98abcbef0bd4200fc0fd30fc0524bf452df3572 (patch)
treef053f350ece4c97bf6b4718d22edb3cfa65ea946 /src/mesa/drivers/dri/i810/i810render.c
parentc0e026c8090954ddb629a01cc1a93c61b2fc8298 (diff)
[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.
Diffstat (limited to 'src/mesa/drivers/dri/i810/i810render.c')
0 files changed, 0 insertions, 0 deletions