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
@ -468,12 +468,6 @@ _cogl_driver_update_features (CoglContext *ctx,
|
|||||||
ctx->glGetString =
|
ctx->glGetString =
|
||||||
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
|
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
|
||||||
"glGetString");
|
"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))
|
if (!check_gl_version (ctx, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -485,6 +479,16 @@ _cogl_driver_update_features (CoglContext *ctx,
|
|||||||
if (!check_glsl_version (ctx, error))
|
if (!check_glsl_version (ctx, error))
|
||||||
return FALSE;
|
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);
|
gl_extensions = _cogl_context_get_gl_extensions (ctx);
|
||||||
|
|
||||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WINSYS)))
|
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WINSYS)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user