radeon: fix ColorMask
authorChristopher Egert <cme3000@gmail.com>
Sat, 8 Sep 2018 00:16:48 +0000 (02:16 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 10 Sep 2018 20:57:20 +0000 (16:57 -0400)
Since commit af3685d14936844f79e6f372b4b258e29375f21b various OpenGL applications regressed
on the classic mesa radeon driver.

Signed-off-by: Christopher Egert <cme3000@gmail.com>
CC: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/radeon/radeon_state.c

index d53225d63abe9409e0ef4a9c85b81ffd3e867e9b..b4cff8c259247bd5602d51345ec2ef05f3acff0f 100644 (file)
@@ -688,10 +688,10 @@ static void r200ColorMask( struct gl_context *ctx,
    if (!rrb)
      return;
    mask = radeonPackColor( rrb->cpp,
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0),
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1),
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2),
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3) );
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0)*0xFF,
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1)*0xFF,
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2)*0xFF,
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3)*0xFF );
 
 
    if (!(r && g && b && a))
index 8b72c98a3b22352d2682f7370b5fa37042b41d44..410a78fc0848647365ec0d9775f228d390a4d51d 100644 (file)
@@ -503,10 +503,10 @@ static void radeonColorMask( struct gl_context *ctx,
      return;
 
    mask = radeonPackColor( rrb->cpp,
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0),
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1),
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2),
-                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3) );
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 0)*0xFF,
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 1)*0xFF,
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 2)*0xFF,
+                          GET_COLORMASK_BIT(ctx->Color.ColorMask, 0, 3)*0xFF );
 
    if ( rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK] != mask ) {
       RADEON_STATECHANGE( rmesa, msk );