diff options
author | Ian Romanick <[email protected]> | 2005-07-26 02:44:01 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-07-26 02:44:01 +0000 |
commit | 5f1ba3e21b62cee1a4f900a2e6964728f3eeea9b (patch) | |
tree | 986059d9e958763f9663c78a92313db2c3579269 /src/mesa/drivers/dri/tdfx | |
parent | 1201348a337aa00a85b6bc6dec4963cfc5898e77 (diff) |
Fixes the glXGetProcAddress portion of the interface. Most of the functions
that are currently obtained via glXGetProcAddress and all of the XF86DRI
functions are replaced with a funciton table. This table will be passed to
__driCreateNewScreen.
One of the functions in the table is getProcAddress. This allows some
loaders to expose functionality not in all loaders. This will be immediatly
used for glxEnableExtension (formerly known to drivers as
__glXScrEnableExtension). libGL (and in the future libglx) expose this
function so that drivers can enable GLX extensions. libEGL should exposed
eglEnableExtension to enable EGL extensions. The same function cannot be
used for both because the extensions have different names and (possibly)
different semantics. Drivers can optionally use one, both, or neither.
The key parts are in the __DRIinterfaceMethodsRec structure in
dri_interface.h. A pointer to one of these structures is passed into
__driCreateNewScreen. Because of this, the version of the API is bumped to
20050725. Since the previous version(s) were never in a release, their
existance is erased.
I was actually a little surprised by how much code this cuts from the
drivers. A lot of glXGetProcAddress calls disappear, and a lot of
version checks go with them. Nice.
The one thing I'm not sure of is removing __glXInitialize. For some
reason that function was in the glXGetProcAddress table, but *nothing*
in the Mesa tree used it. Did something with DRI conf. use this
function? It seems odd...
Diffstat (limited to 'src/mesa/drivers/dri/tdfx')
-rw-r--r-- | src/mesa/drivers/dri/tdfx/tdfx_screen.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 56fe39e7017..b373129646b 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -346,7 +346,6 @@ static const struct __DriverAPIRec tdfxAPI = { .SwapBuffersMSC = NULL }; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, unsigned depth_bits, @@ -368,7 +367,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, num_modes = (depth_bits == 16) ? 32 : 16; - modes = (*create_context_modes)(num_modes, sizeof(__GLcontextModes)); + modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes)); m = modes; for (i = 0; i <= 1; i++) { @@ -427,7 +426,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -435,6 +434,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { __DRIscreenPrivate *psp; @@ -442,6 +442,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 0, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "tdfx", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -454,10 +456,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &tdfxAPI); - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress((const GLubyte *)"__glXCreateContextModes"); - - if (create_context_modes != NULL) { + if (psp != NULL) { /* divined from tdfx_dri.c, sketchy */ TDFXDRIPtr dri_priv = (TDFXDRIPtr) psp->pDevPriv; int bpp = (dri_priv->cpp > 2) ? 24 : 16; |