Mesa (mesa_7_6_branch): r600: Invert front face winding when rendering to FBO

Alex Deucher agd5f at kemper.freedesktop.org
Wed Dec 16 13:19:23 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 20ee275974a58cd221031d522ad58a9548af2a31
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=20ee275974a58cd221031d522ad58a9548af2a31

Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Wed Dec 16 16:18:22 2009 -0500

r600: Invert front face winding when rendering to FBO

fixes fdo bug 25679

Signed-off-by: Alex Deucher <alexdeucher at gmail.com>

---

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

diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c
index 244a016..e763d28 100644
--- a/src/mesa/drivers/dri/r600/r700_state.c
+++ b/src/mesa/drivers/dri/r600/r700_state.c
@@ -655,6 +655,10 @@ static void r700UpdateCulling(GLcontext * ctx)
             CLEARbit(r700->PA_SU_SC_MODE_CNTL.u32All, FACE_bit); /* default: ccw */
             break;
     }
+
+    /* Winding is inverted when rendering to FBO */
+    if (ctx->DrawBuffer && ctx->DrawBuffer->Name)
+	    r700->PA_SU_SC_MODE_CNTL.u32All ^= FACE_bit;
 }
 
 static void r700UpdateLineStipple(GLcontext * ctx)



More information about the mesa-commit mailing list