egl: Preload a driver if eglGetProcAddress is called early.
authorChia-I Wu <olvaffe@gmail.com>
Mon, 28 Sep 2009 09:39:07 +0000 (17:39 +0800)
committerBrian Paul <brianp@vmware.com>
Tue, 13 Oct 2009 18:00:36 +0000 (12:00 -0600)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/egl/main/eglapi.c

index 82ee9d9bcdfd2a70c2ce24b64ad8ed6b20be1616..23d841d2d1a397cba453e9caa9b2e45ca49dc10e 100644 (file)
@@ -618,6 +618,10 @@ void (* EGLAPIENTRY eglGetProcAddress(const char *procname))()
       }
    }
 
+   /* preload a driver if there isn't one */
+   if (!_eglGlobal.NumDrivers)
+      _eglPreloadDriver(NULL);
+
    /* now loop over drivers to query their procs */
    for (i = 0; i < _eglGlobal.NumDrivers; i++) {
       _EGLProc p = _eglGlobal.Drivers[i]->API.GetProcAddress(procname);