mesa: check for unchanged line width before error checking
authorBrian Paul <brianp@vmware.com>
Wed, 21 Oct 2015 19:58:04 +0000 (13:58 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 22 Oct 2015 23:19:20 +0000 (17:19 -0600)
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/main/lines.c

index c020fb3eb9e70b55b8cd0bbe4fa6cbf13f44e717..93b80af0dc42d0343cfd69cb9893a1bec1e53672 100644 (file)
@@ -45,6 +45,10 @@ _mesa_LineWidth( GLfloat width )
    if (MESA_VERBOSE & VERBOSE_API)
       _mesa_debug(ctx, "glLineWidth %f\n", width);
 
+   /* If width is unchanged, there can't be an error */
+   if (ctx->Line.Width == width)
+      return;
+
    if (width <= 0.0F) {
       _mesa_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
       return;
@@ -68,9 +72,6 @@ _mesa_LineWidth( GLfloat width )
       return;
    }
 
-   if (ctx->Line.Width == width)
-      return;
-
    FLUSH_VERTICES(ctx, _NEW_LINE);
    ctx->Line.Width = width;