summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/sis
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2006-05-08 09:03:35 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2006-05-08 09:03:35 +0000
commit71b2504e0390fa19f133647c8686d830f8f40eb6 (patch)
tree21b31e5e240f5bd83fa5b7d8a1907e4f6f6ecb3c /src/mesa/drivers/dri/sis
parent960973b2ecfffc3b09563851e86c863e5304f48f (diff)
updates to dri drivers for recent stencil changes
Diffstat (limited to 'src/mesa/drivers/dri/sis')
-rw-r--r--src/mesa/drivers/dri/sis/sis_clear.c7
-rw-r--r--src/mesa/drivers/dri/sis/sis_state.c2
-rw-r--r--src/mesa/drivers/dri/sis/sis_stencil.c5
3 files changed, 8 insertions, 6 deletions
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)
{