r300: Fix some issues with masks in stencil buffer area
authorChristoph Brill <egore911@egore911.de>
Tue, 4 Mar 2008 20:37:56 +0000 (21:37 +0100)
committerChristoph Brill <egore911@egore911.de>
Tue, 4 Mar 2008 20:37:56 +0000 (21:37 +0100)
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_state.c

index fc7a95266042394e055d0b843787af8e396e225d..0d78fb8e84e8267a7e3b79334cb1b989ebb91a34 100644 (file)
@@ -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)
index 3cd009904e9bc102b20b3fba4876968fd1e6545c..d10242fa1f71c212424f884b39a89863ba08c816 100644 (file)
@@ -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));