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
This commit is contained in:
Ian Romanick 2005-06-30 16:00:48 +00:00
parent 1ac8ae446a
commit c212abf99a
20 changed files with 6699 additions and 487 deletions

File diff suppressed because it is too large Load Diff

View File

@ -180,9 +180,18 @@ driGetRendererString( char * buffer, const char * hardware_name,
/**
* Enable extensions supported by the driver.
*
* \bug
* ARB_imaging isn't handled properly. In Mesa, enabling ARB_imaging also
* enables all the sub-extensions that are folded into it. This means that
* we need to add entry-points (via \c driInitSingleExtension) for those
* new functions here.
*/
void driInitExtensions( GLcontext * ctx,
const char * const extensions_to_enable[],
GLboolean enable_imaging )
const struct dri_extension * extensions_to_enable,
GLboolean enable_imaging )
{
unsigned i;
@ -190,14 +199,84 @@ void driInitExtensions( GLcontext * ctx,
_mesa_enable_imaging_extensions( ctx );
}
for ( i = 0 ; extensions_to_enable[i] != NULL ; i++ ) {
_mesa_enable_extension( ctx, extensions_to_enable[i] );
for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) {
driInitSingleExtension( ctx, & extensions_to_enable[i] );
}
}
/**
* Enable and add dispatch functions for a single extension
*
* \param ctx Context where extension is to be enabled.
* \param ext Extension that is to be enabled.
*
* \sa driInitExtensions, _mesa_enable_extension, _glapi_add_entrypoint
*
* \todo
* Determine if it would be better to use \c strlen instead of the hardcoded
* for-loops.
*/
void driInitSingleExtension( GLcontext * ctx,
const struct dri_extension * ext )
{
unsigned i;
if ( ext->functions != NULL ) {
for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) {
const char * functions[16];
const char * parameter_signature;
const char * str = ext->functions[i].strings;
unsigned j;
/* Separate the parameter signature from the rest of the string.
* If the parameter signature is empty (i.e., the string starts
* with a NUL character), then the function has a void parameter
* list.
*/
parameter_signature = str;
while ( str[0] != '\0' ) {
str++;
}
str++;
/* Divide the string into the substrings that name each
* entry-point for the function.
*/
for ( j = 0 ; j < 16 ; j++ ) {
if ( str[0] == '\0' ) {
functions[j] = NULL;
break;
}
functions[j] = str;
while ( str[0] != '\0' ) {
str++;
}
str++;
}
/* Add each entry-point to the dispatch table.
*/
for ( j = 0 ; functions[j] != NULL ; j++ ) {
_glapi_add_entrypoint( functions[j],
ext->functions[i].offset );
}
}
}
_mesa_enable_extension( ctx, ext->name );
}
#ifndef DRI_NEW_INTERFACE_ONLY
/**
* Utility function used by drivers to test the verions of other components.

View File

@ -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,

View File

@ -61,6 +61,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i810ioctl.h"
#include "utils.h"
#define need_GL_ARB_multisample
#include "extension_helper.h"
#ifndef I810_DEBUG
int I810_DEBUG = (0);
#endif
@ -97,17 +101,18 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
/* Extension strings exported by the i810 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multitexture",
"GL_ARB_texture_env_add",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_lod_bias",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _i810_render_stage;

View File

@ -65,6 +65,17 @@
#include "utils.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#include "xmlpool.h" /* for symbolic values of enum-type options */
#ifndef I830_DEBUG
int I830_DEBUG = (0);
@ -138,35 +149,35 @@ static void i830BufferSize(GLframebuffer *buffer,
/* Extension strings exported by the i830 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_crossbar",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_blend_color",
"GL_EXT_blend_equation_separate",
"GL_EXT_blend_func_separate",
"GL_EXT_blend_minmax",
"GL_EXT_blend_subtract",
"GL_EXT_fog_coord",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_EXT_texture_rectangle",
"GL_NV_blend_square",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_blend_subtract", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_texture_rectangle", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};

View File

@ -38,10 +38,10 @@
* Mesa's Driver Functions
***************************************/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_texture_env_crossbar",
NULL
{ "GL_ARB_texture_env_crossbar", NULL },
{ NULL, NULL }
};

View File

