summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/extensions.c
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-11-06 15:20:35 +0000
committerEmil Velikov <[email protected]>2017-11-16 14:07:14 +0000
commitba8a347f932f966422a5e156e54e8d05b664cf44 (patch)
tree0e375bbf1f15171e3c1715d867d575579d6cc1e2 /src/mesa/main/extensions.c
parentafd6a964a423c015548f0474ee4e5e1a24967fe6 (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/extensions.c')
-rw-r--r--src/mesa/main/extensions.c32
1 files changed, 12 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)