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.
This commit is contained in:
Michel Dänzer 2009-07-14 08:00:49 +02:00
parent 59155f70e7
commit 60e60bb302
3 changed files with 12 additions and 0 deletions

View File

@ -574,6 +574,10 @@ static void r200FrontFace( GLcontext *ctx, GLenum mode )
R200_STATECHANGE( rmesa, tcl ); R200_STATECHANGE( rmesa, tcl );
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~R200_CULL_FRONT_IS_CCW; 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 ) { switch ( mode ) {
case GL_CW: case GL_CW:
rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CW; rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CW;

View File

@ -434,6 +434,10 @@ static void r300UpdateCulling(GLcontext * ctx)
break; break;
} }
/* Winding is inverted when rendering to FBO */
if (ctx->DrawBuffer && ctx->DrawBuffer->Name)
val ^= R300_FRONT_FACE_CW;
R300_STATECHANGE(r300, cul); R300_STATECHANGE(r300, cul);
r300->hw.cul.cmd[R300_CUL_CULL] = val; r300->hw.cul.cmd[R300_CUL_CULL] = val;
} }

View File

@ -458,6 +458,10 @@ static void radeonFrontFace( GLcontext *ctx, GLenum mode )
RADEON_STATECHANGE( rmesa, tcl ); RADEON_STATECHANGE( rmesa, tcl );
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_CULL_FRONT_IS_CCW; rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] &= ~RADEON_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 ) { switch ( mode ) {
case GL_CW: case GL_CW:
rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CW; rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CW;