@ -45,14 +45,15 @@
* Mesa's Driver Functions
***************************************/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_depth_texture", /* New: alanh 06-Jan-2005 */
"GL_ARB_fragment_program",
"GL_ARB_shadow", /* New: alanh 06-Jan-2005 */
"GL_EXT_shadow_funcs", /* New: alanh 06-Jan-2005 */
"GL_SGIX_depth_texture", /* ARB extn won't work if not enabled */
NULL
{ "GL_ARB_depth_texture", NULL },
{ "GL_ARB_fragment_program", NULL },
{ "GL_ARB_shadow", NULL },
{ "GL_EXT_shadow_funcs", NULL },
/* ARB extn won't work if not enabled */
{ "GL_SGIX_depth_texture", NULL },
{ NULL, NULL }
};
/* Override intel default.

View File

@ -60,6 +60,23 @@
int INTEL_DEBUG = (0);
#endif
#define need_GL_ARB_multisample
#define need_GL_ARB_point_parameters
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_ARB_window_pos
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_cull_vertex
#define need_GL_EXT_fog_coord
#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#ifndef VERBOSE
int VERBOSE = 0;
#endif
@ -136,48 +153,46 @@ static void intelBufferSize(GLframebuffer *buffer,
* It appears that ARB_texture_env_crossbar has "disappeared" compared to the
* old i830-specific driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_point_parameters",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_cube_map",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_ARB_texture_rectangle",
"GL_ARB_vertex_buffer_object",
"GL_ARB_vertex_program",
"GL_ARB_window_pos",
"GL_EXT_abgr",
"GL_EXT_bgra",
"GL_EXT_blend_color",
"GL_EXT_blend_equation_separate",
"GL_EXT_blend_func_separate",
"GL_EXT_blend_minmax",
"GL_EXT_blend_subtract",
"GL_EXT_cull_vertex", /* New: alanh 06-Jan-2005 */
"GL_EXT_fog_coord",
"GL_EXT_multi_draw_arrays",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_3DFX_texture_compression_FXT1",
"GL_APPLE_client_storage",
"GL_MESA_pack_invert",
"GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
"GL_NV_vertex_program",
"GL_NV_vertex_program1_1",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_cube_map", NULL },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_texture_rectangle", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
{ "GL_ARB_window_pos", GL_ARB_window_pos_functions },
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_blend_subtract", NULL },
{ "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_3DFX_texture_compression_FXT1", NULL },
{ "GL_APPLE_client_storage", NULL },
{ "GL_MESA_pack_invert", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_vertex_program1_1", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _intel_render_stage;

View File

@ -57,6 +57,9 @@
#include "utils.h"
#include "vblank.h"
#define need_GL_ARB_multisample
#include "extension_helper.h"
#ifndef MACH64_DEBUG
int MACH64_DEBUG = (0);
#endif
@ -76,14 +79,14 @@ static const struct dri_debug_control debug_control[] =
{ NULL, 0 }
};
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multitexture",
"GL_EXT_texture_edge_clamp",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
"GL_SGIS_texture_edge_clamp",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};

View File

@ -69,6 +69,18 @@
#include "GL/internal/dri_interface.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_program
#define need_GL_EXT_fog_coord
#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#if 0
#define need_GL_EXT_paletted_texture
#endif
#define need_GL_NV_vertex_program
#include "extension_helper.h"
/* MGA configuration
*/
#include "xmlpool.h"
@ -380,39 +392,47 @@ static const struct tnl_pipeline_stage *mga_pipeline[] = {
};
static const char * const g400_extensions[] =
static const struct dri_extension g400_extensions[] =
{
"GL_ARB_multitexture",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_crossbar",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_edge_clamp",
"GL_ATI_texture_env_combine3",
#if defined (MESA_packed_depth_stencil)
"GL_MESA_packed_depth_stencil",
#endif
NULL
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_ATI_texture_env_combine3", NULL },
{ NULL, NULL }
};
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_texture_compression",
"GL_ARB_texture_rectangle",
"GL_EXT_blend_logic_op",
"GL_EXT_fog_coord",
"GL_EXT_multi_draw_arrays",
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_rectangle", NULL },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
/* paletted_textures currently doesn't work, but we could fix them later */
#if 0
"GL_EXT_shared_texture_palette",
"GL_EXT_paletted_texture",
#if defined( need_GL_EXT_paletted_texture )
{ "GL_EXT_shared_texture_palette", NULL },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
#endif
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_MESA_ycbcr_texture",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
static const struct dri_extension ARB_vp_extension[] = {
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
{ NULL, NULL }
};
static const struct dri_extension NV_vp_extensions[] = {
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_vertex_program1_1", NULL },
{ NULL, NULL }
};
static const struct dri_debug_control debug_control[] =
@ -617,12 +637,11 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
}
if ( driQueryOptionb( &mmesa->optionCache, "arb_vertex_program" ) ) {
_mesa_enable_extension( ctx, "GL_ARB_vertex_program" );
driInitSingleExtension( ctx, ARB_vp_extension );
}
if ( driQueryOptionb( &mmesa->optionCache, "nv_vertex_program" ) ) {
_mesa_enable_extension( ctx, "GL_NV_vertex_program" );
_mesa_enable_extension( ctx, "GL_NV_vertex_program1_1" );
driInitExtensions( ctx, NV_vp_extensions, GL_FALSE );
}

View File

@ -66,19 +66,24 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
int R128_DEBUG = 0;
#endif
static const char * const card_extensions[] =
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_EXT_blend_minmax
#include "extension_helper.h"
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_blend_subtract",
"GL_EXT_texture_edge_clamp",
"GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
static const struct dri_debug_control debug_control[] =

View File

