[Mesa-dev] [PATCH 6/7] mesa: Update _mesa_has_geometry_shaders

Eduardo Lima Mitev elima at igalia.com
Wed Sep 23 04:36:36 PDT 2015


On 09/23/2015 10:42 AM, Marta Lofstedt wrote:
> From: Marta Lofstedt <marta.lofstedt at intel.com>
> 
> Updates the _mesa_has_geometry_shaders function to also look
> for OpenGL ES 3.1 contexts that has OES_geometry_shader enabled.
> ---
>  src/mesa/main/context.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
> index 0f7529a..6ce048a 100644
> --- a/src/mesa/main/context.h
> +++ b/src/mesa/main/context.h
> @@ -328,8 +328,11 @@ _mesa_is_gles31(const struct gl_context *ctx)
>  static inline bool
>  _mesa_has_geometry_shaders(const struct gl_context *ctx)
>  {
> -   return _mesa_is_desktop_gl(ctx) &&
> -      (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4);
> +   return (_mesa_is_gles31(ctx) &&
> +           ctx->Extensions.OES_geometry_shader) ||
> +           (_mesa_is_desktop_gl(ctx) &&
> +           (ctx->Version >= 32 ||
> +           ctx->Extensions.ARB_geometry_shader4));

I think there is unnecessary line breaking, what about:

return (_mesa_is_gles31(ctx) && ctx->Extensions.OES_geometry_shader) ||
       (_mesa_is_desktop_gl(ctx) &&
       (ctx->Version >= 32 || ctx->Extensions.ARB_geometry_shader4));

With this format, longest line is still 74 columns long, which is ok.
Not a big deal actually, so feel free to ignore it.

Reviewed-by: Eduardo Lima Mitev <elima at igalia.com>

>  }
>
>



More information about the mesa-dev mailing list