diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/extensions.c | 32 | ||||
-rw-r--r-- | src/mesa/main/extensions.h | 2 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 1 |
3 files changed, 15 insertions, 20 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index f185aa5aab5..13a72b111d5 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -78,8 +78,8 @@ name_to_index(const char* name) * Overrides extensions in \c ctx based on the values in * _mesa_extension_override_enables and _mesa_extension_override_disables. */ -static void -override_extensions_in_context(struct gl_context *ctx) +void +_mesa_override_extensions(struct gl_context *ctx) { unsigned i; const GLboolean *enables = @@ -199,27 +199,12 @@ set_extension(struct gl_extensions *ext, int i, GLboolean state) } /** - * \brief Apply the \c MESA_EXTENSION_OVERRIDE environment variable. - * - * \c MESA_EXTENSION_OVERRIDE is a space-separated list of extensions to - * enable or disable. The list is processed thus: - * - Enable recognized extension names that are prefixed with '+'. - * - Disable recognized extension names that are prefixed with '-'. - * - Enable recognized extension names that are not prefixed. - * - Collect unrecognized extension names in a new string. - * - * \c MESA_EXTENSION_OVERRIDE was previously parsed during - * _mesa_one_time_init_extension_overrides. We just use the results of that - * parsing in this function. - * - * \return Space-separated list of unrecognized extension names (which must - * be freed). Does not return \c NULL. + * The unrecognized extensions from \c MESA_EXTENSION_OVERRIDE. + * Must be freed, does not return \c NULL. */ static char * get_extension_override( struct gl_context *ctx ) { - override_extensions_in_context(ctx); - if (extra_extensions == NULL) { return calloc(1, sizeof(char)); } else { @@ -244,9 +229,16 @@ free_unknown_extensions_strings(void) /** - * \brief Initialize extension override tables. + * \brief Initialize extension override tables based on \c MESA_EXTENSION_OVERRIDE * * This should be called one time early during first context initialization. + + * \c MESA_EXTENSION_OVERRIDE is a space-separated list of extensions to + * enable or disable. The list is processed thus: + * - Enable recognized extension names that are prefixed with '+'. + * - Disable recognized extension names that are prefixed with '-'. + * - Enable recognized extension names that are not prefixed. + * - Collect unrecognized extension names in a new string. */ void _mesa_one_time_init_extension_overrides(void) diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index efef1be4751..ebed8fa4fc0 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -53,6 +53,8 @@ extern void _mesa_init_extensions(struct gl_extensions *extentions); extern GLubyte *_mesa_make_extension_string(struct gl_context *ctx); +extern void _mesa_override_extensions(struct gl_context *ctx); + extern GLuint _mesa_get_extension_count(struct gl_context *ctx); diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index d7183de0f1a..ae46419ec48 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -112,6 +112,7 @@ DispatchSanity_test::SetUpCtx(gl_api api, unsigned int version) &driver_functions); _vbo_CreateContext(&ctx); + _mesa_override_extensions(&ctx); ctx.Version = version; _mesa_initialize_dispatch_tables(&ctx); |