diff options
author | Ian Romanick <[email protected]> | 2005-06-30 16:00:48 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-06-30 16:00:48 +0000 |
commit | c212abf99af494f024b0b981a83350f7ac9821ef (patch) | |
tree | cd96ba38b82a5ecaccb7a7f28fc65168688fc2ce /src/mesa/drivers/dri/common/utils.h | |
parent | 1ac8ae446af753ec1bdbb789d7b575a72ff56e8f (diff) |
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
Diffstat (limited to 'src/mesa/drivers/dri/common/utils.h')
-rw-r--r-- | src/mesa/drivers/dri/common/utils.h | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 3346914fe60..be328df058f 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, |