1
0
Fork 0

cogl/gl: Don't initialize potentially unused/unsupported functions

`_cogl_context_get_gl_extensions` is their only user and it only uses
them for GL 3.0 so do the GL version check first.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4019>
This commit is contained in:
Daniel van Vugt 2024-09-17 17:53:29 +08:00 committed by Marge Bot
parent 390dd63341
commit 010d68ed5a

View file

@ -468,12 +468,6 @@ _cogl_driver_update_features (CoglContext *ctx,
ctx->glGetString =
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetString");
ctx->glGetStringi =
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetStringi");
ctx->glGetIntegerv =
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetIntegerv");
if (!check_gl_version (ctx, error))
return FALSE;
@ -485,6 +479,16 @@ _cogl_driver_update_features (CoglContext *ctx,
if (!check_glsl_version (ctx, error))
return FALSE;
/* These are only used in _cogl_context_get_gl_extensions for GL 3.0
* so don't look them up before check_gl_version()
*/
ctx->glGetStringi =
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetStringi");
ctx->glGetIntegerv =
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetIntegerv");
gl_extensions = _cogl_context_get_gl_extensions (ctx);
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WINSYS)))