From 71b2504e0390fa19f133647c8686d830f8f40eb6 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 May 2006 09:03:35 +0000 Subject: updates to dri drivers for recent stencil changes --- src/mesa/drivers/dri/sis/sis_clear.c | 7 ++++--- src/mesa/drivers/dri/sis/sis_state.c | 2 +- src/mesa/drivers/dri/sis/sis_stencil.c | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/sis') diff --git a/src/mesa/drivers/dri/sis/sis_clear.c b/src/mesa/drivers/dri/sis/sis_clear.c index d7807b157e..637d502381 100644 --- a/src/mesa/drivers/dri/sis/sis_clear.c +++ b/src/mesa/drivers/dri/sis/sis_clear.c @@ -133,7 +133,8 @@ sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all, if ((smesa->current.hwCapEnable2 & (MASK_AlphaMaskWriteEnable | MASK_ColorMaskWriteEnable) && (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0) || - (ctx->Stencil.WriteMask[0] < 0xff && (mask & BUFFER_BIT_STENCIL) != 0) ) + ((ctx->Stencil.WriteMask[0] & 0xff) != 0xff && + (mask & BUFFER_BIT_STENCIL) != 0) ) { mask = sis_3D_Clear( ctx, mask, x1, y1, width1, height1 ); } @@ -213,13 +214,13 @@ sis_3D_Clear( GLcontext * ctx, GLbitfield mask, if (bClrStencil) { dwSten1 = STENCIL_FORMAT_8 | SiS_STENCIL_ALWAYS | - (ctx->Stencil.Clear << 8) | 0xff; + ((ctx->Stencil.Clear & 0xff) << 8) | 0xff; dwSten2 = SiS_SFAIL_REPLACE | SiS_SPASS_ZFAIL_REPLACE | SiS_SPASS_ZPASS_REPLACE; dwEnable1 = MASK_ZWriteEnable | MASK_StencilWriteEnable | MASK_StencilTestEnable; dwEnable2 |= MASK_ZMaskWriteEnable; - dwDepthMask |= ctx->Stencil.WriteMask[0] << 24; + dwDepthMask |= (ctx->Stencil.WriteMask[0] & 0xff) << 24; } else if (bClrDepth) { dwEnable1 = MASK_ZWriteEnable; dwEnable2 |= MASK_ZMaskWriteEnable; diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index 1a4c324115..a30001c746 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -251,7 +251,7 @@ sisDDDepthMask( GLcontext * ctx, GLboolean flag ) if (ctx->Visual.stencilBits) { if (flag || (ctx->Stencil.WriteMask[0] != 0)) { current->hwCapEnable |= MASK_ZWriteEnable; - if (flag && (ctx->Stencil.WriteMask[0] == 0xff)) { + if (flag && ((ctx->Stencil.WriteMask[0] & 0xff) == 0xff)) { current->hwCapEnable2 &= ~MASK_ZMaskWriteEnable; } else { current->hwCapEnable2 |= MASK_ZMaskWriteEnable; diff --git a/src/mesa/drivers/dri/sis/sis_stencil.c b/src/mesa/drivers/dri/sis/sis_stencil.c index 1febe86b94..a1ce2966e8 100644 --- a/src/mesa/drivers/dri/sis/sis_stencil.c +++ b/src/mesa/drivers/dri/sis/sis_stencil.c @@ -45,8 +45,9 @@ sisDDStencilFuncSeparate( GLcontext * ctx, GLenum face, __GLSiSHardware *current = &smesa->current; /* set reference */ - current->hwStSetting = STENCIL_FORMAT_8 | (ctx->Stencil.Ref[0] << 8) | - ctx->Stencil.ValueMask[0]; + current->hwStSetting = (STENCIL_FORMAT_8 | + ((ctx->Stencil.Ref[0] & 0xff) << 8) | + (ctx->Stencil.ValueMask[0] & 0xff)); switch (func) { -- cgit v1.2.3