From c212abf99af494f024b0b981a83350f7ac9821ef Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Jun 2005 16:00:48 +0000 Subject: Replace add_newer_entrypoints (src/mesa/main/context.c) with device-specific code. A new Python script (src/mesa/glapi/extension_helper.py) generates a list of all entry-points for all known extensions. Each driver the selects only the extensions that it needs and enables the via either driInitExtensions or driInitSingleExtension. This code has been compile-tested on a drivers, but has only been run-tested on mga and i915 (on i830 hardware). These changes were discussed at length on the mesa3d-dev mailing list. http://marc.theaimsgroup.com/?t=111947074700001&r=1&w=2 --- src/mesa/drivers/dri/common/utils.h | 49 ++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/common/utils.h') diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 3346914fe6..be328df058 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -32,12 +32,52 @@ #include "context.h" #include "dri_util.h" -struct dri_debug_control -{ +struct dri_debug_control { const char * string; unsigned flag; }; +/** + * Description of the entry-points and parameters for an OpenGL function. + */ +struct dri_extension_function { + /** + * \brief + * Packed string describing the parameter signature and the entry-point + * names. + * + * The parameter signature and the names of the entry-points for this + * function are packed into a single string. The substrings are + * separated by NUL characters. The whole string is terminated by + * two consecutive NUL characters. + */ + const char * strings; + + + /** + * Offset of the function in the dispatch table. + */ + unsigned offset; +}; + +/** + * Description of the API for an extension to OpenGL. + */ +struct dri_extension { + /** + * Name of the extension. + */ + const char * name; + + + /** + * Pointer to a list of \c dri_extension_function structures. The list + * is terminated by a structure with a \c NULL + * \c dri_extension_function::strings pointer. + */ + const struct dri_extension_function * functions; +}; + extern unsigned driParseDebugString( const char * debug, const struct dri_debug_control * control ); @@ -45,7 +85,10 @@ extern unsigned driGetRendererString( char * buffer, const char * hardware_name, const char * driver_date, GLuint agp_mode ); extern void driInitExtensions( GLcontext * ctx, - const char * const card_extensions[], GLboolean enable_imaging ); + const struct dri_extension * card_extensions, GLboolean enable_imaging ); + +extern void driInitSingleExtension( GLcontext * ctx, + const struct dri_extension * ext ); #ifndef DRI_NEW_INTERFACE_ONLY extern GLboolean driCheckDriDdxDrmVersions( __DRIscreenPrivate *sPriv, -- cgit v1.2.3