diff options
author | Emil Velikov <[email protected]> | 2017-11-06 15:20:35 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-11-16 14:07:14 +0000 |
commit | ba8a347f932f966422a5e156e54e8d05b664cf44 (patch) | |
tree | 0e375bbf1f15171e3c1715d867d575579d6cc1e2 /src/mesa/main | |
parent | afd6a964a423c015548f0474ee4e5e1a24967fe6 (diff) |
mesa: split extensions overrides and glGetString(GL_EXTENSIONS)
Currently we apply the extension overrides and construct the extensions
string upon MakeCurrent.
They are two distinct things, so let's slit the two while pushing the
overrides management _before_ _mesa_compute_version(). This ensures that
the version is updated to reflect the enabled/disabled extensions.
Cc: Jordan Justen <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
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); |