summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-06-01 15:07:47 -0600
committerBrian Paul <brianp@vmware.com>2009-06-01 15:07:47 -0600
commit29b822e4cf9626d3f0b8105375a2c0954e653e12 (patch)
treef64e7077f69964ef1cd8a6e3b4ace05e2e7bbfc6 /src
parentdcf6fe16e03f7baddbf7789cbf3ca31e0ed529b2 (diff)
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. (cherry picked from commit 0e8a5a84742adf6e99236f246c77325fad174204)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c3
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 ea76487bcfc..775ebe039e1 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -209,7 +209,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;