summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2012-09-04 10:02:43 -0700
committerChad Versace <[email protected]>2012-09-06 11:46:04 -0700
commitf29a4b0157c6a7a31d2a2991a431b4211d01d162 (patch)
treeadc83960fdcc235575f3748c771d8635cbcc9930 /src
parentedc0a00377c810889a589c6d7c5e13e75618648a (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]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/extensions.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 36e1fcf62db..e6f4541f044 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -927,7 +927,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++;
}
}
@@ -947,10 +947,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 (const 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;
}
}