[Mesa-dev] [PATCH 3/6] mesa: move check for no-op glShadeModel call earlier

Brian Paul brianp at vmware.com
Fri Jul 17 17:48:40 PDT 2015


---
 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 4021dbe..f215c93 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_lookup_enum_by_nr(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;
 
-- 
1.9.1



More information about the mesa-dev mailing list