diff options
author | Chad Versace <[email protected]> | 2012-09-04 10:02:43 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2012-09-06 11:48:51 -0700 |
commit | d788066575828ecd7e9bf6dacc705b50612c6406 (patch) | |
tree | c6a48fa7f78002b61e7f8dc22de5963c07fd8987 /src | |
parent | 1b1975e3af28f27c7d522704573486f608decc19 (diff) |
mesa: Don't advertise GLES extensions in GL contexts
glGetStringi(GL_EXTENSIONS) failed to respect the context's API, and so
returned all internally enabled GLES extensions from a GL context.
Likewise, glGetIntegerv(GL_NUM_EXTENSIONS) also failed to repsect the
context's API.
Note: This is a candidate for the 8.0 and 9.0 branches.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
(cherry picked from commit f29a4b0157c6a7a31d2a2991a431b4211d01d162)
Conflicts:
src/mesa/main/extensions.c
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/extensions.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index b7b1e448046..f9d44358381 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -916,7 +916,7 @@ _mesa_get_extension_count(struct gl_context *ctx) base = (GLboolean *) &ctx->Extensions; for (i = extension_table; i->name != 0; ++i) { - if (base[i->offset]) { + if (base[i->offset] && (i->api_set & (1 << ctx->API))) { ctx->Extensions.Count++; } } @@ -939,10 +939,11 @@ _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]) { - return (GLubyte*) i->name; - } else if (base[i->offset]) { - ++n; + if (base[i->offset] & (i->api_set & (1 << ctx->API))) { + if (n == index) + return (const GLubyte*) i->name; + else + ++n; } } |