aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/extensions.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-25 15:37:13 +0000
committermarha <marha@users.sourceforge.net>2011-03-25 15:37:13 +0000
commit41a502478a2972358dec934d82ee401c61a5cd36 (patch)
tree3fda8100e6da9b4a2863789e393016a750502067 /mesalib/src/mesa/main/extensions.c
parent81aeaf653a832c4054d9a40b1cc796911521a739 (diff)
parent272e57235cd60a2e65ac8258d96a02eb3939b687 (diff)
downloadvcxsrv-41a502478a2972358dec934d82ee401c61a5cd36.tar.gz
vcxsrv-41a502478a2972358dec934d82ee401c61a5cd36.tar.bz2
vcxsrv-41a502478a2972358dec934d82ee401c61a5cd36.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/main/extensions.c')
-rw-r--r--mesalib/src/mesa/main/extensions.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c
index 6de672e92..b58d3635e 100644
--- a/mesalib/src/mesa/main/extensions.c
+++ b/mesalib/src/mesa/main/extensions.c
@@ -753,7 +753,7 @@ _mesa_extension_is_enabled( struct gl_context *ctx, const char *name )
static char *
get_extension_override( struct gl_context *ctx )
{
- const char *env_const= _mesa_getenv("MESA_EXTENSION_OVERRIDE");
+ const char *env_const = _mesa_getenv("MESA_EXTENSION_OVERRIDE");
char *env;
char *ext;
char *extra_exts;
@@ -794,7 +794,7 @@ get_extension_override( struct gl_context *ctx )
}
/* Remove trailing space. */
- len = strlen(extra_exts);
+ len = strlen(extra_exts);
if (extra_exts[len - 1] == ' ')
extra_exts[len - 1] = '\0';
@@ -875,12 +875,24 @@ _mesa_make_extension_string(struct gl_context *ctx)
GLboolean *base = (GLboolean *) &ctx->Extensions;
const struct extension *i;
unsigned j;
-
+ unsigned maxYear = ~0;
+
+ /* Check if the MESA_EXTENSION_MAX_YEAR env var is set */
+ {
+ const char *env = getenv("MESA_EXTENSION_MAX_YEAR");
+ if (env) {
+ maxYear = atoi(env);
+ _mesa_debug(ctx, "Note: limiting GL extensions to %u or earlier\n",
+ maxYear);
+ }
+ }
/* Compute length of the extension string. */
count = 0;
for (i = extension_table; i->name != 0; ++i) {
- if (base[i->offset] && (i->api_set & (1 << ctx->API))) {
+ if (base[i->offset] &&
+ i->year <= maxYear &&
+ (i->api_set & (1 << ctx->API))) {
length += strlen(i->name) + 1; /* +1 for space */
++count;
}
@@ -908,7 +920,9 @@ _mesa_make_extension_string(struct gl_context *ctx)
*/
j = 0;
for (i = extension_table; i->name != 0; ++i) {
- if (base[i->offset] && (i->api_set & (1 << ctx->API))) {
+ if (base[i->offset] &&
+ i->year <= maxYear &&
+ (i->api_set & (1 << ctx->API))) {
extension_indices[j++] = i - extension_table;
}
}