softpipe: fix bug in perspective corrected interpolants for lines

Thanks to Michal for finding this.

This will get fixed on the gallium-cylindrical-wrap branch and
then merged to master.
This commit is contained in:
Brian Paul 2010-02-05 12:48:37 -07:00
parent 34b36277b7
commit 3ca6cb3440

View file

@ -805,7 +805,6 @@ line_persp_coeff(const struct setup_context *setup,
struct tgsi_interp_coef *coef,
uint vertSlot, uint i)
{
/* XXX double-check/verify this arithmetic */
const float a0 = setup->vmin[vertSlot][i] * setup->vmin[0][3];
const float a1 = setup->vmax[vertSlot][i] * setup->vmax[0][3];
const float da = a1 - a0;
@ -813,7 +812,7 @@ line_persp_coeff(const struct setup_context *setup,
const float dady = da * setup->emaj.dy * setup->oneoverarea;
coef->dadx[i] = dadx;
coef->dady[i] = dady;
coef->a0[i] = (setup->vmin[vertSlot][i] -
coef->a0[i] = (a0 -
(dadx * (setup->vmin[0][0] - setup->pixel_offset) +
dady * (setup->vmin[0][1] - setup->pixel_offset)));
}