egl: SDL_EGL_LoadLibaryOnly() shouldn't set _this->gl_config.driver_loaded = 1

This is handled in in the higher-level SDL_GL_LoadLibrary().

All uses of SDL_EGL_LoadLibrary (which calls the Only version) are just
target-specific wrappers for their own GL_LoadLibrary hook, with two
exceptions which now handle driver_loaded correctly (although it's
questionable if these init-if-no-one-did-it-correctly-already code blocks
should exist at all, fwiw).

Fixes Bugzilla #5190.
This commit is contained in:
Ryan C. Gordon 2020-07-16 13:18:19 -04:00
parent af71510cca
commit 8babda2c20
3 changed files with 4 additions and 3 deletions

View file

@ -438,8 +438,6 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path)
LOAD_FUNC_EGLEXT(eglQueryDevicesEXT); LOAD_FUNC_EGLEXT(eglQueryDevicesEXT);
LOAD_FUNC_EGLEXT(eglGetPlatformDisplayEXT); LOAD_FUNC_EGLEXT(eglGetPlatformDisplayEXT);
_this->gl_config.driver_loaded = 1;
if (path) { if (path) {
SDL_strlcpy(_this->gl_config.driver_path, path, sizeof(_this->gl_config.driver_path) - 1); SDL_strlcpy(_this->gl_config.driver_path, path, sizeof(_this->gl_config.driver_path) - 1);
} else { } else {

View file

@ -109,10 +109,12 @@ Cocoa_GLES_SetupWindow(_THIS, SDL_Window * window)
if (_this->egl_data == NULL) { if (_this->egl_data == NULL) {
SDL_assert(!_this->gl_config.driver_loaded);
if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0) < 0) { if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0) < 0) {
SDL_EGL_UnloadLibrary(_this); SDL_EGL_UnloadLibrary(_this);
return -1; return -1;
} }
_this->gl_config.driver_loaded = 1;
} }
/* Create the GLES window surface */ /* Create the GLES window surface */

View file

@ -107,12 +107,13 @@ WIN_GLES_SetupWindow(_THIS, SDL_Window * window)
SDL_Window *current_win = SDL_GL_GetCurrentWindow(); SDL_Window *current_win = SDL_GL_GetCurrentWindow();
SDL_GLContext current_ctx = SDL_GL_GetCurrentContext(); SDL_GLContext current_ctx = SDL_GL_GetCurrentContext();
if (_this->egl_data == NULL) { if (_this->egl_data == NULL) {
SDL_assert(!_this->gl_config.driver_loaded);
if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0) < 0) { if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0) < 0) {
SDL_EGL_UnloadLibrary(_this); SDL_EGL_UnloadLibrary(_this);
return -1; return -1;
} }
_this->gl_config.driver_loaded = 1;
} }
/* Create the GLES window surface */ /* Create the GLES window surface */