Add XInitThreads to X11_CreateDevice.
authorMichael Sartain <mikesart@valvesoftware.com>
Thu, 11 Oct 2012 09:37:38 -0700
changeset 65691f4e69a8e5e6
parent 6568 1a6b0ae81937
child 6570 45855398762c
Add XInitThreads to X11_CreateDevice.
The nVidia driver requires XInitThreads to be called for it to work in multithreaded mode. Sam also
says that the overhead for this is small enough that it should just be done by default at this point.
If this causes issues, we can add a hint later to enable / disable this call.
src/video/x11/SDL_x11sym.h
src/video/x11/SDL_x11video.c
     1.1 --- a/src/video/x11/SDL_x11sym.h	Thu Oct 11 09:34:13 2012 -0700
     1.2 +++ b/src/video/x11/SDL_x11sym.h	Thu Oct 11 09:37:38 2012 -0700
     1.3 @@ -81,6 +81,7 @@
     1.4  SDL_X11_SYM(int,XMoveWindow,(Display* a,Window b,int c,int d),(a,b,c,d),return)
     1.5  SDL_X11_SYM(int,XNextEvent,(Display* a,XEvent* b),(a,b),return)
     1.6  SDL_X11_SYM(Display*,XOpenDisplay,(_Xconst char* a),(a),return)
     1.7 +SDL_X11_SYM(Status,XInitThreads,(void),(),return)
     1.8  SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return)
     1.9  SDL_X11_SYM(int,XPending,(Display* a),(a),return)
    1.10  SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return)
     2.1 --- a/src/video/x11/SDL_x11video.c	Thu Oct 11 09:34:13 2012 -0700
     2.2 +++ b/src/video/x11/SDL_x11video.c	Thu Oct 11 09:37:38 2012 -0700
     2.3 @@ -156,6 +156,10 @@
     2.4          return NULL;
     2.5      }
     2.6  
     2.7 +    // Need for threading gl calls. This is also required for the proprietary nVidia
     2.8 +	//  driver to be threaded.
     2.9 +    XInitThreads();
    2.10 +
    2.11      /* Initialize all variables that we clean on shutdown */
    2.12      device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    2.13      if (!device) {