From: Brian Paul Date: Wed, 22 Jul 2015 00:44:07 +0000 (-0600) Subject: mesa: move check for no-op glShadeModel call earlier X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=300926def04afc76d67ce964f10247b2e787c5dc;p=mesa.git mesa: move check for no-op glShadeModel call earlier Reviewed-by: Anuj Phogat Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index dab21d1a634..89b1c4b142f 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -44,14 +44,14 @@ _mesa_ShadeModel( GLenum mode ) if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glShadeModel %s\n", _mesa_enum_to_string(mode)); + if (ctx->Light.ShadeModel == mode) + return; + if (mode != GL_FLAT && mode != GL_SMOOTH) { _mesa_error(ctx, GL_INVALID_ENUM, "glShadeModel"); return; } - if (ctx->Light.ShadeModel == mode) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); ctx->Light.ShadeModel = mode;