mesa: Enable remap table in core.

This enables the remap table in core.  driInitExtensions is adapted to
use the remap table.  All uses of extension_helper.h are replaced by
remap_helper.h.  The chicken-egg problem of the DRI drivers is also
solved.

It is now also possible to pass NULL extensions to driInitExtensions.
It will cause driInitExtensions to map all known functions.  This
functionality is used by software drivers and EGL_i915.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
This commit is contained in:
Chia-I Wu 2009-10-08 10:33:57 +08:00 committed by Brian Paul
parent d7d3fb925b
commit 17ef1f6074
31 changed files with 66 additions and 546 deletions

View File

@ -59,12 +59,13 @@
#define need_GL_NV_vertex_program
#define need_GL_VERSION_2_0
#define need_GL_VERSION_2_1
#include "extension_helper.h"
#include "main/remap_helper.h"
#include "utils.h"
/**
* Extension strings exported by the driver.
*/
const struct dri_extension card_extensions[] = {
static const struct dri_extension card_extensions[] = {
{"GL_ARB_fragment_shader", NULL},
{"GL_ARB_map_buffer_range", GL_ARB_map_buffer_range_functions},
{"GL_ARB_multisample", GL_ARB_multisample_functions},
@ -127,10 +128,7 @@ dri_init_extensions(struct dri_context *ctx)
* capabilities of the pipe_screen. This is actually something
* that can/should be done inside st_create_context().
*/
if (ctx)
driInitExtensions(ctx->st->ctx, card_extensions, GL_TRUE);
else
driInitExtensions(NULL, card_extensions, GL_FALSE);
driInitExtensions(ctx->st->ctx, card_extensions, GL_TRUE);
}
/* vim: set sw=3 ts=8 sts=3 expandtab: */

View File

@ -226,8 +226,6 @@ dri_init_screen(__DRIscreenPrivate * sPriv)
const __DRIconfig **configs;
struct dri1_create_screen_arg arg;
dri_init_extensions(NULL);
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
return NULL;
@ -292,9 +290,6 @@ dri_init_screen2(__DRIscreenPrivate * sPriv)
struct dri_screen *screen;
struct drm_create_screen_arg arg;
/* Set up dispatch table to cope with all known extensions */
dri_init_extensions(NULL);
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
goto fail;

View File

@ -16,73 +16,6 @@
#include "GL/internal/glcore.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_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_framebuffer_object
#define need_GL_EXT_multi_draw_arrays
#define need_GL_EXT_secondary_color
#define need_GL_NV_vertex_program
#include "extension_helper.h"
/**
* TODO HACK! FUGLY!
* Copied for intel extentions.
*/
const struct dri_extension card_extensions[] = {
{"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_pixel_buffer_object", NULL},
{"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_framebuffer_object", GL_EXT_framebuffer_object_functions},
{"GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions},
{"GL_EXT_packed_depth_stencil", NULL},
{"GL_EXT_pixel_buffer_object", NULL},
{"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}
};
_EGLContext *
drm_create_context(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, _EGLContext *share_list, const EGLint *attrib_list)
{

View File

@ -16,7 +16,6 @@
/** HACK */
void* driDriverAPI;
extern const struct dri_extension card_extensions[];
/*
@ -168,8 +167,7 @@ drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor)
goto err_screen;
dev->winsys = dev->screen->winsys;
/* TODO HACK */
driInitExtensions(NULL, card_extensions, GL_FALSE);
driInitExtensions(NULL, NULL, GL_FALSE);
drm_update_res(dev);
res = dev->res;

View File

@ -38,9 +38,6 @@
#include "utils.h"
int driDispatchRemapTable[ driDispatchRemapTable_size ];
unsigned
driParseDebugString( const char * debug,
const struct dri_debug_control * control )
@ -142,7 +139,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
#define need_GL_EXT_blend_func_separate
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#include "main/remap_helper.h"
static const struct dri_extension all_mesa_extensions[] = {
{ "GL_ARB_draw_buffers", GL_ARB_draw_buffers_functions },
@ -165,8 +162,12 @@ static const struct dri_extension all_mesa_extensions[] = {
/**
* Enable extensions supported by the driver.
* Enable and map extensions supported by the driver.
*
* When ctx is NULL, extensions are not enabled, but their functions
* are still mapped. When extensions_to_enable is NULL, all static
* functions known to mesa core are mapped.
*
* \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
@ -181,18 +182,23 @@ void driInitExtensions( GLcontext * ctx,
unsigned i;
if ( first_time ) {
for ( i = 0 ; i < driDispatchRemapTable_size ; i++ ) {
driDispatchRemapTable[i] = -1;
}
first_time = 0;
driInitExtensions( ctx, all_mesa_extensions, GL_FALSE );
driInitExtensions( NULL, all_mesa_extensions, GL_FALSE );
}
if ( (ctx != NULL) && enable_imaging ) {
_mesa_enable_imaging_extensions( ctx );
}
/* The caller is too lazy to list any extension */
if ( extensions_to_enable == NULL ) {
/* Map the static functions. Together with those mapped by remap
* table, this should cover everything mesa core knows.
*/
_mesa_map_static_functions();
return;
}
for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) {
driInitSingleExtension( ctx, & extensions_to_enable[i] );
}
@ -202,80 +208,18 @@ void driInitExtensions( GLcontext * ctx,
/**
* Enable and add dispatch functions for a single extension
* Enable and map 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.
* \sa driInitExtensions, _mesa_enable_extension, _mesa_map_function_array
*/
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;
unsigned offset;
/* 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.
*/
offset = _glapi_add_dispatch( functions, parameter_signature );
if (offset == -1) {
#if 0 /* this causes noise with egl */
fprintf(stderr, "DISPATCH ERROR! _glapi_add_dispatch failed "
"to add %s!\n", functions[0]);
#endif
}
else if (ext->functions[i].remap_index != -1) {
driDispatchRemapTable[ ext->functions[i].remap_index ] =
offset;
}
else if (ext->functions[i].offset != offset) {
fprintf(stderr, "DISPATCH ERROR! %s -> %u != %u\n",
functions[0], offset, ext->functions[i].offset);
}
}
_mesa_map_function_array(ext->functions);
}
if ( ctx != NULL ) {

View File

@ -31,6 +31,7 @@
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
#include "main/context.h"
#include "main/remap.h"
typedef struct __DRIutilversionRec2 __DRIutilversion2;
@ -39,35 +40,6 @@ struct dri_debug_control {
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;
/**
* Location in the remap table where the dispatch offset should be
* stored.
*/
int remap_index;
/**
* Offset of the function in the dispatch table.
*/
int offset;
};
/**
* Description of the API for an extension to OpenGL.
*/
@ -83,7 +55,7 @@ struct dri_extension {
* is terminated by a structure with a \c NULL
* \c dri_extension_function::strings pointer.
*/
const struct dri_extension_function * functions;
const struct gl_function_remap * functions;
};
/**

View File

@ -116,7 +116,7 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
/* Extension strings exported by the i810 driver.
*/
const struct dri_extension card_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_env_add", NULL },

View File

@ -53,8 +53,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "GL/internal/dri_interface.h"
extern const struct dri_extension card_extensions[];
static const __DRIconfig **
i810FillInModes( __DRIscreenPrivate *psp,
unsigned pixel_bits, unsigned depth_bits,
@ -166,8 +164,6 @@ i810InitScreen(__DRIscreen *sPriv)
return NULL;
}
driInitExtensions( NULL, card_extensions, GL_TRUE );
if (sPriv->devPrivSize != sizeof(I810DRIRec)) {
fprintf(stderr,"\nERROR! sizeof(I810DRIRec) does not match passed size from device driver\n");
return GL_FALSE;

View File

@ -28,6 +28,7 @@
#include "intel_chipset.h"
#include "intel_context.h"
#include "intel_extensions.h"
#include "utils.h"
#define need_GL_ARB_copy_buffer
@ -63,7 +64,7 @@
#define need_GL_VERSION_2_0
#define need_GL_VERSION_2_1
#include "extension_helper.h"
#include "main/remap_helper.h"
/**

View File

@ -696,18 +696,6 @@ static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp)
return NULL;
}
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
intelInitExtensions(NULL, GL_TRUE);
if (!intelInitDriver(psp))
return NULL;
@ -760,18 +748,6 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
int color;
__DRIconfig **configs = NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
intelInitExtensions(NULL, GL_TRUE);
/* Allocate the private area */
intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate));
if (!intelScreen) {

View File

@ -76,7 +76,7 @@ static const struct dri_debug_control debug_control[] =
{ NULL, 0 }
};
const struct dri_extension card_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },

View File

@ -67,8 +67,6 @@ static const GLuint __driNConfigOptions = 3;
static const GLuint __driNConfigOptions = 2;
#endif
extern const struct dri_extension card_extensions[];
static const __DRIconfig **
mach64FillInModes( __DRIscreenPrivate *psp,
unsigned pixel_bits, unsigned depth_bits,
@ -436,18 +434,6 @@ mach64InitScreen(__DRIscreenPrivate *psp)
return NULL;
}
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
if (!mach64InitDriver(psp))
return NULL;

View File

@ -78,7 +78,7 @@
#endif
#define need_GL_APPLE_vertex_array_object
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#include "main/remap_helper.h"
/* MGA configuration
*/
@ -945,22 +945,6 @@ static const __DRIconfig **mgaInitScreen(__DRIscreen *psp)
return NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
driInitExtensions( NULL, g400_extensions, GL_FALSE );
driInitExtensions(NULL, ARB_vp_extensions, GL_FALSE);
driInitExtensions( NULL, NV_vp_extensions, GL_FALSE );
if (!mgaInitDriver(psp))
return NULL;

View File

@ -68,9 +68,9 @@ int R128_DEBUG = 0;
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#include "main/remap_helper.h"
const struct dri_extension card_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_env_add", NULL },

View File

@ -74,8 +74,6 @@ static const GLuint __driNConfigOptions = 4;
static const GLuint __driNConfigOptions = 3;
#endif
extern const struct dri_extension card_extensions[];
#if 1
/* Including xf86PciInfo.h introduces a bunch of errors...
*/
@ -493,18 +491,6 @@ r128InitScreen(__DRIscreenPrivate *psp)
&psp->drm_version, & drm_expected ) )
return NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
if (!r128InitDriver(psp))
return NULL;

View File

@ -75,7 +75,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_NV_vertex_program
#define need_GL_ARB_point_parameters
#define need_GL_EXT_framebuffer_object
#include "extension_helper.h"
#include "main/remap_helper.h"
#define DRIVER_DATE "20060602"
@ -115,7 +115,7 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name )
/* Extension strings exported by the R200 driver.
*/
const struct dri_extension card_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions},
@ -146,31 +146,31 @@ const struct dri_extension card_extensions[] =
{ NULL, NULL }
};
const struct dri_extension blend_extensions[] = {
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 }
};
const struct dri_extension ARB_vp_extension[] = {
static const struct dri_extension ARB_vp_extension[] = {
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }
};
const struct dri_extension NV_vp_extension[] = {
static const struct dri_extension NV_vp_extension[] = {
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions }
};
const struct dri_extension ATI_fs_extension[] = {
static const struct dri_extension ATI_fs_extension[] = {
{ "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions }
};
const struct dri_extension point_extensions[] = {
static const struct dri_extension point_extensions[] = {
{ "GL_ARB_point_sprite", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ NULL, NULL }
};
const struct dri_extension mm_extensions[] = {
static const struct dri_extension mm_extensions[] = {
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
{ NULL, NULL }
};

View File

@ -90,10 +90,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_ATI_separate_stencil
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#include "main/remap_helper.h"
const struct dri_extension card_extensions[] = {
static const struct dri_extension card_extensions[] = {
/* *INDENT-OFF* */
{"GL_ARB_depth_texture", NULL},
{"GL_ARB_fragment_program", NULL},
@ -145,7 +145,7 @@ const struct dri_extension card_extensions[] = {
};
const struct dri_extension mm_extensions[] = {
static const struct dri_extension mm_extensions[] = {
{ "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
{ NULL, NULL }
@ -155,7 +155,7 @@ const struct dri_extension mm_extensions[] = {
* The GL 2.0 functions are needed to make display lists work with
* functions added by GL_ATI_separate_stencil.
*/
const struct dri_extension gl_20_extension[] = {
static const struct dri_extension gl_20_extension[] = {
{"GL_VERSION_2_0", GL_VERSION_2_0_functions },
};

View File

@ -92,9 +92,9 @@ int hw_tcl_on = 1;
#define need_GL_ATI_separate_stencil
#define need_GL_NV_vertex_program
#include "extension_helper.h"
#include "main/remap_helper.h"
const struct dri_extension card_extensions[] = {
static const struct dri_extension card_extensions[] = {
/* *INDENT-OFF* */
{"GL_ARB_depth_texture", NULL},
{"GL_ARB_fragment_program", NULL},
@ -145,7 +145,7 @@ const struct dri_extension card_extensions[] = {
};
const struct dri_extension mm_extensions[] = {
static const struct dri_extension mm_extensions[] = {
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
{ NULL, NULL }
};
@ -154,7 +154,7 @@ const struct dri_extension mm_extensions[] = {
* The GL 2.0 functions are needed to make display lists work with
* functions added by GL_ATI_separate_stencil.
*/
const struct dri_extension gl_20_extension[] = {
static const struct dri_extension gl_20_extension[] = {
{"GL_VERSION_2_0", GL_VERSION_2_0_functions },
};

View File

@ -69,7 +69,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#define need_GL_EXT_framebuffer_object
#include "extension_helper.h"
#include "main/remap_helper.h"
#define DRIVER_DATE "20061018"
@ -79,7 +79,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* Extension strings exported by the R100 driver.
*/
const struct dri_extension card_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions},
@ -109,7 +109,7 @@ const struct dri_extension card_extensions[] =
{ NULL, NULL }
};
const struct dri_extension mm_extensions[] = {
static const struct dri_extension mm_extensions[] = {
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
{ NULL, NULL }
};

View File

@ -141,12 +141,6 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 17;
extern const struct dri_extension blend_extensions[];
extern const struct dri_extension ARB_vp_extension[];
extern const struct dri_extension NV_vp_extension[];
extern const struct dri_extension ATI_fs_extension[];
extern const struct dri_extension point_extensions[];
#elif defined(RADEON_R300) || defined(RADEON_R600)
#define DRI_CONF_FP_OPTIMIZATION_SPEED 0
@ -218,13 +212,8 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 17;
extern const struct dri_extension gl_20_extension[];
#endif
extern const struct dri_extension card_extensions[];
extern const struct dri_extension mm_extensions[];
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
static int
@ -1619,27 +1608,6 @@ radeonInitScreen(__DRIscreenPrivate *psp)
return NULL;
}
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create
* is called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
#if defined(RADEON_R200)
driInitExtensions( NULL, blend_extensions, GL_FALSE );
driInitSingleExtension( NULL, ARB_vp_extension );
driInitSingleExtension( NULL, NV_vp_extension );
driInitSingleExtension( NULL, ATI_fs_extension );
driInitExtensions( NULL, point_extensions, GL_FALSE );
#elif (defined(RADEON_R300) || defined(RADEON_R600))
driInitSingleExtension( NULL, gl_20_extension );
#endif
if (!radeonInitDriver(psp))
return NULL;
@ -1672,28 +1640,6 @@ __DRIconfig **radeonInitScreen2(__DRIscreenPrivate *psp)
int color;
__DRIconfig **configs = NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create
* is called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
driInitExtensions( NULL, mm_extensions, GL_FALSE );
#if defined(RADEON_R200)
driInitExtensions( NULL, blend_extensions, GL_FALSE );
driInitSingleExtension( NULL, ARB_vp_extension );
driInitSingleExtension( NULL, NV_vp_extension );
driInitSingleExtension( NULL, ATI_fs_extension );
driInitExtensions( NULL, point_extensions, GL_FALSE );
#elif (defined(RADEON_R300) || defined(RADEON_R600))
driInitSingleExtension( NULL, gl_20_extension );
#endif
if (!radeonInitDriver(psp)) {
return NULL;
}

View File

@ -59,7 +59,7 @@
#include "texmem.h"
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#include "main/remap_helper.h"
#include "xmlpool.h"
@ -980,18 +980,6 @@ savageInitScreen(__DRIscreenPrivate *psp)
&psp->drm_version, & drm_expected ) )
return NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
if (!savageInitDriver(psp))
return NULL;

View File

@ -59,7 +59,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#include "main/remap_helper.h"
#ifndef SIS_DEBUG
int SIS_DEBUG = 0;
@ -69,7 +69,7 @@ int GlobalCurrentHwcx = -1;
int GlobalHwcxCountBase = 1;
int GlobalCmdQueueLen = 0;
struct dri_extension card_extensions[] =
static struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_border_clamp", NULL },
@ -83,7 +83,7 @@ struct dri_extension card_extensions[] =
{ NULL, NULL }
};
struct dri_extension card_extensions_6326[] =
static struct dri_extension card_extensions_6326[] =
{
/*{ "GL_ARB_texture_border_clamp", NULL },*/
/*{ "GL_ARB_texture_mirrored_repeat", NULL },*/

View File

@ -298,18 +298,6 @@ sisInitScreen(__DRIscreenPrivate *psp)
&psp->drm_version, &drm_expected))
return NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
psp->private = sisCreateScreen(psp);
if (!psp->private) {

View File

@ -49,78 +49,6 @@
#include "swrast_priv.h"
#define need_GL_VERSION_1_3
#define need_GL_VERSION_1_4
#define need_GL_VERSION_1_5
#define need_GL_VERSION_2_0
#define need_GL_VERSION_2_1
/* sw extensions for imaging */
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_convolution
#define need_GL_EXT_histogram
#define need_GL_SGI_color_table
/* sw extensions not associated with some GL version */
#define need_GL_ARB_draw_elements_base_vertex
#define need_GL_ARB_shader_objects
#define need_GL_ARB_vertex_array_object
#define need_GL_ARB_vertex_program
#define need_GL_ARB_sync
#define need_GL_APPLE_vertex_array_object
#define need_GL_ATI_fragment_shader
#define need_GL_ATI_separate_stencil
#define need_GL_EXT_depth_bounds_test
#define need_GL_EXT_framebuffer_object
#define need_GL_EXT_framebuffer_blit
#define need_GL_EXT_gpu_program_parameters
#define need_GL_EXT_paletted_texture
#define need_GL_EXT_stencil_two_side
#define need_GL_MESA_resize_buffers
#define need_GL_NV_vertex_program
#define need_GL_NV_fragment_program
#include "extension_helper.h"
const struct dri_extension card_extensions[] =
{
{ "GL_VERSION_1_3", GL_VERSION_1_3_functions },
{ "GL_VERSION_1_4", GL_VERSION_1_4_functions },
{ "GL_VERSION_1_5", GL_VERSION_1_5_functions },
{ "GL_VERSION_2_0", GL_VERSION_2_0_functions },
{ "GL_VERSION_2_1", GL_VERSION_2_1_functions },
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_convolution", GL_EXT_convolution_functions },
{ "GL_EXT_histogram", GL_EXT_histogram_functions },
{ "GL_SGI_color_table", GL_SGI_color_table_functions },
{ "GL_ARB_depth_clamp", NULL },
{ "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions },
{ "GL_ARB_shader_objects", GL_ARB_shader_objects_functions },
{ "GL_ARB_vertex_array_object", GL_ARB_vertex_array_object_functions },
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
{ "GL_ARB_sync", GL_ARB_sync_functions },
{ "GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions },
{ "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions },
{ "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions },
{ "GL_EXT_depth_bounds_test", GL_EXT_depth_bounds_test_functions },
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
{ "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
{ "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
{ "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions },
{ "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions },
{ "GL_NV_depth_clamp", NULL },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_fragment_program", GL_NV_fragment_program_functions },
{ "GL_NV_fragment_program_option", NULL },
{ NULL, NULL }
};
/**
* Screen and config-related functions
*/
@ -244,7 +172,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions,
*driver_configs = (const __DRIconfig **)
driConcatConfigs(configs24, configs32);
driInitExtensions( NULL, card_extensions, GL_FALSE );
driInitExtensions( NULL, NULL, GL_FALSE );
return psp;
}

View File

@ -68,13 +68,13 @@
#define need_GL_EXT_paletted_texture
/* #define need_GL_EXT_secondary_color */
/* #define need_GL_NV_vertex_program */
#include "extension_helper.h"
#include "main/remap_helper.h"
/**
* Common extension strings exported by all cards
*/
const struct dri_extension card_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
@ -107,7 +107,7 @@ const struct dri_extension card_extensions[] =
/**
* Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards.
*/
const struct dri_extension napalm_extensions[] =
static const struct dri_extension napalm_extensions[] =
{
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions },

View File

@ -69,9 +69,6 @@ static const __DRIextension *tdfxExtensions[] = {
static const GLuint __driNConfigOptions = 1;
extern const struct dri_extension card_extensions[];
extern const struct dri_extension napalm_extensions[];
static GLboolean
tdfxCreateScreen( __DRIscreenPrivate *sPriv )
{
@ -418,19 +415,6 @@ tdfxInitScreen(__DRIscreen *psp)
&psp->drm_version, & drm_expected ) )
return NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
driInitExtensions( NULL, napalm_extensions, GL_FALSE );
if (!tdfxInitDriver(psp))
return NULL;

View File

@ -65,7 +65,7 @@
#define need_GL_ARB_point_parameters
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
#include "main/remap_helper.h"
#define DRIVER_DATE "20060710"
@ -362,7 +362,7 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
/* Extension strings exported by the Unichrome driver.
*/
const struct dri_extension card_extensions[] =
static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },

View File

@ -62,8 +62,6 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 3;
extern const struct dri_extension card_extensions[];
static drmBufMapPtr via_create_empty_buffers(void)
{
drmBufMapPtr retval;
@ -393,18 +391,6 @@ viaInitScreen(__DRIscreenPrivate *psp)
&psp->drm_version, & drm_expected) )
return NULL;
/* Calling driInitExtensions here, with a NULL context pointer,
* does not actually enable the extensions. It just makes sure
* that all the dispatch offsets for all the extensions that
* *might* be enables are known. This is needed because the
* dispatch offsets need to be known when _mesa_context_create is
* called, but we can't enable the extensions until we have a
* context pointer.
*
* Hello chicken. Hello egg. How are you two today?
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
if (!viaInitDriver(psp))
return NULL;

View File

@ -1303,71 +1303,6 @@ xmesa_convert_from_x_visual_type( int visualType )
/**********************************************************************/
#ifdef IN_DRI_DRIVER
#define need_GL_VERSION_1_3
#define need_GL_VERSION_1_4
#define need_GL_VERSION_1_5
#define need_GL_VERSION_2_0
/* sw extensions for imaging */
#define need_GL_EXT_blend_color
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_convolution
#define need_GL_EXT_histogram
#define need_GL_SGI_color_table
/* sw extensions not associated with some GL version */
#define need_GL_ARB_draw_elements_base_vertex
#define need_GL_ARB_shader_objects
#define need_GL_ARB_sync
#define need_GL_ARB_vertex_program
#define need_GL_APPLE_vertex_array_object
#define need_GL_ATI_fragment_shader
#define need_GL_EXT_depth_bounds_test
#define need_GL_EXT_framebuffer_object
#define need_GL_EXT_framebuffer_blit
#define need_GL_EXT_gpu_program_parameters
#define need_GL_EXT_paletted_texture
#define need_GL_MESA_resize_buffers
#define need_GL_NV_vertex_program
#define need_GL_NV_fragment_program
#include "extension_helper.h"
#include "utils.h"
const struct dri_extension card_extensions[] =
{
{ "GL_VERSION_1_3", GL_VERSION_1_3_functions },
{ "GL_VERSION_1_4", GL_VERSION_1_4_functions },
{ "GL_VERSION_1_5", GL_VERSION_1_5_functions },
{ "GL_VERSION_2_0", GL_VERSION_2_0_functions },
{ "GL_EXT_blend_color", GL_EXT_blend_color_functions },
{ "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions },
{ "GL_EXT_convolution", GL_EXT_convolution_functions },
{ "GL_EXT_histogram", GL_EXT_histogram_functions },
{ "GL_SGI_color_table", GL_SGI_color_table_functions },
{ "GL_ARB_depth_clamp", NULL },
{ "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions },
{ "GL_ARB_shader_objects", GL_ARB_shader_objects_functions },
{ "GL_ARB_sync", GL_ARB_sync_functions },
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },
{ "GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions },
{ "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions },
{ "GL_EXT_depth_bounds_test", GL_EXT_depth_bounds_test_functions },
{ "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions },
{ "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions },
{ "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions },
{ "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions },
{ "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions },
{ "GL_NV_depth_clamp", NULL },
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
{ "GL_NV_fragment_program", GL_NV_fragment_program_functions },
{ NULL, NULL }
};
#endif
/*
* Create a new X/Mesa visual.
* Input: display - X11 display
@ -1413,14 +1348,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
XMesaVisual v;
GLint red_bits, green_bits, blue_bits, alpha_bits;
#ifdef IN_DRI_DRIVER
/* driInitExtensions() should be called once per screen to setup extension
* indices. There is no need to call it when the context is created since
* XMesa enables mesa sw extensions on its own.
*/
driInitExtensions( NULL, card_extensions, GL_FALSE );
#endif
#ifndef XFree86Server
/* For debugging only */
if (_mesa_getenv("MESA_XSYNC")) {

View File

@ -117,6 +117,7 @@
#include "syncobj.h"
#endif
#include "rastpos.h"
#include "remap.h"
#include "scissor.h"
#include "shared.h"
#include "simple_list.h"
@ -407,6 +408,8 @@ one_time_init( GLcontext *ctx )
_mesa_get_cpu_features();
_mesa_init_remap_table();
_mesa_init_sqrt_table();
for (i = 0; i < 256; i++) {

View File

@ -55,6 +55,7 @@ MAIN_SOURCES = \
main/rastpos.c \
main/rbadaptors.c \
main/readpix.c \
main/remap.c \
main/renderbuffer.c \
main/scissor.c \
main/shaders.c \