[Mesa-dev] [PATCH 17/21] mesa: Remove redundant vertex program extension enables
Ian Romanick
idr at freedesktop.org
Sat Aug 27 00:57:07 PDT 2011
From: Ian Romanick <ian.d.romanick at intel.com>
Specifically, remove extraneous enables of the following extensions:
GL_ARB_vertex_program
GL_EXT_gpu_program_paramaters
GL_NV_vertex_program
These extensions are enabled by default in _mesa_init_extensions, so
drivers don't need to enable them again.
---
src/mesa/drivers/dri/intel/intel_extensions.c | 3 ---
src/mesa/drivers/dri/nouveau/nouveau_context.c | 3 ---
src/mesa/drivers/dri/r200/r200_context.c | 8 --------
src/mesa/drivers/dri/r300/r300_context.c | 3 ---
src/mesa/drivers/dri/r600/r600_context.c | 3 ---
src/mesa/drivers/dri/radeon/radeon_context.c | 3 ---
src/mesa/drivers/dri/radeon/radeon_screen.c | 11 +++++++++++
src/mesa/main/extensions.c | 6 +++---
src/mesa/state_tracker/st_extensions.c | 3 ---
9 files changed, 14 insertions(+), 29 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index 6c36d30..009b4e7 100644
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -75,7 +75,6 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.ARB_texture_env_dot3 = true;
ctx->Extensions.ARB_texture_mirrored_repeat = true;
ctx->Extensions.ARB_vertex_array_object = true;
- ctx->Extensions.ARB_vertex_program = true;
ctx->Extensions.ARB_vertex_shader = true;
ctx->Extensions.EXT_blend_color = true;
ctx->Extensions.EXT_blend_equation_separate = true;
@@ -87,7 +86,6 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.EXT_framebuffer_object = true;
ctx->Extensions.EXT_framebuffer_multisample = true;
ctx->Extensions.EXT_fog_coord = true;
- ctx->Extensions.EXT_gpu_program_parameters = true;
ctx->Extensions.EXT_packed_depth_stencil = true;
ctx->Extensions.EXT_pixel_buffer_object = true;
ctx->Extensions.EXT_point_parameters = true;
@@ -108,7 +106,6 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.MESA_ycbcr_texture = true;
ctx->Extensions.NV_blend_square = true;
ctx->Extensions.NV_texture_rectangle = true;
- ctx->Extensions.NV_vertex_program = true;
ctx->Extensions.NV_vertex_program1_1 = true;
ctx->Extensions.TDFX_texture_compression_FXT1 = true;
#if FEATURE_OES_EGL_image
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index f713078..0f77eeb 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -119,7 +119,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
/* Enable any supported extensions. */
ctx->Extensions.ARB_multitexture = true;
ctx->Extensions.ARB_texture_mirrored_repeat = true;
- ctx->Extensions.ARB_vertex_program = true;
ctx->Extensions.EXT_blend_color = true;
ctx->Extensions.EXT_blend_logic_op = true;
ctx->Extensions.EXT_blend_minmax = true;
@@ -127,7 +126,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
ctx->Extensions.EXT_fog_coord = true;
ctx->Extensions.EXT_framebuffer_blit = true;
ctx->Extensions.EXT_framebuffer_object = true;
- ctx->Extensions.EXT_gpu_program_parameters = true;
ctx->Extensions.EXT_packed_depth_stencil = true;
ctx->Extensions.EXT_secondary_color = true;
ctx->Extensions.EXT_stencil_wrap = true;
@@ -137,7 +135,6 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
ctx->Extensions.EXT_texture_lod_bias = true;
ctx->Extensions.NV_blend_square = true;
ctx->Extensions.NV_texture_env_combine4 = true;
- ctx->Extensions.NV_vertex_program = true;
ctx->Extensions.NV_vertex_program1_1 = true;
return GL_TRUE;
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 9ebf099..2b43455 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -420,14 +420,6 @@ GLboolean r200CreateContext( gl_api api,
ctx->Extensions.EXT_blend_func_separate = true;
}
- if (rmesa->radeon.radeonScreen->drmSupportsVertexProgram) {
- ctx->Extensions.ARB_vertex_program = true;
- ctx->Extensions.EXT_gpu_program_parameters = true;
- }
-
- ctx->Extensions.NV_vertex_program =
- driQueryOptionb(&rmesa->radeon.optionCache, "nv_vertex_program");
-
ctx->Extensions.ATI_fragment_shader = (ctx->Const.MaxTextureUnits == 6)
&& rmesa->radeon.radeonScreen->drmSupportsFragShader;
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index cbf9204..ba3511b 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -374,7 +374,6 @@ static void r300InitGLExtensions(struct gl_context *ctx)
ctx->Extensions.ARB_texture_env_crossbar = true;
ctx->Extensions.ARB_texture_env_dot3 = true;
ctx->Extensions.ARB_texture_mirrored_repeat = true;
- ctx->Extensions.ARB_vertex_program = true;
ctx->Extensions.EXT_blend_color = true;
ctx->Extensions.EXT_blend_equation_separate = true;
ctx->Extensions.EXT_blend_func_separate = true;
@@ -382,7 +381,6 @@ static void r300InitGLExtensions(struct gl_context *ctx)
ctx->Extensions.EXT_blend_minmax = true;
ctx->Extensions.EXT_blend_subtract = true;
ctx->Extensions.EXT_fog_coord = true;
- ctx->Extensions.EXT_gpu_program_parameters = true;
ctx->Extensions.EXT_point_parameters = true;
ctx->Extensions.EXT_provoking_vertex = true;
ctx->Extensions.EXT_secondary_color = true;
@@ -404,7 +402,6 @@ static void r300InitGLExtensions(struct gl_context *ctx)
ctx->Extensions.MESA_ycbcr_texture = true;
ctx->Extensions.NV_blend_square = true;
ctx->Extensions.NV_texture_rectangle = true;
- ctx->Extensions.NV_vertex_program = true;
#if FEATURE_OES_EGL_image
ctx->Extensions.OES_EGL_image = true;
#endif
diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c
index 6807aeb..9c4e876 100644
--- a/src/mesa/drivers/dri/r600/r600_context.c
+++ b/src/mesa/drivers/dri/r600/r600_context.c
@@ -271,7 +271,6 @@ static void r600InitGLExtensions(struct gl_context *ctx)
ctx->Extensions.ARB_texture_env_dot3 = true;
ctx->Extensions.ARB_texture_mirrored_repeat = true;
ctx->Extensions.ARB_texture_non_power_of_two = true;
- ctx->Extensions.ARB_vertex_program = true;
ctx->Extensions.EXT_blend_color = true;
ctx->Extensions.EXT_blend_equation_separate = true;
ctx->Extensions.EXT_blend_func_separate = true;
@@ -280,7 +279,6 @@ static void r600InitGLExtensions(struct gl_context *ctx)
ctx->Extensions.EXT_blend_subtract = true;
ctx->Extensions.EXT_packed_depth_stencil = true;
ctx->Extensions.EXT_fog_coord = true;
- ctx->Extensions.EXT_gpu_program_parameters = true;
ctx->Extensions.EXT_pixel_buffer_object = true;
ctx->Extensions.EXT_point_parameters = true;
ctx->Extensions.EXT_provoking_vertex = true;
@@ -303,7 +301,6 @@ static void r600InitGLExtensions(struct gl_context *ctx)
ctx->Extensions.MESA_ycbcr_texture = true;
ctx->Extensions.NV_blend_square = true;
ctx->Extensions.NV_texture_rectangle = true;
- ctx->Extensions.NV_vertex_program = true;
#if FEATURE_OES_EGL_image
ctx->Extensions.OES_EGL_image = true;
#endif
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index d64b220..690632a 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -322,11 +322,9 @@ r100CreateContext( gl_api api,
ctx->Extensions.ARB_texture_env_crossbar = true;
ctx->Extensions.ARB_texture_env_dot3 = true;
ctx->Extensions.ARB_texture_mirrored_repeat = true;
- ctx->Extensions.ARB_vertex_program = true;
ctx->Extensions.EXT_blend_logic_op = true;
ctx->Extensions.EXT_blend_subtract = true;
ctx->Extensions.EXT_fog_coord = true;
- ctx->Extensions.EXT_gpu_program_parameters = true;
ctx->Extensions.EXT_packed_depth_stencil = true;
ctx->Extensions.EXT_secondary_color = true;
ctx->Extensions.EXT_stencil_wrap = true;
@@ -340,7 +338,6 @@ r100CreateContext( gl_api api,
ctx->Extensions.ATI_texture_mirror_once = true;
ctx->Extensions.MESA_ycbcr_texture = true;
ctx->Extensions.NV_blend_square = true;
- ctx->Extensions.NV_vertex_program = true;
ctx->Extensions.NV_vertex_program1_1 = true;
#if FEATURE_OES_EGL_image
ctx->Extensions.OES_EGL_image = true;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 583a644..51477f1 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -1310,6 +1310,17 @@ radeonCreateScreen( __DRIscreen *sPriv )
fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_IRQ_NR): %d\n", ret);
return NULL;
}
+
+ if (screen->chip_family >= CHIP_FAMILY_R200) {
+ FREE( screen );
+ fprintf(stderr, "DRM version >= %d.25 required for R200 and later "
+ "hardware. Actual version is %d.%d.\n",
+ sPriv->drm_version.major,
+ sPriv->drm_version.major,
+ sPriv->drm_version.minor);
+ return NULL;
+ }
+
screen->drmSupportsCubeMapsR200 = (sPriv->drm_version.minor >= 7);
screen->drmSupportsBlendColor = (sPriv->drm_version.minor >= 11);
screen->drmSupportsTriPerf = (sPriv->drm_version.minor >= 16);
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 01bcc62..0439924 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -448,7 +448,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_texture_compression_rgtc = GL_TRUE;
ctx->Extensions.ARB_vertex_array_object = GL_TRUE;
#if FEATURE_ARB_vertex_program
- ctx->Extensions.ARB_vertex_program = GL_TRUE;
+ /*ctx->Extensions.ARB_vertex_program = GL_TRUE;*/
#endif
#if FEATURE_ARB_vertex_shader
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
@@ -533,7 +533,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.NV_texture_rectangle = GL_TRUE;
/*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/
#if FEATURE_NV_vertex_program
- ctx->Extensions.NV_vertex_program = GL_TRUE;
+ /*ctx->Extensions.NV_vertex_program = GL_TRUE;*/
ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
#endif
#if FEATURE_NV_fragment_program
@@ -545,7 +545,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
/*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/
ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE;
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
- ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
+ /*ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;*/
#endif
#if FEATURE_texture_fxt1
_mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 8e90093..25e49b7 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -249,7 +249,6 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
ctx->Extensions.ARB_vertex_array_object = GL_TRUE;
ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;
- ctx->Extensions.ARB_vertex_program = GL_TRUE;
ctx->Extensions.ARB_window_pos = GL_TRUE;
ctx->Extensions.EXT_blend_color = GL_TRUE;
@@ -261,7 +260,6 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.EXT_framebuffer_object = GL_TRUE;
ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE;
ctx->Extensions.EXT_fog_coord = GL_TRUE;
- ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;
ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
ctx->Extensions.EXT_point_parameters = GL_TRUE;
@@ -288,7 +286,6 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.NV_texture_rectangle = GL_TRUE;
#if 0
/* possibly could support the following two */
- ctx->Extensions.NV_vertex_program = GL_TRUE;
ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
#endif
--
1.7.4.4
More information about the mesa-dev
mailing list