fix #8008
authorAapo Tahkola <aet@rasterburn.org>
Sat, 26 Aug 2006 16:24:04 +0000 (16:24 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Sat, 26 Aug 2006 16:24:04 +0000 (16:24 +0000)
src/mesa/drivers/dri/r300/r300_state.c

index 05c5f70c70559f29a6fd409e2b33fda886dfc3fa..606729e683e31e2187e0c40c56fe37181bc29815 100644 (file)
@@ -341,7 +341,7 @@ static void update_early_z(GLcontext *ctx)
                /* disable early Z */
                r300->hw.unk4F10.cmd[2] = 0x00000000;
        else {
-               if (ctx->Depth.Test && ctx->Depth.Func != GL_ALWAYS)
+               if (ctx->Depth.Test && ctx->Depth.Func != GL_NEVER)
                        /* enable early Z */
                        r300->hw.unk4F10.cmd[2] = 0x00000001;
                else
@@ -438,7 +438,7 @@ static void update_depth(GLcontext* ctx)
        r300->hw.zs.cmd[R300_ZS_CNTL_0] &= R300_RB3D_STENCIL_ENABLE;
        r300->hw.zs.cmd[R300_ZS_CNTL_1] &= ~(R300_ZS_MASK << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT);
        
-       if (ctx->Depth.Test && ctx->Depth.Func != GL_ALWAYS) {
+       if (ctx->Depth.Test && ctx->Depth.Func != GL_NEVER) {
                if (ctx->Depth.Mask)
                        r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_TEST_AND_WRITE;
                else
@@ -446,12 +446,8 @@ static void update_depth(GLcontext* ctx)
                
                r300->hw.zs.cmd[R300_ZS_CNTL_1] |= translate_func(ctx->Depth.Func) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
        } else {
-               if (ctx->Depth.Mask) {
-                       r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_WRITE_ONLY;
-                       r300->hw.zs.cmd[R300_ZS_CNTL_1] |= translate_func(GL_ALWAYS) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
-               } else {
-                       r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_DISABLED_1;
-               }
+               r300->hw.zs.cmd[R300_ZS_CNTL_0] |= R300_RB3D_Z_DISABLED_1;
+               r300->hw.zs.cmd[R300_ZS_CNTL_1] |= translate_func(GL_NEVER) << R300_RB3D_ZS1_DEPTH_FUNC_SHIFT;
        }
        
        update_early_z(ctx);