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:
parent
390dd63341
commit
010d68ed5a
1 changed files with 10 additions and 6 deletions
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue