mesa/main: do not pass context to one-time extension init
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 24 Apr 2020 12:47:23 +0000 (14:47 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Apr 2020 20:40:01 +0000 (20:40 +0000)
_mesa_problem doesn't use the ctx argument for anything, so there's no
reason to pass it. This saves us from needing a context passed down this
code-path in the first place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>

src/mesa/main/context.c
src/mesa/main/extensions.c
src/mesa/main/extensions.h

index cc6d55d555ae3dcd78d24518b52cf212e0ade3ee..958ac8cb8f0cc05c07daaadd178a89b71b41cc07 100644 (file)
@@ -388,7 +388,7 @@ one_time_init( struct gl_context *ctx )
 
       _mesa_locale_init();
 
-      _mesa_one_time_init_extension_overrides(ctx);
+      _mesa_one_time_init_extension_overrides();
 
       _mesa_get_cpu_features();
 
index 016a55a2ed7c2fcc40844542f816ea87cb1f405c..6ded1bb426983fc1262405809f6f2c07d31d8ff1 100644 (file)
@@ -236,7 +236,7 @@ free_unknown_extensions_strings(void)
  *    - Collect unrecognized extension names in a new string.
  */
 void
-_mesa_one_time_init_extension_overrides(struct gl_context *ctx)
+_mesa_one_time_init_extension_overrides(void)
 {
    const char *env_const = getenv("MESA_EXTENSION_OVERRIDE");
    char *env;
@@ -289,14 +289,14 @@ _mesa_one_time_init_extension_overrides(struct gl_context *ctx)
 
             if (!warned) {
                warned = true;
-               _mesa_problem(ctx, "Trying to enable too many unknown extension. "
-                                  "Only the first %d will be honoured",
-                                  MAX_UNRECOGNIZED_EXTENSIONS);
+               _mesa_problem(NULL, "Trying to enable too many unknown extension. "
+                                   "Only the first %d will be honoured",
+                                   MAX_UNRECOGNIZED_EXTENSIONS);
             }
          } else {
             unrecognized_extensions.names[unknown_ext] = ext;
             unknown_ext++;
-            _mesa_problem(ctx, "Trying to enable unknown extension: %s", ext);
+            _mesa_problem(NULL, "Trying to enable unknown extension: %s", ext);
          }
       }
    }
index 705d65dcdb5c160420cc47bbe2cda409d0caba09..303929baabc9d84cd174b781533be482f477581f 100644 (file)
@@ -47,7 +47,7 @@ struct gl_extensions;
 
 extern void _mesa_enable_sw_extensions(struct gl_context *ctx);
 
-extern void _mesa_one_time_init_extension_overrides(struct gl_context *ctx);
+extern void _mesa_one_time_init_extension_overrides(void);
 
 extern void _mesa_init_extensions(struct gl_extensions *extentions);