aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2009-07-14 08:00:49 +0200
committerMichel Dänzer <[email protected]>2009-07-14 08:00:49 +0200
commit60e60bb3026a269fefe1cfd3312fdf3a7e4c595f (patch)
tree53fb2f6617b7a4e839eade0124a38f323e3ba46e /src/mesa/drivers/dri/r200
parent59155f70e701bc0b4fb816da991d6921f53b3bc7 (diff)
radeon: Invert front face winding when rendering to FBO.
Fixes fgl_glxgears and progs/demos/fbotexture after pressing 'c'. Tested with r300, radeon and r200 compile tested only.
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index c7c1a39316a..5a6fd20d8c2 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -574,6 +574,10 @@ static void r200FrontFace( GLcontext *ctx, GLenum mode )
R200_STATECHANGE( rmesa, tcl );
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_CULL_FRONT_IS_CCW;
+ /* Winding is inverted when rendering to FBO */
+ if (ctx->DrawBuffer && ctx->DrawBuffer->Name)
+ mode = (mode == GL_CW) ? GL_CCW : GL_CW;
+
switch ( mode ) {
case GL_CW:
rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CW;