[PATCH v2 0/1] MR10062: Draft: win32u: Ignore EGL device if context cannot be created.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59372 -- v2: win32u: Ignore EGL device if context cannot be created. https://gitlab.winehq.org/wine/wine/-/merge_requests/10062
From: Rémi Bernon <rbernon@codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59372 --- dlls/win32u/opengl.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index 9f9783e5888..4a1e40f6f0d 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -1114,6 +1114,17 @@ static void init_device_info( struct egl_platform *egl, const struct opengl_func funcs->p_eglGetConfigs( egl->display, &config, 1, &count ); if (!count) config = EGL_NO_CONFIG_KHR; + if (!(context = funcs->p_eglCreateContext( egl->display, config, EGL_NO_CONTEXT, NULL ))) + { + WARN( "Unable to create a context, ignoring device\n" ); + funcs->p_eglTerminate( egl->display ); + list_remove( &egl->entry ); + free( egl ); + return; + } + funcs->p_eglDestroyContext( egl->display, context ); + context = EGL_NO_CONTEXT; + for (i = 0; i < ARRAY_SIZE(versions) && (!egl->core_version || !egl->compat_version); i++) { int context_attribs[] = @@ -2671,7 +2682,7 @@ void win32u_glImportSemaphoreWin32NameEXT( GLuint semaphore, GLenum type, const static void display_funcs_init(void) { - struct egl_platform *egl; + struct egl_platform *egl, *next; UINT status; if (egl_init( &driver_funcs )) TRACE( "Initialized EGL library\n" ); @@ -2793,7 +2804,7 @@ static void display_funcs_init(void) display_funcs.p_wglQueryCurrentRendererStringWINE = win32u_wglQueryCurrentRendererStringWINE; display_funcs.p_wglQueryRendererIntegerWINE = win32u_wglQueryRendererIntegerWINE; display_funcs.p_wglQueryRendererStringWINE = win32u_wglQueryRendererStringWINE; - LIST_FOR_EACH_ENTRY( egl, &devices_egl, struct egl_platform, entry ) + LIST_FOR_EACH_ENTRY_SAFE( egl, next, &devices_egl, struct egl_platform, entry ) init_device_info( egl, &display_funcs ); } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10062
participants (2)
-
Rémi Bernon -
Rémi Bernon (@rbernon)