16bpp doesn't support masked clears, so fallback when they're enabled.
authorAlan Hourihane <alanh@tungstengraphics.com>
Fri, 14 Jan 2005 13:02:53 +0000 (13:02 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Fri, 14 Jan 2005 13:02:53 +0000 (13:02 +0000)
src/mesa/drivers/dri/unichrome/via_ioctl.c

index c7b616f405762cf8353a3123ec6378922cb88d32..7e7b933becbea9ce153ccb714c15d78ba035cc42 100644 (file)
@@ -242,6 +242,16 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
         }
       }
    }
+
+   /* 16bpp doesn't support masked clears */
+   if (vmesa->viaScreen->bytesPerPixel == 2 &&
+       vmesa->ClearMask & 0xf0000000) {
+      if (flag & VIA_FRONT)
+         mask |= DD_FRONT_LEFT_BIT;
+      if (flag & VIA_BACK)
+         mask |= DD_BACK_LEFT_BIT;
+      flag &= ~(VIA_FRONT | VIA_BACK);
+   }
     
    if (flag) {
       drm_clip_rect_t *boxes, *tmp_boxes = 0;