mesa: check for unchanged line width before error checking

Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Brian Paul 2015-10-21 13:58:04 -06:00
parent 990afdc045
commit df0f817e31
1 changed files with 4 additions and 3 deletions

View 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;