summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2005-01-11 16:42:56 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2005-01-11 16:42:56 +0000
commitf29aaf80a47e28f03cd60ebba0948961e8a73524 (patch)
tree79e6ac173cb678a6f03adbc6eec1b3677b1e3959 /src/mesa
parentcdb65416342d5ca9635685b898c68a76f4a6e862 (diff)
Fix ColorMask
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_state.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c
index 6b16a17f96..a40aba4369 100644
--- a/src/mesa/drivers/dri/unichrome/via_state.c
+++ b/src/mesa/drivers/dri/unichrome/via_state.c
@@ -1320,8 +1320,18 @@ static void viaChooseColorState(GLcontext *ctx)
else
vmesa->regHROP = HC_HROP_P;
- vmesa->regHFBBMSKL = (*(GLuint *)&ctx->Color.ColorMask[0]) & 0xFFFFFF;
- vmesa->regHROP |= ctx->Color.ColorMask[3];
+ if (vmesa->viaScreen->bitsPerPixel == 32) {
+ vmesa->regHFBBMSKL = PACK_COLOR_888(ctx->Color.ColorMask[0],
+ ctx->Color.ColorMask[1],
+ ctx->Color.ColorMask[2]);
+ vmesa->regHROP |= ctx->Color.ColorMask[3];
+ } else {
+ GLushort color = PACK_COLOR_565(ctx->Color.ColorMask[0],
+ ctx->Color.ColorMask[1],
+ ctx->Color.ColorMask[2]);
+ vmesa->regHFBBMSKL = (color & 0xFF) << 16;
+ vmesa->regHROP |= (color & 0xFF00) >> 8;
+ }
if (ctx->Color.ColorMask[3])
vmesa->regEnable |= HC_HenAW_MASK;
@@ -1607,12 +1617,14 @@ void viaValidateState( GLcontext *ctx )
* are incorrectly writen to the z buffer. This is a pretty big
* slowdown, it would be good to find out this wasn't necessary:
*/
+#if 0
if (vmesa->viaScreen->deviceID == VIA_CLE266) {
GLboolean fallback = (ctx->Color.AlphaEnabled &&
ctx->Color.AlphaFunc != GL_ALWAYS &&
ctx->Depth.Mask);
FALLBACK( vmesa, VIA_FALLBACK_ALPHATEST, fallback );
}
+#endif
vmesa->newEmitState |= vmesa->newState;
vmesa->newState = 0;