From 701ccf6f290cddfa09686c12f728dab150029f80 Mon Sep 17 00:00:00 2001 From: Christoph Brill Date: Tue, 4 Mar 2008 21:37:56 +0100 Subject: [PATCH] r300: Fix some issues with masks in stencil buffer area --- src/mesa/drivers/dri/r300/r300_reg.h | 5 +++-- src/mesa/drivers/dri/r300/r300_state.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index fc7a9526604..0d78fb8e84e 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -2262,6 +2262,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define ZB_STENCILREFMASK 0x4f08 # define ZB_STENCILREFMASK_STENCILREF_SHIFT 0 +# define ZB_STENCILREFMASK_STENCIL_MASK 0xff # define ZB_STENCILREFMASK_STENCILREF_MASK 0x000000ff # define ZB_STENCILREFMASK_STENCILMASK_SHIFT 8 # define ZB_STENCILREFMASK_STENCILMASK_MASK 0x0000ff00 @@ -2290,8 +2291,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE (1 << 0) # define ZB_ZCACHE_CTLSTAT_ZC_FREE_NO_EFFECT (0 << 1) # define ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE (1 << 1) -# define ZB_ZCACHE_CTLSTAT_ZC_BUSY_IDLE (0 << 1) -# define ZB_ZCACHE_CTLSTAT_ZC_BUSY_BUSY (1 << 1) +# define ZB_ZCACHE_CTLSTAT_ZC_BUSY_IDLE (0 << 31) +# define ZB_ZCACHE_CTLSTAT_ZC_BUSY_BUSY (1 << 31) #define R300_ZB_BW_CNTL 0x4f1c # define R300_HIZ_DISABLE (0 << 0) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 3cd009904e9..d10242fa1f7 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -932,8 +932,8 @@ static void r300StencilFuncSeparate(GLcontext * ctx, GLenum face, R300_RB3D_ZS1_BACK_FUNC_SHIFT)); rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= - ~((ZB_STENCILREFMASK_STENCILREF_MASK << ZB_STENCILREFMASK_STENCILREF_SHIFT) | - (ZB_STENCILREFMASK_STENCILMASK_MASK << ZB_STENCILREFMASK_STENCILMASK_SHIFT)); + ~((ZB_STENCILREFMASK_STENCIL_MASK << ZB_STENCILREFMASK_STENCILREF_SHIFT) | + (ZB_STENCILREFMASK_STENCIL_MASK << ZB_STENCILREFMASK_STENCILMASK_SHIFT)); flag = translate_func(ctx->Stencil.Function[0]); rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |= @@ -953,7 +953,7 @@ static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask) R300_STATECHANGE(rmesa, zs); rmesa->hw.zs.cmd[R300_ZS_CNTL_2] &= - ~(ZB_STENCILREFMASK_STENCILMASK_MASK << + ~(ZB_STENCILREFMASK_STENCIL_MASK << ZB_STENCILREFMASK_STENCILWRITEMASK_SHIFT); rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |= (ctx->Stencil. @@ -1005,7 +1005,7 @@ static void r300ClearStencil(GLcontext * ctx, GLint s) rmesa->state.stencil.clear = ((GLuint) (ctx->Stencil.Clear & 0xff) | - (ZB_STENCILREFMASK_STENCILMASK_MASK << + (ZB_STENCILREFMASK_STENCIL_MASK << ZB_STENCILREFMASK_STENCILMASK_SHIFT) | ((ctx->Stencil. WriteMask[0] & 0xff) << ZB_STENCILREFMASK_STENCILMASK_SHIFT)); -- 2.30.2