DS GX: Fudge accuracy loss issue
Vicki Pfau vi@endrift.com
Mon, 13 Mar 2017 11:59:39 -0700
1 files changed,
3 insertions(+),
3 deletions(-)
jump to
M
src/ds/gx.c
→
src/ds/gx.c
@@ -231,9 +231,9 @@
int32_t vx = _lerp(v0->vx, v1->vx, w0, w1, xw); int32_t vy = _lerp(v0->vy, v1->vy, w0, w1, xw); int32_t vz = _lerp(v0->vz, v1->vz, w0, w1, xw); - out->vx = (vx * wRecip) >> 32; - out->vy = (vy * wRecip) >> 32; - out->vz = (vz * wRecip) >> 32; + out->vx = ((vx * wRecip) >> 32) + 1; + out->vy = ((vy * wRecip) >> 32) + 1; + out->vz = ((vz * wRecip) >> 32) + 1; int32_t s = _lerp(v0->vs, v1->vs, w0, w1, xw); int32_t t = _lerp(v0->vt, v1->vt, w0, w1, xw);