Mesa (master): r600: fix two sided stencil

Alex Deucher agd5f at kemper.freedesktop.org
Wed Aug 26 17:33:28 UTC 2009


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

Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Wed Aug 26 13:33:06 2009 -0400

r600: fix two sided stencil

---

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

diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c
index efa1daf..30cf2dd 100644
--- a/src/mesa/drivers/dri/r600/r700_state.c
+++ b/src/mesa/drivers/dri/r600/r700_state.c
@@ -947,9 +947,6 @@ static void r700SetStencilState(GLcontext * ctx, GLboolean state)
 	R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
 	GLboolean hw_stencil = GL_FALSE;
 
-	//fixme
-	//r300CatchStencilFallback(ctx);
-
 	if (ctx->DrawBuffer) {
 		struct radeon_renderbuffer *rrbStencil
 			= radeon_get_renderbuffer(ctx->DrawBuffer, BUFFER_STENCIL);
@@ -958,9 +955,10 @@ static void r700SetStencilState(GLcontext * ctx, GLboolean state)
 
 	if (hw_stencil) {
 		R600_STATECHANGE(context, db);
-		if (state)
+		if (state) {
 			SETbit(r700->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit);
-		else
+			SETbit(r700->DB_DEPTH_CONTROL.u32All, BACKFACE_ENABLE_bit);
+		} else
 			CLEARbit(r700->DB_DEPTH_CONTROL.u32All, STENCIL_ENABLE_bit);
 	}
 }
@@ -972,10 +970,8 @@ static void r700StencilFuncSeparate(GLcontext * ctx, GLenum face,
 	R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
 	const unsigned back = ctx->Stencil._BackFace;
 
-	//fixme
-	//r300CatchStencilFallback(ctx);
-
 	R600_STATECHANGE(context, stencil);
+	R600_STATECHANGE(context, db);
 
 	//front
 	SETfield(r700->DB_STENCILREFMASK.u32All, ctx->Stencil.Ref[0],
@@ -1003,9 +999,6 @@ static void r700StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) /
 	R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
 	const unsigned back = ctx->Stencil._BackFace;
 
-	//fixme
-	//r300CatchStencilFallback(ctx);
-
 	R600_STATECHANGE(context, stencil);
 
 	// front
@@ -1025,9 +1018,6 @@ static void r700StencilOpSeparate(GLcontext * ctx, GLenum face,
 	R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
 	const unsigned back = ctx->Stencil._BackFace;
 
-	//fixme
-	//r300CatchStencilFallback(ctx);
-
 	R600_STATECHANGE(context, db);
 
 	SETfield(r700->DB_DEPTH_CONTROL.u32All, translate_stencil_op(ctx->Stencil.FailFunc[0]),




More information about the mesa-commit mailing list