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

Chad Versace chad.versace at linux.intel.com
Tue Sep 4 10:19:00 PDT 2012


The function did not respect the context's API, and so returned internally
enabled GLES extensions from GL contexts.

Note: This is a candidate for the 7.11, 8.0, and 8.0 branches.
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;
-- 
1.7.12



More information about the mesa-dev mailing list