r300: replace some hard coded mask by define in stencil area
authorChristoph Brill <egore911@egore911.de>
Tue, 4 Mar 2008 20:52:49 +0000 (21:52 +0100)
committerChristoph Brill <egore911@egore911.de>
Tue, 4 Mar 2008 20:52:49 +0000 (21:52 +0100)
src/mesa/drivers/dri/r300/r300_state.c

index d10242fa1f71c212424f884b39a89863ba08c816..ec9bf25bab325cc6a9c6353b2bb798fa039be250 100644 (file)
@@ -957,7 +957,8 @@ static void r300StencilMaskSeparate(GLcontext * ctx, GLenum face, GLuint mask)
              ZB_STENCILREFMASK_STENCILWRITEMASK_SHIFT);
        rmesa->hw.zs.cmd[R300_ZS_CNTL_2] |=
            (ctx->Stencil.
-            WriteMask[0] & 0xff) << ZB_STENCILREFMASK_STENCILWRITEMASK_SHIFT;
+            WriteMask[0] & ZB_STENCILREFMASK_STENCIL_MASK) <<
+            ZB_STENCILREFMASK_STENCILWRITEMASK_SHIFT;
 }
 
 static void r300StencilOpSeparate(GLcontext * ctx, GLenum face,
@@ -1004,11 +1005,10 @@ static void r300ClearStencil(GLcontext * ctx, GLint s)
        r300ContextPtr rmesa = R300_CONTEXT(ctx);
 
        rmesa->state.stencil.clear =
-           ((GLuint) (ctx->Stencil.Clear & 0xff) |
-            (ZB_STENCILREFMASK_STENCIL_MASK <<
-             ZB_STENCILREFMASK_STENCILMASK_SHIFT) | ((ctx->Stencil.
-                                                   WriteMask[0] & 0xff) <<
-                                                  ZB_STENCILREFMASK_STENCILMASK_SHIFT));
+           ((GLuint) (ctx->Stencil.Clear & ZB_STENCILREFMASK_STENCIL_MASK) |
+            (ZB_STENCILREFMASK_STENCIL_MASK << ZB_STENCILREFMASK_STENCILMASK_SHIFT) |
+            ((ctx->Stencil.WriteMask[0] & ZB_STENCILREFMASK_STENCIL_MASK) <<
+               ZB_STENCILREFMASK_STENCILMASK_SHIFT));
 }
 
 /* =============================================================