summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVladimir Dergachev <[email protected]>2005-03-05 06:10:09 +0000
committerVladimir Dergachev <[email protected]>2005-03-05 06:10:09 +0000
commit3f9467c946ab79cd2ccb1858e78af4337f3603e2 (patch)
tree7e5adc768bba2115e17073aca3423d7a11e6dfb4 /src
parent1bb14ad90c1bf88b45478a40f4c7d8b706070fdb (diff)
Do properly initialize ALPHA_TEST register instead of carefully preserving bogus value. This fixes many, many rendering issues which I wrongly blamed on texture programming or performance..
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index ad2f754d8c1..60ab460996a 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -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 */