<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 22, 2015 at 3:19 AM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On 19 October 2015 at 23:36, 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>
> Create a function which determines if an extension is supported in the<br>
> current context.<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/extensions.c | 17 +++++++++++++++++<br>
> 1 file changed, 17 insertions(+)<br>
><br>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c<br>
> index 390e026..7137bc9 100644<br>
> --- a/src/mesa/main/extensions.c<br>
> +++ b/src/mesa/main/extensions.c<br>
> @@ -423,6 +423,23 @@ typedef unsigned short extension_index;<br>
><br>
><br>
> /**<br>
> + * Given an extension enum, return whether or not the extension is supported<br>
> + * dependent on the following factors:<br>
> + * There's driver support and the OpenGL/ES version is at least that<br>
> + * specified in the extension_table.<br>
> + */<br>
> +static inline bool<br>
> +_mesa_extension_supported(const struct gl_context *ctx, extension_index ei)<br>
> +{<br>
> + const bool *base = (bool *) &ctx->Extensions;<br>
> + const struct extension *i = extension_table + ei;<br>
> + const uint8_t api_set = 1 << ctx->API;<br>
> + return (i->api_set & api_set) &&<br>
> + (ctx->Version >= i->version[ctx->API]) &&<br>
> + base[i->offset];<br>
</div></div>Bikeshed: I realise that you're copying most of these, but wouldn't it<br>
be better if we use more common/intuitive variable names ?<br>
<br>
ei -> i or idx<br>
i -> ext<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div><br><div>Yes, I was mostly copying what was around. Thanks for the variable name<br></div>suggestions. I'll update this function.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><font color="#888888">
-Emil<br>
</font></span></blockquote></div><br></div></div>