From 300926def04afc76d67ce964f10247b2e787c5dc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 21 Jul 2015 18:44:07 -0600 Subject: [PATCH] mesa: move check for no-op glShadeModel call earlier Reviewed-by: Anuj Phogat Reviewed-by: Ian Romanick --- src/mesa/main/light.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.30.2