|
Packit Service |
9e77c8 |
/*
|
|
Packit Service |
9e77c8 |
* Copyright (c) 2013, NVIDIA CORPORATION.
|
|
Packit Service |
9e77c8 |
*
|
|
Packit Service |
9e77c8 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit Service |
9e77c8 |
* copy of this software and/or associated documentation files (the
|
|
Packit Service |
9e77c8 |
* "Materials"), to deal in the Materials without restriction, including
|
|
Packit Service |
9e77c8 |
* without limitation the rights to use, copy, modify, merge, publish,
|
|
Packit Service |
9e77c8 |
* distribute, sublicense, and/or sell copies of the Materials, and to
|
|
Packit Service |
9e77c8 |
* permit persons to whom the Materials are furnished to do so, subject to
|
|
Packit Service |
9e77c8 |
* the following conditions:
|
|
Packit Service |
9e77c8 |
*
|
|
Packit Service |
9e77c8 |
* The above copyright notice and this permission notice shall be included
|
|
Packit Service |
9e77c8 |
* unaltered in all copies or substantial portions of the Materials.
|
|
Packit Service |
9e77c8 |
* Any additions, deletions, or changes to the original source files
|
|
Packit Service |
9e77c8 |
* must be clearly indicated in accompanying documentation.
|
|
Packit Service |
9e77c8 |
*
|
|
Packit Service |
9e77c8 |
* If only executable code is distributed, then the accompanying
|
|
Packit Service |
9e77c8 |
* documentation must state that "this software is based in part on the
|
|
Packit Service |
9e77c8 |
* work of the Khronos Group."
|
|
Packit Service |
9e77c8 |
*
|
|
Packit Service |
9e77c8 |
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
Packit Service |
9e77c8 |
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
Packit Service |
9e77c8 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
Packit Service |
9e77c8 |
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
Packit Service |
9e77c8 |
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
Packit Service |
9e77c8 |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
Packit Service |
9e77c8 |
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
#if !defined(__LIB_GLX_MAPPING_H)
|
|
Packit Service |
9e77c8 |
#define __LIB_GLX_MAPPING_H
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
#include "libglxabipriv.h"
|
|
Packit Service |
9e77c8 |
#include "GLdispatch.h"
|
|
Packit Service |
9e77c8 |
#include "lkdhash.h"
|
|
Packit Service |
9e77c8 |
#include "winsys_dispatch.h"
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
#define GLX_CLIENT_STRING_LAST_ATTRIB GLX_EXTENSIONS
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* Structure containing relevant per-vendor information.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
struct __GLXvendorInfoRec {
|
|
Packit Service |
9e77c8 |
int vendorID; //< unique GLdispatch ID
|
|
Packit Service |
9e77c8 |
char *name; //< name of the vendor
|
|
Packit Service |
9e77c8 |
void *dlhandle; //< shared library handle
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/// dynamic GLX dispatch table
|
|
Packit Service |
9e77c8 |
__GLVNDwinsysVendorDispatch *dynDispatch;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
__GLdispatchTable *glDispatch; //< GL dispatch table
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
const __GLXapiImports *glxvc;
|
|
Packit Service |
9e77c8 |
const __GLdispatchPatchCallbacks *patchCallbacks;
|
|
Packit Service |
9e77c8 |
__GLXdispatchTableStatic staticDispatch; //< static GLX dispatch table
|
|
Packit Service |
9e77c8 |
};
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
typedef struct __GLXvendorXIDMappingHashRec __GLXvendorXIDMappingHash;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* Structure containing per-display information.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
typedef struct __GLXdisplayInfoRec {
|
|
Packit Service |
9e77c8 |
Display *dpy;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
char *clientStrings[GLX_CLIENT_STRING_LAST_ATTRIB];
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/**
|
|
Packit Service |
9e77c8 |
* An array of vendors for each screen.
|
|
Packit Service |
9e77c8 |
*
|
|
Packit Service |
9e77c8 |
* Do not access this directly. Instead, call \c __glXLookupVendorByScreen.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
__GLXvendorInfo **vendors;
|
|
Packit Service |
9e77c8 |
glvnd_rwlock_t vendorLock;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
DEFINE_LKDHASH(__GLXvendorXIDMappingHash, xidVendorHash);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/// True if the server supports the GLX extension.
|
|
Packit Service |
9e77c8 |
Bool glxSupported;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/// The major opcode for GLX, if it's supported.
|
|
Packit Service |
9e77c8 |
int glxMajorOpcode;
|
|
Packit Service |
9e77c8 |
int glxFirstError;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
Bool libglvndExtensionSupported;
|
|
Packit Service |
9e77c8 |
} __GLXdisplayInfo;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
typedef struct __GLXlocalDispatchFunctionRec {
|
|
Packit Service |
9e77c8 |
const char *name;
|
|
Packit Service |
9e77c8 |
__GLXextFuncPtr addr;
|
|
Packit Service |
9e77c8 |
} __GLXlocalDispatchFunction;
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* A NULL-termianted list of GLX dispatch functions that are implemented in
|
|
Packit Service |
9e77c8 |
* libGLX instead of in any vendor library.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
extern const __GLXlocalDispatchFunction LOCAL_GLX_DISPATCH_FUNCTIONS[];
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* Accessor functions used to retrieve the "current" dispatch table for each of
|
|
Packit Service |
9e77c8 |
* the three types of dispatch tables (see libglxabi.h for an explanation of
|
|
Packit Service |
9e77c8 |
* these types).
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
__GLXvendorInfo *__glXGetDynDispatch(Display *dpy, const int screen);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* Various functions to manage mappings used to determine the screen
|
|
Packit Service |
9e77c8 |
* of a particular GLX call.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
int __glXAddVendorContextMapping(Display *dpy, GLXContext context, __GLXvendorInfo *vendor);
|
|
Packit Service |
9e77c8 |
void __glXRemoveVendorContextMapping(Display *dpy, GLXContext context);
|
|
Packit Service |
9e77c8 |
__GLXvendorInfo *__glXVendorFromContext(GLXContext context);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
int __glXAddVendorFBConfigMapping(Display *dpy, GLXFBConfig config, __GLXvendorInfo *vendor);
|
|
Packit Service |
9e77c8 |
void __glXRemoveVendorFBConfigMapping(Display *dpy, GLXFBConfig config);
|
|
Packit Service |
9e77c8 |
__GLXvendorInfo *__glXVendorFromFBConfig(Display *dpy, GLXFBConfig config);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
int __glXAddVendorDrawableMapping(Display *dpy, GLXDrawable drawable, __GLXvendorInfo *vendor);
|
|
Packit Service |
9e77c8 |
void __glXRemoveVendorDrawableMapping(Display *dpy, GLXDrawable drawable);
|
|
Packit Service |
9e77c8 |
__GLXvendorInfo *__glXVendorFromDrawable(Display *dpy, GLXDrawable drawable);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
__GLXextFuncPtr __glXGetGLXDispatchAddress(const GLubyte *procName);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* Looks up the vendor by name or screen number. This has the side effect of
|
|
Packit Service |
9e77c8 |
* loading the vendor library if it has not been previously loaded.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
__GLXvendorInfo *__glXLookupVendorByName(const char *vendorName);
|
|
Packit Service |
9e77c8 |
__GLXvendorInfo *__glXLookupVendorByScreen(Display *dpy, const int screen);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* Looks up the __GLXdisplayInfo structure for a display, creating it if
|
|
Packit Service |
9e77c8 |
* necessary.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
__GLXdisplayInfo *__glXLookupDisplay(Display *dpy);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*!
|
|
Packit Service |
9e77c8 |
* This is called to perform any context-related cleanup when a display is
|
|
Packit Service |
9e77c8 |
* closed.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
void __glXDisplayClosed(__GLXdisplayInfo *dpyInfo);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
void __glXMappingInit(void);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
/*
|
|
Packit Service |
9e77c8 |
* Close the vendor library and perform any relevant teardown. This should
|
|
Packit Service |
9e77c8 |
* be called when the API library is unloaded.
|
|
Packit Service |
9e77c8 |
*/
|
|
Packit Service |
9e77c8 |
void __glXMappingTeardown(Bool doReset);
|
|
Packit Service |
9e77c8 |
|
|
Packit Service |
9e77c8 |
#endif /* __LIB_GLX_MAPPING_H */
|