Mesa (7.9): softpipe: fix off-by-one error in setup_fragcoord_coeff()

Brian Paul brianp at kemper.freedesktop.org
Tue Feb 22 01:20:22 UTC 2011


Module: Mesa
Branch: 7.9
Commit: fa5c4b988a750ec1fd84ab355d4dac83bbd74f13
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa5c4b988a750ec1fd84ab355d4dac83bbd74f13

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Jan 25 11:57:35 2011 -0700

softpipe: fix off-by-one error in setup_fragcoord_coeff()

If we invert Y, need to subtract one from the surface height.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=26795
for softpipe.

NOTE: This is a candidate for the 7.9 and 7.10 branches.
(cherry picked from commit 40ac24e631e694e00652a2df6c0ac5d0f07f620f)

---

 src/gallium/drivers/softpipe/sp_setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c
index 5d727dc..0ce28f4 100644
--- a/src/gallium/drivers/softpipe/sp_setup.c
+++ b/src/gallium/drivers/softpipe/sp_setup.c
@@ -575,7 +575,7 @@ setup_fragcoord_coeff(struct setup_context *setup, uint slot)
    setup->coef[slot].dady[0] = 0.0;
    /*Y*/
    setup->coef[slot].a0[1] =
-		   (spfs->origin_lower_left ? setup->softpipe->framebuffer.height : 0)
+		   (spfs->origin_lower_left ? setup->softpipe->framebuffer.height-1 : 0)
 		   + (spfs->pixel_center_integer ? 0.0 : 0.5);
    setup->coef[slot].dadx[1] = 0.0;
    setup->coef[slot].dady[1] = spfs->origin_lower_left ? -1.0 : 1.0;




More information about the mesa-commit mailing list