From 5f1ba3e21b62cee1a4f900a2e6964728f3eeea9b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 26 Jul 2005 02:44:01 +0000 Subject: 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... --- src/mesa/drivers/dri/radeon/radeon_context.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_context.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index e6149e1a58..12f5f40115 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -213,14 +213,6 @@ static const struct dri_debug_control debug_control[] = }; -static int -get_ust_nop( int64_t * ust ) -{ - *ust = 1; - return 0; -} - - /* Create the device specific context. */ GLboolean @@ -450,11 +442,7 @@ radeonCreateContext( const __GLcontextModes *glVisual, rmesa->vblank_flags = (rmesa->radeonScreen->irq != 0) ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ; - rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); - if ( rmesa->get_ust == NULL ) { - rmesa->get_ust = get_ust_nop; - } - (*rmesa->get_ust)( & rmesa->swap_ust ); + (*dri_interface->getUST)( & rmesa->swap_ust ); #if DO_DEBUG -- cgit v1.2.3