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

Eric Anholt eric at anholt.net
Mon Jul 20 11:53:35 PDT 2015


Brian Paul <brianp at vmware.com> writes:

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

Patches 1-3 are:

Reviewed-by: Eric Anholt <eric at anholt.net>

I'm pretty skeptical of adding the memcmp in 6/6, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150720/a7d68f3a/attachment.sig>


More information about the mesa-dev mailing list