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:
parent
fb86d5d5b0
commit
18085b0e40
@ -121,6 +121,8 @@ typedef struct _CoglRendererEGL
|
|||||||
/* vtable for platform specific parts */
|
/* vtable for platform specific parts */
|
||||||
const CoglWinsysEGLVtable *platform_vtable;
|
const CoglWinsysEGLVtable *platform_vtable;
|
||||||
|
|
||||||
|
gboolean needs_config;
|
||||||
|
|
||||||
/* Sync for latest submitted work */
|
/* Sync for latest submitted work */
|
||||||
EGLSyncKHR sync;
|
EGLSyncKHR sync;
|
||||||
|
|
||||||
|
@ -243,6 +243,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
|
|||||||
|
|
||||||
egl_renderer->platform_vtable = &_cogl_winsys_egl_vtable;
|
egl_renderer->platform_vtable = &_cogl_winsys_egl_vtable;
|
||||||
egl_renderer->sync = EGL_NO_SYNC_KHR;
|
egl_renderer->sync = EGL_NO_SYNC_KHR;
|
||||||
|
egl_renderer->needs_config = TRUE;
|
||||||
|
|
||||||
if (!_cogl_xlib_renderer_connect (renderer, error))
|
if (!_cogl_xlib_renderer_connect (renderer, error))
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -318,6 +318,10 @@ try_create_context (CoglDisplay *display,
|
|||||||
|
|
||||||
edpy = egl_renderer->edpy;
|
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,
|
if (!egl_renderer->platform_vtable->choose_config (display,
|
||||||
cfg_attribs,
|
cfg_attribs,
|
||||||
&config,
|
&config,
|
||||||
@ -331,6 +335,7 @@ try_create_context (CoglDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
egl_display->egl_config = config;
|
egl_display->egl_config = config;
|
||||||
|
}
|
||||||
|
|
||||||
if (display->renderer->driver == COGL_DRIVER_GL3)
|
if (display->renderer->driver == COGL_DRIVER_GL3)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user