Mesa (mesa_7_5_branch): st/mesa: fix incorrect sprite origin when drawing to FBO/texture

Brian Paul brianp at kemper.freedesktop.org
Mon Jun 1 21:00:41 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 0e8a5a84742adf6e99236f246c77325fad174204
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e8a5a84742adf6e99236f246c77325fad174204

Author: Brian Paul <brianp at vmware.com>
Date:   Mon Jun  1 14:59:11 2009 -0600

st/mesa: fix incorrect sprite origin when drawing to FBO/texture

Need to take the draw buffer's up/down orientation into consideration
when setting the sprite_coord_mode field.

Fixes inverted sprites when drawing into an FBO.

---

 src/mesa/state_tracker/st_atom_rasterizer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 4e70510..5c72064 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -192,7 +192,8 @@ static void update_raster_state( struct st_context *st )
    raster->point_sprite = ctx->Point.PointSprite;
    for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
       if (ctx->Point.CoordReplace[i]) {
-         if (ctx->Point.SpriteOrigin == GL_UPPER_LEFT)
+         if ((ctx->Point.SpriteOrigin == GL_UPPER_LEFT) ^
+             (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM))
             raster->sprite_coord_mode[i] = PIPE_SPRITE_COORD_UPPER_LEFT;
          else 
             raster->sprite_coord_mode[i] = PIPE_SPRITE_COORD_LOWER_LEFT;




More information about the mesa-commit mailing list