mesa/main: Do not pass context to one_time_init
There's no longer any reason to pass the context down to one_time_init, because we always do the same thing regardless of the context, and we don't change the context. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
This commit is contained in:

committed by
Marge Bot

parent
ac9d30431e
commit
6ff94735c9
@@ -369,14 +369,14 @@ one_time_fini(void)
|
|||||||
* \sa _math_init().
|
* \sa _math_init().
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
one_time_init( struct gl_context *ctx )
|
one_time_init(void)
|
||||||
{
|
{
|
||||||
static GLbitfield api_init_mask = 0x0;
|
static bool initialized;
|
||||||
|
|
||||||
mtx_lock(&OneTimeLock);
|
mtx_lock(&OneTimeLock);
|
||||||
|
|
||||||
/* truly one-time init */
|
/* truly one-time init */
|
||||||
if (!api_init_mask) {
|
if (!initialized) {
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
STATIC_ASSERT(sizeof(GLbyte) == 1);
|
STATIC_ASSERT(sizeof(GLbyte) == 1);
|
||||||
@@ -400,7 +400,7 @@ one_time_init( struct gl_context *ctx )
|
|||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
if (MESA_VERBOSE != 0) {
|
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
|
#endif
|
||||||
|
|
||||||
@@ -412,7 +412,7 @@ one_time_init( struct gl_context *ctx )
|
|||||||
_mesa_init_remap_table();
|
_mesa_init_remap_table();
|
||||||
}
|
}
|
||||||
|
|
||||||
api_init_mask |= 1 << ctx->API;
|
initialized = true;
|
||||||
|
|
||||||
mtx_unlock(&OneTimeLock);
|
mtx_unlock(&OneTimeLock);
|
||||||
}
|
}
|
||||||
@@ -1204,7 +1204,7 @@ _mesa_initialize_context(struct gl_context *ctx,
|
|||||||
_mesa_override_gl_version(ctx);
|
_mesa_override_gl_version(ctx);
|
||||||
|
|
||||||
/* misc one-time initializations */
|
/* misc one-time initializations */
|
||||||
one_time_init(ctx);
|
one_time_init();
|
||||||
|
|
||||||
/* Plug in driver functions and context pointer here.
|
/* Plug in driver functions and context pointer here.
|
||||||
* This is important because when we call alloc_shared_state() below
|
* This is important because when we call alloc_shared_state() below
|
||||||
|
Reference in New Issue
Block a user