[Mesa-dev] [PATCH] mesa: Make glGetStringi(GL_EXTENSIONS, n) respect API

Ian Romanick idr at freedesktop.org
Tue Sep 4 11:12:20 PDT 2012


On 09/04/2012 10:19 AM, Chad Versace wrote:
> The function did not respect the context's API, and so returned internally
> enabled GLES extensions from GL contexts.

Does glGetIntegerv(GL_NUM_EXTENSIONS) return the correct count?

> Note: This is a candidate for the 7.11, 8.0, and 8.0 branches.

This is a 3.0 function, so it shouldn't be needed in 7.11.  I think you 
also meant 9.0 (instead of 8.0 twice).

> CC: Kenneth Graunke <kenneth at whitecape.org>
> CC: Jordan Justen <jordan.l.justen at intel.com>
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
>   src/mesa/main/extensions.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index 7e116bd..fcb8a87 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -947,7 +947,9 @@ _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index)
>      base = (GLboolean*) &ctx->Extensions;
>      n = 0;
>      for (i = extension_table; i->name != 0; ++i) {
> -      if (n == index && base[i->offset]) {
> +      if (n == index
> +          && base[i->offset]
> +          && (i->api_set & (1 << ctx->API))) {
>   	 return (const GLubyte*) i->name;
>         } else if (base[i->offset]) {
>   	 ++n;
>



More information about the mesa-dev mailing list