cogl/egl: Choose config only if needed

In try_create_context(), if COGL_EGL_WINSYS_FEATURE_NO_CONFIG_CONTEXT
is set, don't try to choose an egl config.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4088>
This commit is contained in:
Jocelyn Falempe 2024-10-18 17:19:14 +02:00 committed by Marge Bot
parent fb86d5d5b0
commit 18085b0e40
3 changed files with 19 additions and 11 deletions

View File

@ -121,6 +121,8 @@ typedef struct _CoglRendererEGL
/* vtable for platform specific parts */
const CoglWinsysEGLVtable *platform_vtable;
gboolean needs_config;
/* Sync for latest submitted work */
EGLSyncKHR sync;

View File

@ -243,6 +243,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
egl_renderer->platform_vtable = &_cogl_winsys_egl_vtable;
egl_renderer->sync = EGL_NO_SYNC_KHR;
egl_renderer->needs_config = TRUE;
if (!_cogl_xlib_renderer_connect (renderer, error))
goto error;

View File

@ -318,6 +318,10 @@ try_create_context (CoglDisplay *display,
edpy = egl_renderer->edpy;
if (!(egl_renderer->private_features &
COGL_EGL_WINSYS_FEATURE_NO_CONFIG_CONTEXT) ||
egl_renderer->needs_config)
{
if (!egl_renderer->platform_vtable->choose_config (display,
cfg_attribs,
&config,
@ -331,6 +335,7 @@ try_create_context (CoglDisplay *display,
}
egl_display->egl_config = config;
}
if (display->renderer->driver == COGL_DRIVER_GL3)
{