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 <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
@@ -927,7 +927,7 @@ _mesa_get_extension_count(struct gl_context *ctx)
|
|||||||
|
|
||||||
base = (GLboolean *) &ctx->Extensions;
|
base = (GLboolean *) &ctx->Extensions;
|
||||||
for (i = extension_table; i->name != 0; ++i) {
|
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++;
|
ctx->Extensions.Count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -947,10 +947,11 @@ _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index)
|
|||||||
base = (GLboolean*) &ctx->Extensions;
|
base = (GLboolean*) &ctx->Extensions;
|
||||||
n = 0;
|
n = 0;
|
||||||
for (i = extension_table; i->name != 0; ++i) {
|
for (i = extension_table; i->name != 0; ++i) {
|
||||||
if (n == index && base[i->offset]) {
|
if (base[i->offset] & (i->api_set & (1 << ctx->API))) {
|
||||||
return (const GLubyte*) i->name;
|
if (n == index)
|
||||||
} else if (base[i->offset]) {
|
return (const GLubyte*) i->name;
|
||||||
++n;
|
else
|
||||||
|
++n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user