Mesa (gallium-0.2): gallium: fix inverted raster pos when drawing into FBO

Alan Hourihane alanh at kemper.freedesktop.org
Tue Nov 25 09:28:47 UTC 2008


Module: Mesa
Branch: gallium-0.2
Commit: f8870af44b32d4c69ef11013897143d46966c8e4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8870af44b32d4c69ef11013897143d46966c8e4

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Mon Nov 24 18:37:18 2008 -0700

gallium: fix inverted raster pos when drawing into FBO

---

 src/mesa/state_tracker/st_cb_rasterpos.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index 3b30c2a..3eaccb7 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -146,7 +146,10 @@ rastpos_point(struct draw_stage *stage, struct prim_header *prim)
    /* update raster pos */
    pos = prim->v[0]->data[0];
    ctx->Current.RasterPos[0] = pos[0];
-   ctx->Current.RasterPos[1] = height - pos[1]; /* invert Y */
+   if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
+      ctx->Current.RasterPos[1] = height - pos[1]; /* invert Y */
+   else
+      ctx->Current.RasterPos[1] = pos[1];
    ctx->Current.RasterPos[2] = pos[2];
    ctx->Current.RasterPos[3] = pos[3];
 




More information about the mesa-commit mailing list