@ -63,6 +63,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_vtxfmt.h"
#include "r200_maos.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#define DRIVER_DATE "20041207"
#include "vblank.h"
@ -119,35 +131,49 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
/* Extension strings exported by the R200 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_ARB_vertex_buffer_object",
"GL_EXT_blend_minmax",
"GL_EXT_blend_subtract",
"GL_EXT_fog_coord",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_EXT_texture_mirror_clamp",
"GL_EXT_texture_rectangle",
"GL_ATI_texture_env_combine3",
"GL_ATI_texture_mirror_once",
"GL_MESA_pack_invert",
"GL_NV_blend_square",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_blend_subtract", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_texture_mirror_clamp", NULL },
{ "GL_EXT_texture_rectangle", NULL },
{ "GL_ATI_texture_env_combine3", NULL },
{ "GL_ATI_texture_mirror_once", NULL },
{ "GL_MESA_pack_invert", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
static const struct dri_extension blend_extensions[] = {
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ NULL, NULL }
};
static const struct dri_extension ARB_vp_extension[] = {
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }
};
static const struct dri_extension NV_vp_extension[] = {
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions }
};
extern const struct tnl_pipeline_stage _r200_render_stage;
@ -439,13 +465,12 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
if (rmesa->r200Screen->drmSupportsCubeMaps)
_mesa_enable_extension( ctx, "GL_ARB_texture_cube_map" );
if (rmesa->r200Screen->drmSupportsBlendColor) {
_mesa_enable_extension( ctx, "GL_EXT_blend_equation_separate" );
_mesa_enable_extension( ctx, "GL_EXT_blend_func_separate" );
driInitExtensions( ctx, blend_extensions, GL_FALSE );
}
if(driQueryOptionb(&rmesa->optionCache, "arb_vertex_program"))
_mesa_enable_extension( ctx, "GL_ARB_vertex_program");
driInitSingleExtension( ctx, ARB_vp_extension );
if(driQueryOptionb(&rmesa->optionCache, "nv_vertex_program"))
_mesa_enable_extension( ctx, "GL_NV_vertex_program");
driInitSingleExtension( ctx, NV_vp_extension );
#if 0
r200InitDriverFuncs( ctx );

View File

@ -63,6 +63,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "radeon_vtxfmt.h"
#include "radeon_maos.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#define DRIVER_DATE "20050528"
#include "vblank.h"
@ -119,33 +125,33 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name )
/* Extension strings exported by the R100 driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multisample",
"GL_ARB_multitexture",
"GL_ARB_texture_border_clamp",
"GL_ARB_texture_compression",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
"GL_ARB_texture_env_crossbar",
"GL_ARB_texture_env_dot3",
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_blend_logic_op",
"GL_EXT_blend_subtract",
"GL_EXT_secondary_color",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_edge_clamp",
"GL_EXT_texture_env_combine",
"GL_EXT_texture_env_dot3",
"GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_lod_bias",
"GL_EXT_texture_mirror_clamp",
"GL_ATI_texture_env_combine3",
"GL_ATI_texture_mirror_once",
"GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
"GL_SGIS_generate_mipmap",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
{ "GL_EXT_texture_env_dot3", NULL },
{ "GL_EXT_texture_filter_anisotropic", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_texture_mirror_clamp", NULL },
{ "GL_ATI_texture_env_combine3", NULL },
{ "GL_ATI_texture_mirror_once", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _radeon_texrect_stage;

View File

@ -58,6 +58,10 @@
#include "texmem.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
#include "extension_helper.h"
#include "xmlpool.h"
/* Driver-specific options
@ -127,17 +131,19 @@ unsigned long time_sum=0;
struct timeval tv_s1,tv_f1;
#endif
static const char *const common_extensions[] =
static const struct dri_extension common_extensions[] =
{
"GL_ARB_multitexture",
"GL_EXT_texture_lod_bias",
"GL_ARB_texture_compression",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_EXT_texture_lod_bias", NULL },
{ NULL, NULL }
};
static const char *const s4_extensions[] =
static const struct dri_extension s4_extensions[] =
{
"GL_EXT_texture_env_add",
NULL
{ "GL_ARB_texture_env_add", NULL },
{ NULL, NULL }
};
extern struct tnl_pipeline_stage _savage_texnorm_stage;

View File

@ -57,16 +57,20 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
#define need_GL_ARB_multisample
#include "extension_helper.h"
int GlobalCurrentHwcx = -1;
int GlobalHwcxCountBase = 1;
int GlobalCmdQueueLen = 0;
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multitexture",
"GL_EXT_texture_lod_bias",
"GL_NV_blend_square",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_NV_blend_square", NULL },
{ NULL, NULL }
};
void

View File

@ -62,55 +62,80 @@
#include "utils.h"
#define need_GL_ARB_multisample
/* #define need_GL_ARB_point_parameters */
#define need_GL_ARB_texture_compression
#define need_GL_ARB_vertex_buffer_object
/* #define need_GL_ARB_vertex_program */
#define need_GL_EXT_blend_equation_separate
#define need_GL_EXT_blend_func_separate
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_paletted_texture
/* #define need_GL_EXT_secondary_color */
#define need_GL_IBM_multimode_draw_arrays
/* #define need_GL_MESA_program_debug */
/* #define need_GL_NV_vertex_program */
#include "extension_helper.h"
/**
* Common extension strings exported by all cards
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_texture_mirrored_repeat",
"GL_ARB_vertex_buffer_object",
"GL_EXT_blend_func_separate",
"GL_EXT_fog_coord",
"GL_EXT_multi_draw_arrays",
"GL_EXT_paletted_texture",
"GL_EXT_shared_texture_palette",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_env_add",
"GL_EXT_texture_lod_bias",
"GL_HP_occlusion_test",
"GL_IBM_multimode_draw_arrays",
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
#if 0
"GL_ARB_point_sprite",
"GL_EXT_point_parameters",
"GL_EXT_secondary_color",
{ "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
{ "GL_EXT_shared_texture_palette", NULL },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_env_add", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_HP_occlusion_test", NULL },
{ "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions },
#ifdef need_GL_ARB_point_parameters
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_point_sprite", NULL },
#endif
#if 0
/* not just yet */
"GL_ARB_vertex_program",
"GL_NV_vertex_program",
"GL_NV_vertex_program1_1",
"GL_MESA_program_debug",
#ifdef need_GL_EXT_secondary_color
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
#endif
NULL
#ifdef need_GL_ARB_vertex_program
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }
#endif
#ifdef need_GL_NV_vertex_program
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions }
{ "GL_NV_vertex_program1_1", NULL },
#endif
#ifdef need_GL_MESA_program_debug
{ "GL_MESA_program_debug", GL_MESA_program_debug_functions },
#endif
{ NULL, NULL }
};
/**
* Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards.
*/
static const char * const napalm_extensions[] =
static const struct dri_extension napalm_extensions[] =
{
"GL_ARB_texture_compression",
"GL_ARB_texture_env_combine",
"GL_EXT_blend_equation_separate",
"GL_EXT_blend_subtract",
"GL_EXT_texture_compression_s3tc",
"GL_EXT_texture_env_combine",
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_texture_compression_s3tc", NULL },
{ "GL_EXT_texture_env_combine", NULL },
"GL_3DFX_texture_compression_FXT1",
"GL_NV_blend_square",
"GL_S3_s3tc",
NULL
{ "GL_3DFX_texture_compression_FXT1", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_S3_s3tc", NULL },
{ NULL, NULL }
};
/*

View File

@ -60,6 +60,12 @@
#include <stdio.h>
#include "macros.h"
#define need_GL_ARB_multisample
#define need_GL_ARB_point_parameters
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#define DRIVER_DATE "20050526"
#include "vblank.h"
@ -245,22 +251,23 @@ static void viaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
/* Extension strings exported by the Unichrome driver.
*/
static const char * const card_extensions[] =
static const struct dri_extension card_extensions[] =
{
"GL_ARB_multitexture",
"GL_ARB_point_parameters",
"GL_ARB_texture_env_add",
"GL_ARB_texture_env_combine",
/* "GL_ARB_texture_env_dot3", */
"GL_ARB_texture_mirrored_repeat",
"GL_EXT_stencil_wrap",
"GL_EXT_texture_env_combine",
/* "GL_EXT_texture_env_dot3", */
"GL_EXT_texture_lod_bias",
"GL_EXT_secondary_color",
"GL_EXT_fog_coord",
"GL_NV_blend_square",
NULL
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_env_combine", NULL },
/* { "GL_ARB_texture_env_dot3", NULL }, */
{ "GL_ARB_texture_mirrored_repeat", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_env_combine", NULL },
/* { "GL_EXT_texture_env_dot3", NULL }, */
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_NV_blend_square", NULL },
{ NULL, NULL }
};
extern const struct tnl_pipeline_stage _via_fastrender_stage;

View File

@ -7,6 +7,7 @@
OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h \
../main/enums.c \
../x86/glapi_x86.S \
../drivers/dri/common/extension_helper.h \
../../glx/x11/indirect.c \
../../glx/x11/indirect.h \
../../glx/x11/indirect_init.c \
@ -39,6 +40,9 @@ glapitable.h: $(COMMON) gl_table.py
../x86/glapi_x86.S: $(COMMON) gl_x86_asm.py
$(PYTHON2) $(PYTHON_FLAGS) gl_x86_asm.py > ../x86/glapi_x86.S
../drivers/dri/common/extension_helper.h: $(COMMON) extension_helper.py
$(PYTHON2) $(PYTHON_FLAGS) extension_helper.py > ../drivers/dri/common/extension_helper.h
../../glx/x11/indirect.c: $(COMMON_GLX) glX_proto_send.py
$(PYTHON2) $(PYTHON_FLAGS) glX_proto_send.py -m proto > ../../glx/x11/indirect.c

View File

@ -0,0 +1,289 @@
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Authors:
# Ian Romanick <idr@us.ibm.com>
import gl_XML
import license
import sys, getopt, string
vtxfmt = [
"ArrayElement", \
"Color3f", \
"Color3fv", \
"Color4f", \
"Color4fv", \
"EdgeFlag", \
"EdgeFlagv", \
"EvalCoord1f", \
"EvalCoord1fv", \
"EvalCoord2f", \
"EvalCoord2fv", \
"EvalPoint1", \
"EvalPoint2", \
"FogCoordfEXT", \
"FogCoordfvEXT", \
"Indexf", \
"Indexfv", \
"Materialfv", \
"MultiTexCoord1fARB", \
"MultiTexCoord1fvARB", \
"MultiTexCoord2fARB", \
"MultiTexCoord2fvARB", \
"MultiTexCoord3fARB", \
"MultiTexCoord3fvARB", \
"MultiTexCoord4fARB", \
"MultiTexCoord4fvARB", \
"Normal3f", \
"Normal3fv", \
"SecondaryColor3fEXT", \
"SecondaryColor3fvEXT", \
"TexCoord1f", \
"TexCoord1fv", \
"TexCoord2f", \
"TexCoord2fv", \
"TexCoord3f", \
"TexCoord3fv", \
"TexCoord4f", \
"TexCoord4fv", \
"Vertex2f", \
"Vertex2fv", \
"Vertex3f", \
"Vertex3fv", \
"Vertex4f", \
"Vertex4fv", \
"CallList", \
"CallLists", \
"Begin", \
"End", \
"VertexAttrib1fNV", \
"VertexAttrib1fvNV", \
"VertexAttrib2fNV", \
"VertexAttrib2fvNV", \
"VertexAttrib3fNV", \
"VertexAttrib3fvNV", \
"VertexAttrib4fNV", \
"VertexAttrib4fvNV", \
"VertexAttrib1fARB", \
"VertexAttrib1fvARB", \
"VertexAttrib2fARB", \
"VertexAttrib2fvARB", \
"VertexAttrib3fARB", \
"VertexAttrib3fvARB", \
"VertexAttrib4fARB", \
"VertexAttrib4fvARB", \
"Rectf", \
"DrawArrays", \
"DrawElements", \
"DrawRangeElements", \
"EvalMesh1", \
"EvalMesh2", \
]
def condition_for_function(f, abi, all_not_in_ABI):
"""Create a C-preprocessor condition for the function.
There are two modes of operation. If all_not_in_ABI is set, a
condition is only created is all of the entry-point names for f are
not in the selected ABI. If all_not_in_ABI is not set, a condition
is created if any entryp-point name is not in the selected ABI.
"""
condition = []
for n in f.entry_points:
[category, num] = api.get_category_for_name( n )
if category not in abi:
condition.append( 'defined(need_%s)' % (gl_XML.real_category_name( category )) )
elif all_not_in_ABI:
return []
return condition
class PrintGlExtensionGlue(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "extension_helper.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
def printRealHeader(self):
print '#include "utils.h"'
print ''
return
def printBody(self, api):
abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
category_list = {}
print '#ifndef NULL'
print '# define NULL 0'
print '#endif'
print ''
for f in api.functionIterateAll():
condition = condition_for_function(f, abi, 0)
if len(condition):
print '#if %s' % (string.join(condition, " || "))
print 'static const char %s_names[] = ' % (f.name)
parameter_signature = ''
for p in f.parameterIterator():
# FIXME: This is a *really* ugly hack. :(
tn = p.type_expr.get_base_type_node()
if p.is_pointer():
parameter_signature += 'p'
elif tn.integer:
parameter_signature += 'i'
elif tn.size == 4:
parameter_signature += 'f'
else:
parameter_signature += 'd'
print ' "%s\\0" /* Parameter signature */' % (parameter_signature)
for n in f.entry_points:
print ' "gl%s\\0"' % (n)
[category, num] = api.get_category_for_name( n )
if category not in abi:
c = gl_XML.real_category_name(category)
if not category_list.has_key(c):
category_list[ c ] = []
category_list[ c ].append( [f.name, f.offset] )
print ' "";'
print '#endif'
print ''
keys = category_list.keys()
keys.sort()
for category in keys:
print '#if defined(need_%s)' % (category)
print 'static const struct dri_extension_function %s_functions[] = {' % (category)
for [function, offset] in category_list[ category ]:
print ' { %s_names, %d },' % (function, offset)
print ' { NULL, 0 }'
print '};'
print '#endif'
print ''
return
class PrintInitDispatch(gl_XML.gl_print_base):
def __init__(self):
gl_XML.gl_print_base.__init__(self)
self.name = "extension_helper.py (from Mesa)"
self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM")
return
def do_function_body(self, api, abi, vtxfmt_only):
last_condition_string = None
for f in api.functionIterateByOffset():
if (f.name in vtxfmt) and not vtxfmt_only:
continue
if (f.name not in vtxfmt) and vtxfmt_only:
continue
condition = condition_for_function(f, abi, 1)
condition_string = string.join(condition, " || ")
if condition_string != last_condition_string:
if last_condition_string:
print '#endif /* %s */' % (last_condition_string)
if condition_string:
print '#if %s' % (condition_string)
if vtxfmt_only:
print ' disp->%s = vfmt->%s;' % (f.name, f.name)
else:
print ' disp->%s = _mesa_%s;' % (f.name, f.name)
last_condition_string = condition_string
if last_condition_string:
print '#endif /* %s */' % (last_condition_string)
def printBody(self, api):
abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ]
print 'void driver_init_exec_table(struct _glapi_table *disp)'
print '{'
self.do_function_body(api, abi, 0)
print '}'
print ''
print 'void driver_install_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt)'
print '{'
self.do_function_body(api, abi, 1)
print '}'
return
def show_usage():
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
print " -m output_mode Output mode can be one of 'extensions' or 'exec_init'."
sys.exit(1)
if __name__ == '__main__':
file_name = "gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
except Exception,e:
show_usage()
mode = "extensions"
for (arg,val) in args:
if arg == "-f":
file_name = val
if arg == '-m':
mode = val
api = gl_XML.parse_GL_API( file_name )
if mode == "extensions":
printer = PrintGlExtensionGlue()
elif mode == "exec_init":
printer = PrintInitDispatch()
else:
show_usage()
printer.Print( api )

View File

@ -1087,224 +1087,6 @@ init_attrib_groups( GLcontext *ctx )
}
/**
* If the DRI libGL.so library is old, it may not have the entrypoints for
* some recent OpenGL extensions. Dynamically add them now.
* If we're building stand-alone Mesa where libGL.so has both the dispatcher
* and driver code, this won't be an issue (and calling this function won't
* do any harm).
*/
static void
add_newer_entrypoints(void)
{
unsigned i;
static const struct {
const char * const name;
unsigned offset;
}
newer_entrypoints[] = {
/* GL_ARB_window_pos aliases with GL_MESA_window_pos */
{ "glWindowPos2dARB", 513 },
{ "glWindowPos2dvARB", 514 },
{ "glWindowPos2fARB", 515 },
{ "glWindowPos2fvARB", 516 },
{ "glWindowPos2iARB", 517 },
{ "glWindowPos2ivARB", 518 },
{ "glWindowPos2sARB", 519 },
{ "glWindowPos2svARB", 520 },
{ "glWindowPos3dARB", 521 },
{ "glWindowPos3dvARB", 522 },
{ "glWindowPos3fARB", 523 },
{ "glWindowPos3fvARB", 524 },
{ "glWindowPos3iARB", 525 },
{ "glWindowPos3ivARB", 526 },
{ "glWindowPos3sARB", 527 },
{ "glWindowPos3svARB", 528 },
#if FEATURE_NV_vertex_program
{ "glAreProgramsResidentNV", 578 },
{ "glBindProgramNV", 579 },
{ "glDeleteProgramsNV", 580 },
{ "glExecuteProgramNV", 581 },
{ "glGenProgramsNV", 582 },
{ "glGetProgramParameterdvNV", 583 },
{ "glGetProgramParameterfvNV", 584 },
{ "glGetProgramivNV", 585 },
{ "glGetProgramStringNV", 586 },
{ "glGetTrackMatrixivNV", 587 },
{ "glGetVertexAttribdvNV", 588 },
{ "glGetVertexAttribfvNV", 589 },
{ "glGetVertexAttribivNV", 590 },
{ "glGetVertexAttribPointervNV", 591 },
{ "glIsProgramNV", 592 },
{ "glLoadProgramNV", 593 },
{ "glProgramParameter4dNV", 594 },
{ "glProgramParameter4dvNV", 595 },
{ "glProgramParameter4fNV", 596 },
{ "glProgramParameter4fvNV", 597 },
{ "glProgramParameters4dvNV", 598 },
{ "glProgramParameters4fvNV", 599 },
{ "glRequestResidentProgramsNV", 600 },
{ "glTrackMatrixNV", 601 },
{ "glVertexAttribPointerNV", 602 },
{ "glVertexAttrib1dNV", 603 },
{ "glVertexAttrib1dvNV", 604 },
{ "glVertexAttrib1fNV", 605 },
{ "glVertexAttrib1fvNV", 606 },
{ "glVertexAttrib1sNV", 607 },
{ "glVertexAttrib1svNV", 608 },
{ "glVertexAttrib2dNV", 609 },
{ "glVertexAttrib2dvNV", 610 },
{ "glVertexAttrib2fNV", 611 },
{ "glVertexAttrib2fvNV", 612 },
{ "glVertexAttrib2sNV", 613 },
{ "glVertexAttrib2svNV", 614 },
{ "glVertexAttrib3dNV", 615 },
{ "glVertexAttrib3dvNV", 616 },
{ "glVertexAttrib3fNV", 617 },
{ "glVertexAttrib3fvNV", 618 },
{ "glVertexAttrib3sNV", 619 },
{ "glVertexAttrib3svNV", 620 },
{ "glVertexAttrib4dNV", 621 },
{ "glVertexAttrib4dvNV", 622 },
{ "glVertexAttrib4fNV", 623 },
{ "glVertexAttrib4fvNV", 624 },
{ "glVertexAttrib4sNV", 625 },
{ "glVertexAttrib4svNV", 626 },
{ "glVertexAttrib4ubNV", 627 },
{ "glVertexAttrib4ubvNV", 628 },
{ "glVertexAttribs1dvNV", 629 },
{ "glVertexAttribs1fvNV", 630 },
{ "glVertexAttribs1svNV", 631 },
{ "glVertexAttribs2dvNV", 632 },
{ "glVertexAttribs2fvNV", 633 },
{ "glVertexAttribs2svNV", 634 },
{ "glVertexAttribs3dvNV", 635 },
{ "glVertexAttribs3fvNV", 636 },
{ "glVertexAttribs3svNV", 637 },
{ "glVertexAttribs4dvNV", 638 },
{ "glVertexAttribs4fvNV", 639 },
{ "glVertexAttribs4svNV", 640 },
{ "glVertexAttribs4ubvNV", 641 },
#endif
{ "glPointParameteriNV", 642 },
{ "glPointParameterivNV", 643 },
{ "glMultiDrawArraysEXT", 644 },
{ "glMultiDrawElementsEXT", 645 },
{ "glMultiDrawArraysSUN", _gloffset_MultiDrawArraysEXT },
{ "glMultiDrawElementsSUN", _gloffset_MultiDrawElementsEXT },
{ "glActiveStencilFaceEXT", 646 },
#if FEATURE_NV_fence
{ "glDeleteFencesNV", 647 },
{ "glGenFencesNV", 648 },
{ "glIsFenceNV", 649 },
{ "glTestFenceNV", 650 },
{ "glGetFenceivNV", 651 },
{ "glFinishFenceNV", 652 },
{ "glSetFenceNV", 653 },
#endif
#if FEATURE_NV_fragment_program
{ "glProgramNamedParameter4fNV", 682 },
{ "glProgramNamedParameter4dNV", 683 },
{ "glProgramNamedParameter4fvNV", 683 },
{ "glProgramNamedParameter4dvNV", 684 },
{ "glGetProgramNamedParameterfvNV", 685 },
{ "glGetProgramNamedParameterdvNV", 686 },
#endif
#if FEATURE_ARB_vertex_program
{ "glVertexAttrib1sARB", _gloffset_VertexAttrib1sNV },
{ "glVertexAttrib1fARB", _gloffset_VertexAttrib1fNV },
{ "glVertexAttrib1dARB", _gloffset_VertexAttrib1dNV },
{ "glVertexAttrib2sARB", _gloffset_VertexAttrib2sNV },
{ "glVertexAttrib2fARB", _gloffset_VertexAttrib2fNV },
{ "glVertexAttrib2dARB", _gloffset_VertexAttrib2dNV },
{ "glVertexAttrib3sARB", _gloffset_VertexAttrib3sNV },
{ "glVertexAttrib3fARB", _gloffset_VertexAttrib3fNV },
{ "glVertexAttrib3dARB", _gloffset_VertexAttrib3dNV },
{ "glVertexAttrib4sARB", _gloffset_VertexAttrib4sNV },
{ "glVertexAttrib4fARB", _gloffset_VertexAttrib4fNV },
{ "glVertexAttrib4dARB", _gloffset_VertexAttrib4dNV },
{ "glVertexAttrib4NubARB", _gloffset_VertexAttrib4ubNV },
{ "glVertexAttrib1svARB", _gloffset_VertexAttrib1svNV },
{ "glVertexAttrib1fvARB", _gloffset_VertexAttrib1fvNV },
{ "glVertexAttrib1dvARB", _gloffset_VertexAttrib1dvNV },
{ "glVertexAttrib2svARB", _gloffset_VertexAttrib2svNV },
{ "glVertexAttrib2fvARB", _gloffset_VertexAttrib2fvNV },
{ "glVertexAttrib2dvARB", _gloffset_VertexAttrib2dvNV },
{ "glVertexAttrib3svARB", _gloffset_VertexAttrib3svNV },
{ "glVertexAttrib3fvARB", _gloffset_VertexAttrib3fvNV },
{ "glVertexAttrib3dvARB", _gloffset_VertexAttrib3dvNV },
{ "glVertexAttrib4bvARB", _gloffset_VertexAttrib4bvARB },
{ "glVertexAttrib4svARB", _gloffset_VertexAttrib4svNV },
{ "glVertexAttrib4ivARB", _gloffset_VertexAttrib4ivARB },
{ "glVertexAttrib4ubvARB", _gloffset_VertexAttrib4ubvARB },
{ "glVertexAttrib4usvARB", _gloffset_VertexAttrib4usvARB },
{ "glVertexAttrib4uivARB", _gloffset_VertexAttrib4uivARB },
{ "glVertexAttrib4fvARB", _gloffset_VertexAttrib4fvNV },
{ "glVertexAttrib4dvARB", _gloffset_VertexAttrib4dvNV },
{ "glVertexAttrib4NbvARB", _gloffset_VertexAttrib4NbvARB },
{ "glVertexAttrib4NsvARB", _gloffset_VertexAttrib4NsvARB },
{ "glVertexAttrib4NivARB", _gloffset_VertexAttrib4NivARB },
{ "glVertexAttrib4NubvARB", _gloffset_VertexAttrib4ubvNV },
{ "glVertexAttrib4NusvARB", _gloffset_VertexAttrib4NusvARB },
{ "glVertexAttrib4NuivARB", _gloffset_VertexAttrib4NuivARB },
{ "glVertexAttribPointerARB", _gloffset_VertexAttribPointerARB },
{ "glEnableVertexAttribArrayARB", _gloffset_EnableVertexAttribArrayARB },
{ "glDisableVertexAttribArrayARB", _gloffset_DisableVertexAttribArrayARB },
{ "glProgramStringARB", _gloffset_ProgramStringARB },
{ "glBindProgramARB", _gloffset_BindProgramNV },
{ "glDeleteProgramsARB", _gloffset_DeleteProgramsNV },
{ "glGenProgramsARB", _gloffset_GenProgramsNV },
{ "glIsProgramARB", _gloffset_IsProgramNV },
{ "glProgramEnvParameter4dARB", _gloffset_ProgramEnvParameter4dARB },
{ "glProgramEnvParameter4dvARB", _gloffset_ProgramEnvParameter4dvARB },
{ "glProgramEnvParameter4fARB", _gloffset_ProgramEnvParameter4fARB },
{ "glProgramEnvParameter4fvARB", _gloffset_ProgramEnvParameter4fvARB },
{ "glProgramLocalParameter4dARB", _gloffset_ProgramLocalParameter4dARB },
{ "glProgramLocalParameter4dvARB", _gloffset_ProgramLocalParameter4dvARB },
{ "glProgramLocalParameter4fARB", _gloffset_ProgramLocalParameter4fARB },
{ "glProgramLocalParameter4fvARB", _gloffset_ProgramLocalParameter4fvARB },
{ "glGetProgramEnvParameterdvARB", _gloffset_GetProgramEnvParameterdvARB },
{ "glGetProgramEnvParameterfvARB", _gloffset_GetProgramEnvParameterfvARB },
{ "glGetProgramLocalParameterdvARB", _gloffset_GetProgramLocalParameterdvARB },
{ "glGetProgramLocalParameterfvARB", _gloffset_GetProgramLocalParameterfvARB },
{ "glGetProgramivARB", _gloffset_GetProgramivARB },
{ "glGetProgramStringARB", _gloffset_GetProgramStringARB },
{ "glGetVertexAttribdvARB", _gloffset_GetVertexAttribdvNV },
{ "glGetVertexAttribfvARB", _gloffset_GetVertexAttribfvNV },
{ "glGetVertexAttribivARB", _gloffset_GetVertexAttribivNV },
{ "glGetVertexAttribPointervARB", _gloffset_GetVertexAttribPointervNV },
#endif
{ "glMultiModeDrawArraysIBM", _gloffset_MultiModeDrawArraysIBM },
{ "glMultiModeDrawElementsIBM", _gloffset_MultiModeDrawElementsIBM },
/* GL_EXT_stencil_two_side */
{ "glActiveStencilFaceEXT", _gloffset_ActiveStencilFaceEXT },
/* GL_ARB_draw_buffers */
{ "glDrawBuffersARB", _gloffset_DrawBuffersARB },
#if FEATURE_ATI_fragment_shader
{ "glGenFragmentShadersATI", _gloffset_GenFragmentShadersATI },
{ "glBindFragmentShaderATI", _gloffset_BindFragmentShaderATI },
{ "glDeleteFragmentShaderATI", _gloffset_DeleteFragmentShaderATI },
{ "glBeginFragmentShaderATI", _gloffset_BeginFragmentShaderATI },
{ "glEndFragmentShaderATI", _gloffset_EndFragmentShaderATI },
{ "glPassTexCoordATI", _gloffset_PassTexCoordATI },
{ "glSampleMapATI", _gloffset_SampleMapATI },
{ "glColorFragmentOp1ATI", _gloffset_ColorFragmentOp1ATI },
{ "glColorFragmentOp2ATI", _gloffset_ColorFragmentOp2ATI },
{ "glColorFragmentOp3ATI", _gloffset_ColorFragmentOp3ATI },
{ "glAlphaFragmentOp1ATI", _gloffset_AlphaFragmentOp1ATI },
{ "glAlphaFragmentOp2ATI", _gloffset_AlphaFragmentOp2ATI },
{ "glAlphaFragmentOp3ATI", _gloffset_AlphaFragmentOp3ATI },
{ "glSetFragmentShaderConstantATI", _gloffset_SetFragmentShaderConstantATI },
#endif
};
for (i = 0; i < Elements(newer_entrypoints); i++ ) {
_glapi_add_entrypoint( newer_entrypoints[i].name,
newer_entrypoints[i].offset );
}
}
/**
* This is the default function we plug into all dispatch table slots
* This helps prevents a segfault when someone calls a GL function without
@ -1425,9 +1207,6 @@ _mesa_initialize_context( GLcontext *ctx,
return GL_FALSE;
}
/* libGL ABI coordination */
add_newer_entrypoints();
/* setup the API dispatch tables */
ctx->Exec = alloc_dispatch_table();
ctx->Save = alloc_dispatch_table();