fix GL_BACK color material bug
[mesa.git] / src / mesa / drivers / glide / fxsetup.c
index e8c75b7c4a16ffa7537c365424c1101643381622..f1a56650bdef4a24feeb3f205c870340c0e374e3 100644 (file)
@@ -1384,12 +1384,14 @@ static void fxSetupDepthTest(GLcontext *ctx)
   fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
   tfxUnitsState *us=&fxMesa->unitsState;
 
-  if(us->depthTestEnabled)
+  if (us->depthTestEnabled) {
      FX_grDepthBufferFunction(us->depthTestFunc);
-  else
+     FX_grDepthMask(us->depthMask);
+  }
+  else {
      FX_grDepthBufferFunction(GR_CMP_ALWAYS);
-
-  FX_grDepthMask(us->depthMask);
+     FX_grDepthMask(FXFALSE);
+  }
 }
 
 /************************************************************************/
@@ -1411,14 +1413,20 @@ static void fxSetupColorMask(GLcontext *ctx)
 {
   fxMesaContext fxMesa = FX_CONTEXT(ctx);
 
-  FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
-             ctx->Color.ColorMask[GCOMP] ||
-             ctx->Color.ColorMask[BCOMP],
-             ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
+  if (ctx->Color.DrawBuffer == GL_NONE) {
+    FX_grColorMask(FXFALSE, FXFALSE);
+  }
+  else {
+    FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
+                   ctx->Color.ColorMask[GCOMP] ||
+                   ctx->Color.ColorMask[BCOMP],
+                   ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
+  }
 }
 
 
 
+
 /************************************************************************/
 /**************************** Fog Mode SetUp ****************************/
 /************************************************************************/