aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/extensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/extensions.c')
-rw-r--r--mesalib/src/mesa/main/extensions.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c
index 36e1fcf62..e6f4541f0 100644
--- a/mesalib/src/mesa/main/extensions.c
+++ b/mesalib/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;
}
}