From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/init.c | 8 ------- dlls/winex11.drv/opengl.c | 47 +++++++++++++++------------------------ dlls/winex11.drv/x11drv.h | 2 +- 3 files changed, 19 insertions(+), 38 deletions(-)
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index a0bfab2fb46..70da9b8c094 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -371,14 +371,6 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d return 0; }
-/********************************************************************** - * X11DRV_wine_get_wgl_driver - */ -static struct opengl_funcs *X11DRV_wine_get_wgl_driver( UINT version ) -{ - return get_glx_driver( version ); -} -
static const struct user_driver_funcs x11drv_funcs = { diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 78b00677099..b661424de76 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -540,11 +540,20 @@ done:
static void *opengl_handle;
-static void init_opengl(void) +/********************************************************************** + * X11DRV_wine_get_wgl_driver + */ +struct opengl_funcs *X11DRV_wine_get_wgl_driver(UINT version) { int error_base, event_base; unsigned int i;
+ if (version != WINE_WGL_DRIVER_VERSION) + { + ERR( "version mismatch, opengl32 wants %u but driver has %u\n", version, WINE_WGL_DRIVER_VERSION ); + return NULL; + } + /* No need to load any other libraries as according to the ABI, libGL should be self-sufficient and include all dependencies */ opengl_handle = dlopen( SONAME_LIBGL, RTLD_NOW | RTLD_GLOBAL ); @@ -552,7 +561,7 @@ static void init_opengl(void) { ERR( "Failed to load libGL: %s\n", dlerror() ); ERR( "OpenGL support is disabled.\n"); - return; + return NULL; }
for (i = 0; i < ARRAY_SIZE( opengl_func_names ); i++) @@ -720,18 +729,13 @@ static void init_opengl(void)
X11DRV_WineGL_LoadExtensions(); init_pixel_formats( gdi_display ); - return; + + return &opengl_funcs;
failed: dlclose(opengl_handle); opengl_handle = NULL; -} - -static BOOL has_opengl(void) -{ - static pthread_once_t init_once = PTHREAD_ONCE_INIT; - - return !pthread_once( &init_once, init_opengl ); + return NULL; }
static const char *debugstr_fbconfig( GLXFBConfig fbconfig ) @@ -1402,8 +1406,6 @@ static int describe_pixel_format( int iPixelFormat, struct wgl_pixel_format *pf int rb, gb, bb, ab; const struct glx_pixel_format *fmt;
- if (!has_opengl()) return 0; - /* Look for the iPixelFormat in our list of supported formats. If it is * supported we get the index in the FBConfig table and the number of * supported formats back */ @@ -2883,11 +2885,6 @@ static void glxdrv_get_pixel_formats( struct wgl_pixel_format *formats, { UINT i;
- if (!has_opengl()) - { - *num_formats = *num_onscreen_formats = 0; - return; - } if (formats) { for (i = 0; i < min( max_formats, nb_pixel_formats ); ++i) @@ -2913,20 +2910,12 @@ static struct opengl_funcs opengl_funcs = } };
-struct opengl_funcs *get_glx_driver( UINT version ) -{ - if (version != WINE_WGL_DRIVER_VERSION) - { - ERR( "version mismatch, opengl32 wants %u but driver has %u\n", version, WINE_WGL_DRIVER_VERSION ); - return NULL; - } - if (has_opengl()) return &opengl_funcs; - return NULL; -} - #else /* no OpenGL includes */
-struct opengl_funcs *get_glx_driver( UINT version ) +/********************************************************************** + * X11DRV_wine_get_wgl_driver + */ +struct opengl_funcs *X11DRV_wine_get_wgl_driver(UINT version) { return NULL; } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 8e383ae4c48..91811cfd766 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -282,7 +282,7 @@ extern BOOL client_side_with_render; extern BOOL shape_layered_windows; extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void);
-extern struct opengl_funcs *get_glx_driver(UINT); +extern struct opengl_funcs *X11DRV_wine_get_wgl_driver( UINT version ); extern UINT X11DRV_VulkanInit( UINT, void *, const struct vulkan_driver_funcs ** );
extern struct format_entry *import_xdnd_selection( Display *display, Window win, Atom selection,