From 3ca6cb3440705ffec470beb601cdc0c22089e3f1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Feb 2010 12:48:37 -0700 Subject: [PATCH] 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. --- src/gallium/drivers/softpipe/sp_setup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index 478d8efd1b2..4cd11ddc69d 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -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))); }