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 <jordan.l.justen@intel.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:

committed by
Emil Velikov

parent
afd6a964a4
commit
ba8a347f93
@@ -124,6 +124,7 @@ i830CreateContext(int api,
|
||||
_tnl_allow_vertex_fog(ctx, 1);
|
||||
_tnl_allow_pixel_fog(ctx, 0);
|
||||
|
||||
_mesa_override_extensions(ctx);
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
_mesa_initialize_dispatch_tables(ctx);
|
||||
|
@@ -289,6 +289,7 @@ i915CreateContext(int api,
|
||||
_tnl_allow_vertex_fog(ctx, 0);
|
||||
_tnl_allow_pixel_fog(ctx, 1);
|
||||
|
||||
_mesa_override_extensions(ctx);
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
_mesa_initialize_dispatch_tables(ctx);
|
||||
|
@@ -1051,6 +1051,7 @@ brwCreateContext(gl_api api,
|
||||
if (INTEL_DEBUG & DEBUG_SHADER_TIME)
|
||||
brw_init_shader_time(brw);
|
||||
|
||||
_mesa_override_extensions(ctx);
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
_mesa_initialize_dispatch_tables(ctx);
|
||||
|
@@ -394,6 +394,7 @@ GLboolean r200CreateContext( gl_api api,
|
||||
TCL_FALLBACK(&rmesa->radeon.glCtx, R200_TCL_FALLBACK_TCL_DISABLE, 1);
|
||||
}
|
||||
|
||||
_mesa_override_extensions(ctx);
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
/* Exec table initialization requires the version to be computed */
|
||||
|
@@ -353,6 +353,7 @@ r100CreateContext( gl_api api,
|
||||
/* _tnl_need_dlist_norm_lengths( ctx, GL_FALSE ); */
|
||||
}
|
||||
|
||||
_mesa_override_extensions(ctx);
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
/* Exec table initialization requires the version to be computed */
|
||||
|
@@ -817,6 +817,7 @@ dri_create_context(gl_api api,
|
||||
_mesa_meta_init(mesaCtx);
|
||||
_mesa_enable_sw_extensions(mesaCtx);
|
||||
|
||||
_mesa_override_extensions(mesaCtx);
|
||||
_mesa_compute_version(mesaCtx);
|
||||
|
||||
_mesa_initialize_dispatch_tables(mesaCtx);
|
||||
|
@@ -913,6 +913,7 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
|
||||
swrast->choose_line = osmesa_choose_line;
|
||||
swrast->choose_triangle = osmesa_choose_triangle;
|
||||
|
||||
_mesa_override_extensions(ctx);
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
if (ctx->Version < version_major * 10 + version_minor) {
|
||||
|
@@ -957,6 +957,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
|
||||
|
||||
_mesa_meta_init(mesaCtx);
|
||||
|
||||
_mesa_override_extensions(mesaCtx);
|
||||
_mesa_compute_version(mesaCtx);
|
||||
|
||||
/* Exec table initialization requires the version to be computed */
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -536,6 +536,7 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
|
||||
|
||||
st->bitmap.cache.empty = true;
|
||||
|
||||
_mesa_override_extensions(ctx);
|
||||
_mesa_compute_version(ctx);
|
||||
|
||||
if (ctx->Version == 0) {
|
||||
|
Reference in New Issue
Block a user