softpipe: fix off-by-one error in setup_fragcoord_coeff()
authorBrian Paul <brianp@vmware.com>
Tue, 25 Jan 2011 18:57:35 +0000 (11:57 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 25 Jan 2011 18:58:15 +0000 (11:58 -0700)
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.

src/gallium/drivers/softpipe/sp_setup.c

index 5d727dc00df0952ebdfe7ca1676aa28da45ff60b..0ce28f4c6ee09d070b8f15f43b26e49165fd0b79 100644 (file)
@@ -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;