diff options
author | Kyle Brenneman <kbrenneman@nvidia.com> | 2016-02-17 16:35:44 -0700 |
---|---|---|
committer | Kyle Brenneman <kbrenneman@nvidia.com> | 2016-02-29 13:50:34 -0700 |
commit | 233b274be11d586f1e246088901d1d69cc2583b7 (patch) | |
tree | c0f5add90c0dbe26ff2356dfb81c996401dca0c8 /include | |
parent | 642fd89560312200a236dcc59dbe7d7f5d7e60ec (diff) |
Add a threadAttach callback for entrypoint patching.
The threadAttach callback is used so that a vendor library can go through any
thread initialization it needs to in order to deal with any later OpenGL calls.
This allows a vendor library to work around broken applications that try to
call OpenGL functions without a current context.
Diffstat (limited to 'include')
-rw-r--r-- | include/glvnd/GLdispatchABI.h | 21 | ||||
-rw-r--r-- | include/glvnd/libglxabi.h | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/include/glvnd/GLdispatchABI.h b/include/glvnd/GLdispatchABI.h index d16de2d..ab70361 100644 --- a/include/glvnd/GLdispatchABI.h +++ b/include/glvnd/GLdispatchABI.h @@ -138,6 +138,27 @@ typedef struct __GLdispatchPatchCallbacksRec { * original state. The vendor library must not try to modify them. */ void (*releasePatch)(void); + + /*! + * Called at the start of window-system functions (GLX and EGL). This + * callback allows vendor libraries to perform any per-thread + * initialization. + * + * This is basically a workaround for broken applications. A lot of apps + * will make one or more invalid GLX/EGL calls on a thread (often including + * a MakeCurrent with invalid parameters), and then will try to call an + * OpenGL function. + * + * A non-libglvnd-based driver would be able to initialize any thread state + * even on a bogus GLX call, but with libglvnd, those calls wouldn't get + * past libGLX. + * + * This function is optional. If it's \c NULL, then libGLdispatch will + * simply ignore it. + * + * \note This function may be called concurrently from multiple threads. + */ + void (*threadAttach)(void); } __GLdispatchPatchCallbacks; #if defined(__cplusplus) diff --git a/include/glvnd/libglxabi.h b/include/glvnd/libglxabi.h index 3a59691..23b8303 100644 --- a/include/glvnd/libglxabi.h +++ b/include/glvnd/libglxabi.h @@ -91,7 +91,7 @@ extern "C" { /*! * Current version of the ABI. */ -#define GLX_VENDOR_ABI_VERSION 0 +#define GLX_VENDOR_ABI_VERSION 1 /*! |