*
* \sa _math_init().
*/
-static void
-one_time_init( struct gl_context *ctx )
+void
+_mesa_initialize(void)
{
- static GLbitfield api_init_mask = 0x0;
+ static bool initialized;
mtx_lock(&OneTimeLock);
/* truly one-time init */
- if (!api_init_mask) {
+ if (!initialized) {
GLuint i;
STATIC_ASSERT(sizeof(GLbyte) == 1);
_mesa_locale_init();
- _mesa_one_time_init_extension_overrides(ctx);
+ _mesa_one_time_init_extension_overrides();
_mesa_get_cpu_features();
#if defined(DEBUG)
if (MESA_VERBOSE != 0) {
- _mesa_debug(ctx, "Mesa " PACKAGE_VERSION " DEBUG build" MESA_GIT_SHA1 "\n");
+ _mesa_debug(NULL, "Mesa " PACKAGE_VERSION " DEBUG build" MESA_GIT_SHA1 "\n");
}
#endif
* unecessary creation/destruction of glsl types.
*/
glsl_type_singleton_init_or_ref();
- }
- /* per-API one-time init */
- if (!(api_init_mask & (1 << ctx->API))) {
_mesa_init_remap_table();
}
- api_init_mask |= 1 << ctx->API;
+ initialized = true;
mtx_unlock(&OneTimeLock);
}
_mesa_override_gl_version(ctx);
/* misc one-time initializations */
- one_time_init(ctx);
+ _mesa_initialize();
/* Plug in driver functions and context pointer here.
* This is important because when we call alloc_shared_state() below