check for special cases of value = 0 or 1 in glAccum
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 19 Jun 2000 00:42:24 +0000 (00:42 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 19 Jun 2000 00:42:24 +0000 (00:42 +0000)
src/mesa/main/accum.c

index 6654a6314ba37834495b95dbcd702f1424f2959a..37967f21338fe7a6a535613db86b161e7e2c72b5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: accum.c,v 1.20 2000/04/05 14:40:04 brianp Exp $ */
+/* $Id: accum.c,v 1.21 2000/06/19 00:42:24 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -188,7 +188,7 @@ _mesa_Accum( GLenum op, GLfloat value )
 
    switch (op) {
       case GL_ADD:
-         {
+         if (value != 0.0F) {
            const GLaccum intVal = (GLaccum) (value * acc_scale);
            GLuint j;
             /* Leave optimized accum buffer mode */
@@ -206,7 +206,7 @@ _mesa_Accum( GLenum op, GLfloat value )
         break;
 
       case GL_MULT:
-        {
+         if (value != 1.0F) {
            GLuint j;
             /* Leave optimized accum buffer mode */
             if (ctx->IntegerAccumMode)
@@ -223,6 +223,9 @@ _mesa_Accum( GLenum op, GLfloat value )
         break;
 
       case GL_ACCUM:
+         if (value == 0.0F)
+            return;
+
          (*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
                                        ctx->Pixel.DriverReadBuffer );