Make glean's masked clear test pass.
authorFelix Kuehling <fxkuehl@gmx.de>
Sat, 12 Feb 2005 14:35:17 +0000 (14:35 +0000)
committerFelix Kuehling <fxkuehl@gmx.de>
Sat, 12 Feb 2005 14:35:17 +0000 (14:35 +0000)
src/mesa/drivers/dri/savage/savageioctl.c

index cd25b620f0dc53eadad7bf0f8b3cc2ffbab57cbc..707fcb6ffb5e24a5b42ff4ad5d0a762ec68bb75f 100644 (file)
@@ -32,6 +32,7 @@
 #include "dd.h"
 #include "context.h"
 #include "swrast/swrast.h"
+#include "colormac.h"
 
 #include "mm.h"
 #include "savagecontext.h"
@@ -346,8 +347,21 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
           clearDepth = (GLuint) ((1.0 - ctx->Depth.Clear) * DEPTH_SCALE_24);
    }
 
-   colorMask = *((GLuint *) &ctx->Color.ColorMask);
+   colorMask = 0;
    depthMask = 0;
+   switch (imesa->savageScreen->cpp) {
+   case 2:
+       colorMask = PACK_COLOR_565(ctx->Color.ColorMask[0],
+                                 ctx->Color.ColorMask[1],
+                                 ctx->Color.ColorMask[2]);
+       break;
+   case 4:
+       colorMask = PACK_COLOR_8888(ctx->Color.ColorMask[3],
+                                  ctx->Color.ColorMask[2],
+                                  ctx->Color.ColorMask[1],
+                                  ctx->Color.ColorMask[0]);
+       break;
+   }
 
    flags = 0;