Mesa (master): mesa: move check for no-op glShadeModel call earlier
Brian Paul
brianp at kemper.freedesktop.org
Wed Jul 22 00:46:22 UTC 2015
Module: Mesa
Branch: master
Commit: 300926def04afc76d67ce964f10247b2e787c5dc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=300926def04afc76d67ce964f10247b2e787c5dc
Author: Brian Paul <brianp at vmware.com>
Date: Tue Jul 21 18:44:07 2015 -0600
mesa: move check for no-op glShadeModel call earlier
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
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 dab21d1..89b1c4b 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;
More information about the mesa-commit
mailing list