<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 20, 2015 at 8:26 AM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery <<a href="mailto:nanleychery@gmail.com">nanleychery@gmail.com</a>> wrote:<br>
> From: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
><br>
> Generate functions which determine if an extension is supported in the<br>
> current context. Initially, enums were going to be explicitly used with<br>
> _mesa_extension_supported(). The idea to embed the function and enums<br>
> into generated helper functions was suggested by Kristian Høgsberg.<br>
><br>
> For performance, the function body no longer uses<br>
> _mesa_extension_supported() and, as suggested by Chad Versace, the<br>
> functions are also declared static inline.<br>
><br>
> Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
> ---<br>
> src/mesa/main/context.h | 1 +<br>
> src/mesa/main/extensions.c | 22 +---------------------<br>
> src/mesa/main/extensions.h | 39 +++++++++++++++++++++++++++++++++++++++<br>
> 3 files changed, 41 insertions(+), 21 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h<br>
> index 1e7a12c..4798b1f 100644<br>
> --- a/src/mesa/main/context.h<br>
> +++ b/src/mesa/main/context.h<br>
> @@ -50,6 +50,7 @@<br>
><br>
><br>
> #include "imports.h"<br>
> +#include "extensions.h"<br>
> #include "mtypes.h"<br>
> #include "vbo/vbo.h"<br>
><br>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c<br>
> index 9451085..136313f 100644<br>
> --- a/src/mesa/main/extensions.c<br>
> +++ b/src/mesa/main/extensions.c<br>
> @@ -42,26 +42,6 @@ struct gl_extensions _mesa_extension_override_disables;<br>
> static char *extra_extensions = NULL;<br>
> static char *cant_disable_extensions = NULL;<br>
><br>
> -/**<br>
> - * \brief An element of the \c extension_table.<br>
> - */<br>
> -struct extension {<br>
> - /** Name of extension, such as "GL_ARB_depth_clamp". */<br>
> - const char *name;<br>
> -<br>
> - /** Offset (in bytes) of the corresponding member in struct gl_extensions. */<br>
> - size_t offset;<br>
> -<br>
> - /** Minimum version the extension requires for the given API<br>
> - * (see gl_api defined in mtypes.h)<br>
> - */<br>
> - GLuint version[API_OPENGL_LAST + 1];<br>
> -<br>
> - /** Year the extension was proposed or approved. Used to sort the<br>
> - * extension string chronologically. */<br>
> - uint16_t year;<br>
> -};<br>
> -<br>
><br>
> /**<br>
> * Given a member \c x of struct gl_extensions, return offset of<br>
> @@ -73,7 +53,7 @@ struct extension {<br>
> /**<br>
> * \brief Table of supported OpenGL extensions for all API's.<br>
> */<br>
> -static const struct extension extension_table[] = {<br>
> +const struct extension extension_table[] = {<br>
> #define EXT(name_str, driver_cap, gll_ver, glc_ver, gles_ver, gles2_ver, yyyy) \<br>
> { .name = "GL_" #name_str, .offset = o(driver_cap), \<br>
> .version = { \<br>
> diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h<br>
> index 595512a..24cc04d 100644<br>
> --- a/src/mesa/main/extensions.h<br>
> +++ b/src/mesa/main/extensions.h<br>
> @@ -55,6 +55,45 @@ _mesa_get_extension_count(struct gl_context *ctx);<br>
> extern const GLubyte *<br>
> _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index);<br>
><br>
> +<br>
> +/**<br>
> + * \brief An element of the \c extension_table.<br>
> + */<br>
> +struct extension {<br>
> + /** Name of extension, such as "GL_ARB_depth_clamp". */<br>
> + const char *name;<br>
> +<br>
> + /** Offset (in bytes) of the corresponding member in struct gl_extensions. */<br>
> + size_t offset;<br>
> +<br>
> + /** Minimum version the extension requires for the given API<br>
> + * (see gl_api defined in mtypes.h)<br>
> + */<br>
> + GLuint version[API_OPENGL_LAST + 1];<br>
> +<br>
> + /** Year the extension was proposed or approved. Used to sort the<br>
> + * extension string chronologically. */<br>
> + uint16_t year;<br>
> +} extern const extension_table[];<br>
<br>
</div></div>Global variables should have a proper prefix.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>I'll send out an update for this.<br><br></div><div>Thanks,<br></div><div>Nanley <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
Marek<br>
</font></span></blockquote></div><br></div></div>