summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorsmoki <[email protected]>2013-01-03 18:57:40 +0100
committerAndreas Boll <[email protected]>2013-01-20 15:08:29 +0100
commit320b5abda5026f23f327c6f60c1b6287cc507e78 (patch)
tree94be1c22babb52d0647aab7326ff500fa7f543a7 /src/mesa
parentb694aa4ab9579815903220a0a3536f648914551a (diff)
radeon/r200: Fix tcl culling
Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=57842 (cherry picked from commit 5bf357db89836d0f4e4b8a4cb559755d4734b81b)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/r200/r200_state.c13
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_state.c13
2 files changed, 8 insertions, 18 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index 1c335172acb..93ae52a4bba 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -529,6 +529,7 @@ static void r200CullFace( struct gl_context *ctx, GLenum unused )
static void r200FrontFace( struct gl_context *ctx, GLenum mode )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ int cull_face = (mode == GL_CW) ? R200_FFACE_CULL_CW : R200_FFACE_CULL_CCW;
R200_STATECHANGE( rmesa, set );
rmesa->hw.set.cmd[SET_SE_CNTL] &= ~R200_FFACE_CULL_DIR_MASK;
@@ -538,17 +539,11 @@ static void r200FrontFace( struct gl_context *ctx, GLenum mode )
/* Winding is inverted when rendering to FBO */
if (ctx->DrawBuffer && _mesa_is_user_fbo(ctx->DrawBuffer))
- mode = (mode == GL_CW) ? GL_CCW : GL_CW;
+ cull_face = (mode == GL_CCW) ? R200_FFACE_CULL_CW : R200_FFACE_CULL_CCW;
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= cull_face;
- switch ( mode ) {
- case GL_CW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CW;
- break;
- case GL_CCW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= R200_FFACE_CULL_CCW;
+ if ( mode == GL_CCW )
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= R200_CULL_FRONT_IS_CCW;
- break;
- }
}
/* =============================================================
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c
index d930e76736a..e706f797c20 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -437,6 +437,7 @@ static void radeonCullFace( struct gl_context *ctx, GLenum unused )
static void radeonFrontFace( struct gl_context *ctx, GLenum mode )
{
r100ContextPtr rmesa = R100_CONTEXT(ctx);
+ int cull_face = (mode == GL_CW) ? RADEON_FFACE_CULL_CW : RADEON_FFACE_CULL_CCW;
RADEON_STATECHANGE( rmesa, set );
rmesa->hw.set.cmd[SET_SE_CNTL] &= ~RADEON_FFACE_CULL_DIR_MASK;
@@ -446,17 +447,11 @@ static void radeonFrontFace( struct gl_context *ctx, GLenum mode )
/* Winding is inverted when rendering to FBO */
if (ctx->DrawBuffer && _mesa_is_user_fbo(ctx->DrawBuffer))
- mode = (mode == GL_CW) ? GL_CCW : GL_CW;
+ cull_face = (mode == GL_CCW) ? RADEON_FFACE_CULL_CW : RADEON_FFACE_CULL_CCW;
+ rmesa->hw.set.cmd[SET_SE_CNTL] |= cull_face;
- switch ( mode ) {
- case GL_CW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CW;
- break;
- case GL_CCW:
- rmesa->hw.set.cmd[SET_SE_CNTL] |= RADEON_FFACE_CULL_CCW;
+ if ( mode == GL_CCW )
rmesa->hw.tcl.cmd[TCL_UCP_VERT_BLEND_CTL] |= RADEON_CULL_FRONT_IS_CCW;
- break;
- }
}