From 763b00f2c596e167299e81684763b52422956dfc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 2 Oct 2011 15:22:18 -0700 Subject: [PATCH] mesa: Remove ARB_draw_buffers extension enable flag All drivers in Mesa have supported this extension for eons. This extension is an optional features in desktop OpenGL (via GL_ARB_draw_buffers) and OpenGL ES 2.x (via GL_NV_draw_buffers). The extension is not usable in OpenGL ES 1.x. There is no glDrawBuffers* entry point in OpenGL ES 1.x contexts, and glGet*v generate errors when MAX_DRAW_BUFFERS or DRAW_BUFFERi is queried. Signed-off-by: Ian Romanick Reviewed-by: Brian Paul --- src/glsl/standalone_scaffolding.cpp | 1 - src/mesa/drivers/dri/intel/intel_extensions_es.c | 1 - src/mesa/drivers/dri/swrast/swrast.c | 1 - src/mesa/main/extensions.c | 9 +++------ src/mesa/main/mtypes.h | 1 - src/mesa/main/version.c | 1 - src/mesa/state_tracker/st_extensions.c | 4 ---- 7 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp index 72aa1e428b4..5cc6c98799b 100644 --- a/src/glsl/standalone_scaffolding.cpp +++ b/src/glsl/standalone_scaffolding.cpp @@ -67,7 +67,6 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Extensions.dummy_false = false; ctx->Extensions.dummy_true = true; ctx->Extensions.ARB_ES2_compatibility = true; - ctx->Extensions.ARB_draw_buffers = true; ctx->Extensions.ARB_draw_instanced = true; ctx->Extensions.ARB_fragment_coord_conventions = true; ctx->Extensions.EXT_texture_array = true; diff --git a/src/mesa/drivers/dri/intel/intel_extensions_es.c b/src/mesa/drivers/dri/intel/intel_extensions_es.c index e60cfc3e4a1..c3f5ee379e3 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions_es.c +++ b/src/mesa/drivers/dri/intel/intel_extensions_es.c @@ -32,7 +32,6 @@ static const char *common_extensions[] = { /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */ - "GL_ARB_draw_buffers", "GL_ARB_transpose_matrix", "GL_ARB_window_pos", "GL_EXT_blend_func_separate", diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 8665ad099e2..d2c74b91dd1 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -577,7 +577,6 @@ swrast_init_driver_functions(struct dd_function_table *driver) static const char *es2_extensions[] = { /* Used by mesa internally (cf all_mesa_extensions in ../common/utils.c) */ - "GL_ARB_draw_buffers", "GL_ARB_transpose_matrix", "GL_ARB_window_pos", "GL_EXT_blend_func_separate", diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index fc543f99ad1..52b928e4198 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -85,7 +85,7 @@ static const struct extension extension_table[] = { { "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL, 2008 }, { "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 }, { "GL_ARB_depth_texture", o(ARB_depth_texture), GL, 2001 }, - { "GL_ARB_draw_buffers", o(ARB_draw_buffers), GL, 2002 }, + { "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 }, { "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 }, { "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 }, { "GL_ARB_draw_instanced", o(ARB_draw_instanced), GL, 2008 }, @@ -263,7 +263,7 @@ static const struct extension extension_table[] = { { "GL_APPLE_packed_pixels", o(APPLE_packed_pixels), GL, 2002 }, { "GL_APPLE_vertex_array_object", o(APPLE_vertex_array_object), GL, 2002 }, { "GL_ATI_blend_equation_separate", o(EXT_blend_equation_separate), GL, 2003 }, - { "GL_ATI_draw_buffers", o(ARB_draw_buffers), GL, 2002 }, + { "GL_ATI_draw_buffers", o(dummy_true), GL, 2002 }, { "GL_ATI_envmap_bumpmap", o(ATI_envmap_bumpmap), GL, 2001 }, { "GL_ATI_fragment_shader", o(ATI_fragment_shader), GL, 2001 }, { "GL_ATI_separate_stencil", o(ATI_separate_stencil), GL, 2006 }, @@ -284,7 +284,7 @@ static const struct extension extension_table[] = { { "GL_NV_blend_square", o(NV_blend_square), GL, 1999 }, { "GL_NV_conditional_render", o(NV_conditional_render), GL, 2008 }, { "GL_NV_depth_clamp", o(ARB_depth_clamp), GL, 2001 }, - { "GL_NV_draw_buffers", o(ARB_draw_buffers), ES2, 2011 }, + { "GL_NV_draw_buffers", o(dummy_true), ES2, 2011 }, { "GL_NV_fbo_color_attachments", o(EXT_framebuffer_object), ES2, 2010 }, { "GL_NV_fragment_program", o(NV_fragment_program), GL, 2001 }, { "GL_NV_fragment_program_option", o(NV_fragment_program_option), GL, 2005 }, @@ -343,7 +343,6 @@ name_to_offset(const char* name) */ static const size_t default_extensions[] = { o(ARB_copy_buffer), - o(ARB_draw_buffers), o(ARB_transpose_matrix), o(ARB_window_pos), @@ -378,7 +377,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) /*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/ ctx->Extensions.ARB_depth_clamp = GL_TRUE; ctx->Extensions.ARB_depth_texture = GL_TRUE; - /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; ctx->Extensions.ARB_draw_instanced = GL_TRUE; ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE; @@ -577,7 +575,6 @@ _mesa_enable_1_5_extensions(struct gl_context *ctx) void _mesa_enable_2_0_extensions(struct gl_context *ctx) { - /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ #if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; #endif diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 8c39717c6e3..b29cdedab45 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2749,7 +2749,6 @@ struct gl_extensions GLboolean ARB_depth_buffer_float; GLboolean ARB_depth_clamp; GLboolean ARB_depth_texture; - GLboolean ARB_draw_buffers; GLboolean ARB_draw_buffers_blend; GLboolean ARB_draw_elements_base_vertex; GLboolean ARB_draw_instanced; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index a996c145b88..17c06005937 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -104,7 +104,6 @@ compute_version(struct gl_context *ctx) ctx->Extensions.ARB_occlusion_query && ctx->Extensions.EXT_shadow_funcs); const GLboolean ver_2_0 = (ver_1_5 && - ctx->Extensions.ARB_draw_buffers && ctx->Extensions.ARB_point_sprite && ctx->Extensions.ARB_shader_objects && ctx->Extensions.ARB_vertex_shader && diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 8865440d9c6..6707fcae122 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -307,10 +307,6 @@ void st_init_extensions(struct st_context *st) /* * Extensions that depend on the driver/hardware: */ - if (screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS) > 0) { - ctx->Extensions.ARB_draw_buffers = GL_TRUE; - } - if (screen->get_param(screen, PIPE_CAP_TEXTURE_SWIZZLE) > 0) { ctx->Extensions.EXT_texture_swizzle = GL_TRUE; } -- 2.30.2