From: Ian Romanick Date: Wed, 29 Apr 2015 20:15:06 +0000 (-0700) Subject: glapi/es3.1: Add support for GLES versions > 3.0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c5a57aee109ef513df0d281aadc69db293cc3d8;p=mesa.git glapi/es3.1: Add support for GLES versions > 3.0 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 Reviewed-by: Jordan Justen --- diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py index 7151f0de1b5..e58cdfc512a 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))) else: condition_parts.append('ctx->API == API_OPENGLES2') if not condition_parts: