mesa: return 'unrecognized' extensions in glGetStringi
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 6 Nov 2017 18:01:36 +0000 (18:01 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 16 Nov 2017 14:17:07 +0000 (14:17 +0000)
Analogous to the glGetString() case - report all the
extensions enabled via MESA_EXTENSION_OVERRIDE

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/extensions.c

index 376ea8d4f2aeb995423c48c3741c3e43fee2353b..38fc52d02059d9bd0a9521bcea79b6b943bd85f9 100644 (file)
@@ -421,6 +421,11 @@ _mesa_get_extension_count(struct gl_context *ctx)
       if (_mesa_extension_supported(ctx, k))
         ctx->Extensions.Count++;
    }
+
+   for (k = 0; k < MAX_UNRECOGNIZED_EXTENSIONS; ++k) {
+      if (ctx->Extensions.unrecognized_extensions[k])
+        ctx->Extensions.Count++;
+   }
    return ctx->Extensions.Count;
 }
 
@@ -442,5 +447,13 @@ _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index)
       }
    }
 
+   for (i = 0; i < MAX_UNRECOGNIZED_EXTENSIONS; ++i) {
+      if (ctx->Extensions.unrecognized_extensions[i]) {
+         if (n == index)
+            return (const GLubyte*) ctx->Extensions.unrecognized_extensions[i];
+         else
+            ++n;
+      }
+   }
    return NULL;
 }