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

Ian Romanick idr at freedesktop.org
Mon Jul 20 11:27:58 PDT 2015


Patches 1, 2, and 3 are

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

The other patches look correct too, but the whole series is
optimizations, so do you have any before / after performance data?

On 07/17/2015 05:48 PM, Brian Paul wrote:
> If the new mode matches the current mode, there can be no error.
> ---
>  src/mesa/main/polygon.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
> index a1f0aa0..6be6f33 100644
> --- a/src/mesa/main/polygon.c
> +++ b/src/mesa/main/polygon.c
> @@ -93,14 +93,14 @@ _mesa_FrontFace( GLenum mode )
>     if (MESA_VERBOSE&VERBOSE_API)
>        _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
>  
> +   if (ctx->Polygon.FrontFace == mode)
> +      return;
> +
>     if (mode!=GL_CW && mode!=GL_CCW) {
>        _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
>        return;
>     }
>  
> -   if (ctx->Polygon.FrontFace == mode)
> -      return;
> -
>     FLUSH_VERTICES(ctx, _NEW_POLYGON);
>     ctx->Polygon.FrontFace = mode;
>  
> 



More information about the mesa-dev mailing list