Mesa (master): r600: Flip point sprite coordinates when rendering to an FBO .

Alex Deucher agd5f at kemper.freedesktop.org
Thu Jul 22 15:11:29 UTC 2010


Module: Mesa
Branch: master
Commit: 2fdff50999825f5698f1f7f88565162f39227b2f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2fdff50999825f5698f1f7f88565162f39227b2f

Author: Henri Verbeet <hverbeet at gmail.com>
Date:   Thu Jul 22 11:10:11 2010 -0400

r600: Flip point sprite coordinates when rendering to an FBO.

This supersedes http://lists.freedesktop.org/archives/mesa-dev/2010-July/001442.html.

---

 src/mesa/drivers/dri/r600/r700_fragprog.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c
index bf17a97..f9d84b6 100644
--- a/src/mesa/drivers/dri/r600/r700_fragprog.c
+++ b/src/mesa/drivers/dri/r600/r700_fragprog.c
@@ -587,7 +587,9 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx)
         SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_T, PNT_SPRITE_OVRD_Y_shift, PNT_SPRITE_OVRD_Y_mask);
         SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_0, PNT_SPRITE_OVRD_Z_shift, PNT_SPRITE_OVRD_Z_mask);
         SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_1, PNT_SPRITE_OVRD_W_shift, PNT_SPRITE_OVRD_W_mask);
-        if(ctx->Point.SpriteOrigin == GL_LOWER_LEFT)
+        /* Like e.g. viewport and winding, point sprite coordinates are
+         * inverted when rendering to FBO. */
+        if ((ctx->Point.SpriteOrigin == GL_LOWER_LEFT) == !ctx->DrawBuffer->Name)
             SETbit(r700->SPI_INTERP_CONTROL_0.u32All, PNT_SPRITE_TOP_1_bit);
         else
             CLEARbit(r700->SPI_INTERP_CONTROL_0.u32All, PNT_SPRITE_TOP_1_bit);




More information about the mesa-commit mailing list