cogl: Don't _cogl_context_get_gl_extensions before check_gl_version
Because for `COGL_DRIVER_GL3`, `_cogl_context_get_gl_extensions` needs to know that the GL version *really* is >= 3.0 before it calls `glGetStringi` which didn't exist prior to GL 3.0 or ES 3.0. This was causing crashes on Xilinx Mali implementations that only support ES 2.0 (hence `glGetStringi` == NULL), but were being forced to call that function before the GL version check which should tell you the function isn't supported. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4019>
This commit is contained in:
parent
656b836c62
commit
390dd63341
2 changed files with 4 additions and 4 deletions
|
@ -475,8 +475,6 @@ _cogl_driver_update_features (CoglContext *ctx,
|
|||
(void *) cogl_renderer_get_proc_address (ctx->display->renderer,
|
||||
"glGetIntegerv");
|
||||
|
||||
gl_extensions = _cogl_context_get_gl_extensions (ctx);
|
||||
|
||||
if (!check_gl_version (ctx, error))
|
||||
return FALSE;
|
||||
|
||||
|
@ -487,6 +485,8 @@ _cogl_driver_update_features (CoglContext *ctx,
|
|||
if (!check_glsl_version (ctx, error))
|
||||
return FALSE;
|
||||
|
||||
gl_extensions = _cogl_context_get_gl_extensions (ctx);
|
||||
|
||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WINSYS)))
|
||||
{
|
||||
g_autofree char *all_extensions = g_strjoinv (" ", gl_extensions);
|
||||
|
|
|
@ -699,8 +699,6 @@ _cogl_driver_update_features (CoglContext *context,
|
|||
(void *) cogl_renderer_get_proc_address (context->display->renderer,
|
||||
"glGetStringi");
|
||||
|
||||
gl_extensions = _cogl_context_get_gl_extensions (context);
|
||||
|
||||
if (!check_gl_version (context, error))
|
||||
return FALSE;
|
||||
|
||||
|
@ -711,6 +709,8 @@ _cogl_driver_update_features (CoglContext *context,
|
|||
if (!check_glsl_version (context, error))
|
||||
return FALSE;
|
||||
|
||||
gl_extensions = _cogl_context_get_gl_extensions (context);
|
||||
|
||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_WINSYS)))
|
||||
{
|
||||
g_autofree char *all_extensions = g_strjoinv (" ", gl_extensions);
|
||||
|
|
Loading…
Reference in a new issue