From 5a175127f38aa02d2b8169b1b6d08a2d4be3d36f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 22 Aug 2011 16:00:03 -0700 Subject: [PATCH] dri: Remove all extension enabling utility functions Reviewed-by: Kenneth Graunke --- src/mesa/drivers/dri/common/utils.c | 114 ------------------ src/mesa/drivers/dri/common/utils.h | 25 ---- .../drivers/dri/intel/intel_extensions_es.c | 6 - src/mesa/drivers/dri/swrast/swrast.c | 3 - 4 files changed, 148 deletions(-) diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index d8281838233..54156d34ad1 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -137,120 +137,6 @@ driGetRendererString( char * buffer, const char * hardware_name, } - - -#define need_GL_ARB_copy_buffer -#define need_GL_ARB_draw_buffers -#define need_GL_ARB_multisample -#define need_GL_ARB_texture_compression -#define need_GL_ARB_transpose_matrix -#define need_GL_ARB_vertex_buffer_object -#define need_GL_ARB_window_pos -#define need_GL_EXT_compiled_vertex_array -#define need_GL_EXT_multi_draw_arrays -#define need_GL_EXT_polygon_offset -#define need_GL_EXT_texture_object -#define need_GL_EXT_vertex_array -#define need_GL_IBM_multimode_draw_arrays -#define need_GL_MESA_window_pos - -/* These are needed in *all* drivers because Mesa internally implements - * certain functionality in terms of functions provided by these extensions. - * For example, glBlendFunc is implemented by calling glBlendFuncSeparateEXT. - */ -#define need_GL_EXT_blend_func_separate -#define need_GL_NV_vertex_program - -#include "main/remap_helper.h" - -static const struct dri_extension all_mesa_extensions[] = { - { "GL_ARB_copy_buffer", GL_ARB_copy_buffer_functions }, - { "GL_ARB_draw_buffers", GL_ARB_draw_buffers_functions }, - { "GL_ARB_multisample", GL_ARB_multisample_functions }, - { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, - { "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions }, - { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions}, - { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, - { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, - { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions }, - { "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions }, - { "GL_EXT_polygon_offset", GL_EXT_polygon_offset_functions }, - { "GL_EXT_texture_object", GL_EXT_texture_object_functions }, - { "GL_EXT_vertex_array", GL_EXT_vertex_array_functions }, - { "GL_IBM_multimode_draw_arrays", GL_IBM_multimode_draw_arrays_functions }, - { "GL_MESA_window_pos", GL_MESA_window_pos_functions }, - { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, - { NULL, NULL } -}; - - -/** - * 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 - * we need to add entry-points (via \c driInitSingleExtension) for those - * new functions here. - */ -void driInitExtensions( struct gl_context * ctx, - const struct dri_extension * extensions_to_enable, - GLboolean enable_imaging ) -{ - static int first_time = 1; - unsigned i; - - if ( first_time ) { - first_time = 0; - 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] ); - } -} - - - - -/** - * 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, _mesa_map_function_array - */ -void driInitSingleExtension( struct gl_context * ctx, - const struct dri_extension * ext ) -{ - if ( ext->functions != NULL ) { - _mesa_map_function_array(ext->functions); - } - - if ( ctx != NULL ) { - _mesa_enable_extension( ctx, ext->name ); - } -} - - /** * Utility function used by drivers to test the verions of other components. * diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index a1c9ea604ee..100d0dd5159 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -31,7 +31,6 @@ #include #include #include "main/context.h" -#include "main/remap.h" typedef struct __DRIutilversionRec2 __DRIutilversion2; @@ -40,24 +39,6 @@ struct dri_debug_control { unsigned flag; }; -/** - * 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 gl_function_remap * functions; -}; - /** * Used to store a version which includes a major range instead of a single * major version number. @@ -78,12 +59,6 @@ extern unsigned driParseDebugString( const char * debug, extern unsigned driGetRendererString( char * buffer, const char * hardware_name, GLuint agp_mode ); -extern void driInitExtensions( struct gl_context * ctx, - const struct dri_extension * card_extensions, GLboolean enable_imaging ); - -extern void driInitSingleExtension( struct gl_context * ctx, - const struct dri_extension * ext ); - extern GLboolean driCheckDriDdxDrmVersions2(const char * driver_name, const __DRIversion * driActual, const __DRIversion * driExpected, const __DRIversion * ddxActual, const __DRIversion * ddxExpected, diff --git a/src/mesa/drivers/dri/intel/intel_extensions_es.c b/src/mesa/drivers/dri/intel/intel_extensions_es.c index 2af616e8fc5..b1cd96aa71c 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions_es.c +++ b/src/mesa/drivers/dri/intel/intel_extensions_es.c @@ -115,9 +115,6 @@ intelInitExtensionsES1(struct gl_context *ctx) { int i; - /* Can't use driInitExtensions() since it uses extensions from - * main/remap_helper.h when called the first time. */ - for (i = 0; common_extensions[i]; i++) _mesa_enable_extension(ctx, common_extensions[i]); for (i = 0; es1_extensions[i]; i++) @@ -144,9 +141,6 @@ intelInitExtensionsES2(struct gl_context *ctx) { int i; - /* Can't use driInitExtensions() since it uses extensions from - * main/remap_helper.h when called the first time. */ - for (i = 0; common_extensions[i]; i++) _mesa_enable_extension(ctx, common_extensions[i]); for (i = 0; es2_extensions[i]; i++) diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index bbf0b651a0e..6c94947a0ce 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -623,9 +623,6 @@ InitExtensionsES2(struct gl_context *ctx) { int i; - /* Can't use driInitExtensions() since it uses extensions from - * main/remap_helper.h when called the first time. */ - for (i = 0; es2_extensions[i]; i++) _mesa_enable_extension(ctx, es2_extensions[i]); } -- 2.30.2