Do properly initialize ALPHA_TEST register instead of carefully preserving bogus...
authorVladimir Dergachev <volodya@freedesktop.org>
Sat, 5 Mar 2005 06:10:09 +0000 (06:10 +0000)
committerVladimir Dergachev <volodya@freedesktop.org>
Sat, 5 Mar 2005 06:10:09 +0000 (06:10 +0000)
src/mesa/drivers/dri/r300/r300_state.c

index ad2f754d8c100aaef610f1a94ff90d04a65b0385..60ab460996a893a9ee94d8c73e8ccde2a2f9989b 100644 (file)
@@ -69,7 +69,7 @@ static void r300AlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref)
        GLubyte refByte;
 
        CLAMPED_FLOAT_TO_UBYTE(refByte, ref);
-
+       
        R300_STATECHANGE(rmesa, at);
 
        pp_misc &= ~(R300_ALPHA_TEST_OP_MASK | R300_REF_ALPHA_MASK);
@@ -1997,8 +1997,12 @@ void r300ResetHwState(r300ContextPtr r300)
        r300SetupPixelShader(r300);
 
        r300_set_blend_state(ctx);
-       r300AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef);
 
+       r300->hw.at.cmd[R300_AT_ALPHA_TEST] = 0;
+       r300AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef);
+       if(ctx->Color.AlphaEnabled)
+               r300->hw.at.cmd[R300_AT_ALPHA_TEST] |= R300_ALPHA_TEST_ENABLE;
+               
                /* Initialize magic registers
                 TODO : learn what they really do, or get rid of
                 those we don't have to touch */