[Mesa-dev] [PATCH 17/20] glapi/es3.1: Add support for GLES versions > 3.0

Jordan Justen jordan.l.justen at intel.com
Thu Apr 30 10:10:45 PDT 2015


On 2015-04-29 16:26:08, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Make the checks in the Python script and the generated code more generic
> to support arbitrary GLES versions >= 2.0.
> 
> The updated dispatch_sanity.cpp test discovered this problem.  Without
> this, the next patch would erroneously enable GLES 3.1 functions in GLES
> 2.0 and GLES 3.0.
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mapi/glapi/gen/gl_genexec.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py
> index 7151f0d..e58cdfc 100644
> --- a/src/mapi/glapi/gen/gl_genexec.py
> +++ b/src/mapi/glapi/gen/gl_genexec.py
> @@ -183,8 +183,8 @@ class PrintCode(gl_XML.gl_print_base):
>              if 'es1' in f.api_map:
>                  condition_parts.append('ctx->API == API_OPENGLES')
>              if 'es2' in f.api_map:
> -                if f.api_map['es2'] == 3:
> -                    condition_parts.append('_mesa_is_gles3(ctx)')
> +                if f.api_map['es2'] > 2.0:
> +                    condition_parts.append('(ctx->API == API_OPENGLES2 && ctx->Version >= {})'.format(int(f.api_map['es2'] * 10)))

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

But, I think we could consider renaming _mesa_is_gles3 =>
_mesa_is_gles30, adding _mesa_is_gles31 and then using:

> +                    condition_parts.append('_mesa_is_gles{}(ctx)'.format(int(f.api_map['es2'] * 10)))

-Jordan

>                  else:
>                      condition_parts.append('ctx->API == API_OPENGLES2')
>              if not condition_parts:
> -- 
> 2.1.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list