diff options
Diffstat (limited to 'src/mesa/main/extensions.c')
-rw-r--r-- | src/mesa/main/extensions.c | 92 |
1 files changed, 38 insertions, 54 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 50b97f51132..bc8cbef1320 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -45,24 +45,23 @@ static const struct { int flag_offset; } default_extensions[] = { { OFF, "GL_ARB_blend_func_extended", F(ARB_blend_func_extended) }, - { OFF, "GL_ARB_copy_buffer", F(ARB_copy_buffer) }, + { ON, "GL_ARB_copy_buffer", F(ARB_copy_buffer) }, { OFF, "GL_ARB_depth_buffer_float", F(ARB_depth_buffer_float) }, { OFF, "GL_ARB_depth_clamp", F(ARB_depth_clamp) }, { OFF, "GL_ARB_depth_texture", F(ARB_depth_texture) }, { ON, "GL_ARB_draw_buffers", F(ARB_draw_buffers) }, { OFF, "GL_ARB_draw_elements_base_vertex", F(ARB_draw_elements_base_vertex) }, { OFF, "GL_ARB_draw_instanced", F(ARB_draw_instanced) }, + { OFF, "GL_ARB_explicit_attrib_location", F(ARB_explicit_attrib_location) }, { OFF, "GL_ARB_fragment_coord_conventions", F(ARB_fragment_coord_conventions) }, { OFF, "GL_ARB_fragment_program", F(ARB_fragment_program) }, { OFF, "GL_ARB_fragment_program_shadow", F(ARB_fragment_program_shadow) }, { OFF, "GL_ARB_fragment_shader", F(ARB_fragment_shader) }, { OFF, "GL_ARB_framebuffer_object", F(ARB_framebuffer_object) }, - { OFF, "GL_ARB_explicit_attrib_location", F(ARB_explicit_attrib_location) }, /* TODO: reenable this when the new GLSL compiler actually supports them */ /* { OFF, "GL_ARB_geometry_shader4", F(ARB_geometry_shader4) }, */ { OFF, "GL_ARB_half_float_pixel", F(ARB_half_float_pixel) }, { OFF, "GL_ARB_half_float_vertex", F(ARB_half_float_vertex) }, - { OFF, "GL_ARB_imaging", F(ARB_imaging) }, { OFF, "GL_ARB_instanced_arrays", F(ARB_instanced_arrays) }, { OFF, "GL_ARB_map_buffer_range", F(ARB_map_buffer_range) }, { ON, "GL_ARB_multisample", F(ARB_multisample) }, @@ -76,14 +75,15 @@ static const struct { { OFF, "GL_ARB_sampler_objects", F(ARB_sampler_objects) }, { OFF, "GL_ARB_seamless_cube_map", F(ARB_seamless_cube_map) }, { OFF, "GL_ARB_shader_objects", F(ARB_shader_objects) }, + { OFF, "GL_ARB_shader_stencil_export", F(ARB_shader_stencil_export) }, { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, - { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) }, { OFF, "GL_ARB_shadow", F(ARB_shadow) }, { OFF, "GL_ARB_shadow_ambient", F(ARB_shadow_ambient) }, { OFF, "GL_ARB_sync", F(ARB_sync) }, { OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) }, { OFF, "GL_ARB_texture_buffer_object", F(ARB_texture_buffer_object) }, { ON, "GL_ARB_texture_compression", F(ARB_texture_compression) }, + { OFF, "GL_ARB_texture_compression_rgtc", F(ARB_texture_compression_rgtc) }, { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, { OFF, "GL_ARB_texture_env_add", F(EXT_texture_env_add) }, { OFF, "GL_ARB_texture_env_combine", F(ARB_texture_env_combine) }, @@ -116,9 +116,7 @@ static const struct { { OFF, "GL_EXT_blend_minmax", F(EXT_blend_minmax) }, { OFF, "GL_EXT_blend_subtract", F(EXT_blend_subtract) }, { OFF, "GL_EXT_clip_volume_hint", F(EXT_clip_volume_hint) }, - { OFF, "GL_EXT_cull_vertex", F(EXT_cull_vertex) }, { ON, "GL_EXT_compiled_vertex_array", F(EXT_compiled_vertex_array) }, - { OFF, "GL_EXT_convolution", F(EXT_convolution) }, { ON, "GL_EXT_copy_texture", F(EXT_copy_texture) }, { OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) }, { OFF, "GL_EXT_draw_buffers2", F(EXT_draw_buffers2) }, @@ -130,7 +128,6 @@ static const struct { { OFF, "GL_EXT_framebuffer_sRGB", F(EXT_framebuffer_sRGB) }, { OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) }, { OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) }, - { OFF, "GL_EXT_histogram", F(EXT_histogram) }, { ON, "GL_EXT_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_EXT_packed_depth_stencil", F(EXT_packed_depth_stencil) }, { OFF, "GL_EXT_packed_float", F(EXT_packed_float) }, @@ -152,7 +149,7 @@ static const struct { { ON, "GL_EXT_texture3D", F(EXT_texture3D) }, { OFF, "GL_EXT_texture_array", F(EXT_texture_array) }, { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) }, - { OFF, "GL_EXT_texture_compression_rgtc", F(EXT_texture_compression_rgtc) }, + { OFF, "GL_EXT_texture_compression_rgtc", F(ARB_texture_compression_rgtc) }, { OFF, "GL_EXT_texture_cube_map", F(ARB_texture_cube_map) }, { ON, "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { OFF, "GL_EXT_texture_env_add", F(EXT_texture_env_add) }, @@ -188,7 +185,6 @@ static const struct { { OFF, "GL_IBM_texture_mirrored_repeat", F(ARB_texture_mirrored_repeat)}, { OFF, "GL_INGR_blend_func_separate", F(EXT_blend_func_separate) }, { OFF, "GL_MESA_pack_invert", F(MESA_pack_invert) }, - { OFF, "GL_MESA_packed_depth_stencil", F(MESA_packed_depth_stencil) }, { OFF, "GL_MESA_resize_buffers", F(MESA_resize_buffers) }, { OFF, "GL_MESA_texture_array", F(MESA_texture_array) }, { OFF, "GL_MESA_texture_signed_rgba", F(MESA_texture_signed_rgba) }, @@ -209,15 +205,14 @@ static const struct { { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) }, { ON, "GL_OES_read_format", F(OES_read_format) }, - { OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) }, - { OFF, "GL_SGI_color_table", F(SGI_color_table) }, { OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) }, - { OFF, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, + { ON, "GL_SGIS_generate_mipmap", F(SGIS_generate_mipmap) }, { OFF, "GL_SGIS_texture_border_clamp", F(ARB_texture_border_clamp) }, { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, { ON, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_S3_s3tc", F(S3_s3tc) }, + { OFF, "GL_EXT_texture_format_BGRA8888", F(EXT_texture_format_BGRA8888) }, #if FEATURE_OES_EGL_image { OFF, "GL_OES_EGL_image", F(OES_EGL_image) }, #endif @@ -233,13 +228,14 @@ static const struct { * This is a convenience function used by the XMesa, OSMesa, GGI drivers, etc. */ void -_mesa_enable_sw_extensions(GLcontext *ctx) +_mesa_enable_sw_extensions(struct gl_context *ctx) { - ctx->Extensions.ARB_copy_buffer = GL_TRUE; + /*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_explicit_attrib_location = GL_TRUE; ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; #if FEATURE_ARB_fragment_program ctx->Extensions.ARB_fragment_program = GL_TRUE; @@ -256,7 +252,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_half_float_vertex = GL_TRUE; - ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; #if FEATURE_queryobj @@ -269,9 +264,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; #endif -#if FEATURE_ARB_shading_language_120 - ctx->Extensions.ARB_shading_language_120 = GL_TRUE; -#endif ctx->Extensions.ARB_shadow = GL_TRUE; ctx->Extensions.ARB_shadow_ambient = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; @@ -282,6 +274,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) /*ctx->Extensions.ARB_texture_float = GL_TRUE;*/ ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE; ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; + ctx->Extensions.ARB_texture_rg = GL_TRUE; ctx->Extensions.ARB_vertex_array_object = GL_TRUE; #if FEATURE_ARB_vertex_program ctx->Extensions.ARB_vertex_program = GL_TRUE; @@ -312,7 +305,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_blend_logic_op = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_convolution = GL_TRUE; ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; @@ -325,7 +317,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_ARB_framebuffer_object ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; #endif - ctx->Extensions.EXT_histogram = GL_TRUE; /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; ctx->Extensions.EXT_paletted_texture = GL_TRUE; @@ -375,10 +366,8 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program ctx->Extensions.NV_fragment_program_option = GL_TRUE; #endif - ctx->Extensions.SGI_color_matrix = GL_TRUE; - ctx->Extensions.SGI_color_table = GL_TRUE; ctx->Extensions.SGI_texture_color_table = GL_TRUE; - ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; + /*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; @@ -396,20 +385,15 @@ _mesa_enable_sw_extensions(GLcontext *ctx) /** - * Enable GL_ARB_imaging and all the EXT extensions that are subsets of it. + * Enable common EXT extensions in the ARB_imaging subset. */ void -_mesa_enable_imaging_extensions(GLcontext *ctx) +_mesa_enable_imaging_extensions(struct gl_context *ctx) { - ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.EXT_blend_color = GL_TRUE; ctx->Extensions.EXT_blend_logic_op = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_convolution = GL_TRUE; - ctx->Extensions.EXT_histogram = GL_TRUE; - ctx->Extensions.SGI_color_matrix = GL_TRUE; - ctx->Extensions.SGI_color_table = GL_TRUE; } @@ -419,7 +403,7 @@ _mesa_enable_imaging_extensions(GLcontext *ctx) * A convenience function to be called by drivers. */ void -_mesa_enable_1_3_extensions(GLcontext *ctx) +_mesa_enable_1_3_extensions(struct gl_context *ctx) { /*ctx->Extensions.ARB_multisample = GL_TRUE;*/ ctx->Extensions.ARB_multitexture = GL_TRUE; @@ -439,7 +423,7 @@ _mesa_enable_1_3_extensions(GLcontext *ctx) * A convenience function to be called by drivers. */ void -_mesa_enable_1_4_extensions(GLcontext *ctx) +_mesa_enable_1_4_extensions(struct gl_context *ctx) { ctx->Extensions.ARB_depth_texture = GL_TRUE; ctx->Extensions.ARB_shadow = GL_TRUE; @@ -456,7 +440,7 @@ _mesa_enable_1_4_extensions(GLcontext *ctx) ctx->Extensions.EXT_secondary_color = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; ctx->Extensions.EXT_texture_lod_bias = GL_TRUE; - ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; + /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/ } @@ -465,7 +449,7 @@ _mesa_enable_1_4_extensions(GLcontext *ctx) * A convenience function to be called by drivers. */ void -_mesa_enable_1_5_extensions(GLcontext *ctx) +_mesa_enable_1_5_extensions(struct gl_context *ctx) { ctx->Extensions.ARB_occlusion_query = GL_TRUE; /*ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;*/ @@ -478,7 +462,7 @@ _mesa_enable_1_5_extensions(GLcontext *ctx) * A convenience function to be called by drivers. */ void -_mesa_enable_2_0_extensions(GLcontext *ctx) +_mesa_enable_2_0_extensions(struct gl_context *ctx) { /*ctx->Extensions.ARB_draw_buffers = GL_TRUE;*/ #if FEATURE_ARB_fragment_shader @@ -505,7 +489,7 @@ _mesa_enable_2_0_extensions(GLcontext *ctx) * A convenience function to be called by drivers. */ void -_mesa_enable_2_1_extensions(GLcontext *ctx) +_mesa_enable_2_1_extensions(struct gl_context *ctx) { #if FEATURE_EXT_pixel_buffer_object ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; @@ -513,9 +497,6 @@ _mesa_enable_2_1_extensions(GLcontext *ctx) #if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; #endif -#if FEATURE_ARB_shading_language_120 - ctx->Extensions.ARB_shading_language_120 = GL_TRUE; -#endif } @@ -524,7 +505,7 @@ _mesa_enable_2_1_extensions(GLcontext *ctx) * \return GL_TRUE for success, GL_FALSE if invalid extension name */ static GLboolean -set_extension( GLcontext *ctx, const char *name, GLboolean state ) +set_extension( struct gl_context *ctx, const char *name, GLboolean state ) { GLboolean *base = (GLboolean *) &ctx->Extensions; GLuint i; @@ -553,7 +534,7 @@ set_extension( GLcontext *ctx, const char *name, GLboolean state ) * Typically called by drivers. */ void -_mesa_enable_extension( GLcontext *ctx, const char *name ) +_mesa_enable_extension( struct gl_context *ctx, const char *name ) { if (!set_extension(ctx, name, GL_TRUE)) _mesa_problem(ctx, "Trying to enable unknown extension: %s", name); @@ -565,7 +546,7 @@ _mesa_enable_extension( GLcontext *ctx, const char *name ) * XXX is this really needed??? */ void -_mesa_disable_extension( GLcontext *ctx, const char *name ) +_mesa_disable_extension( struct gl_context *ctx, const char *name ) { if (!set_extension(ctx, name, GL_FALSE)) _mesa_problem(ctx, "Trying to disable unknown extension: %s", name); @@ -576,7 +557,7 @@ _mesa_disable_extension( GLcontext *ctx, const char *name ) * Check if the i-th extension is enabled. */ static GLboolean -extension_enabled(GLcontext *ctx, GLuint index) +extension_enabled(struct gl_context *ctx, GLuint index) { const GLboolean *base = (const GLboolean *) &ctx->Extensions; if (!default_extensions[index].flag_offset || @@ -593,7 +574,7 @@ extension_enabled(GLcontext *ctx, GLuint index) * Test if the named extension is enabled in this context. */ GLboolean -_mesa_extension_is_enabled( GLcontext *ctx, const char *name ) +_mesa_extension_is_enabled( struct gl_context *ctx, const char *name ) { GLuint i; @@ -635,7 +616,7 @@ append(const char *a, const char *b) * Return a string of the unknown/leftover names. */ static const char * -get_extension_override( GLcontext *ctx ) +get_extension_override( struct gl_context *ctx ) { const char *envExt = _mesa_getenv("MESA_EXTENSION_OVERRIDE"); char *extraExt = NULL; @@ -686,7 +667,7 @@ get_extension_override( GLcontext *ctx ) * To be called during context initialization. */ void -_mesa_init_extensions( GLcontext *ctx ) +_mesa_init_extensions( struct gl_context *ctx ) { GLboolean *base = (GLboolean *) &ctx->Extensions; GLuint i; @@ -705,7 +686,7 @@ _mesa_init_extensions( GLcontext *ctx ) * glGetString(GL_EXTENSIONS) is called. */ static GLubyte * -compute_extensions( GLcontext *ctx ) +compute_extensions( struct gl_context *ctx ) { const char *extraExt = get_extension_override(ctx); GLuint extStrLen = 0; @@ -772,7 +753,7 @@ append_extension(GLubyte **str, const char *ext) static size_t -make_extension_string_es1(const GLcontext *ctx, GLubyte *str) +make_extension_string_es1(const struct gl_context *ctx, GLubyte *str) { size_t len = 0; @@ -854,7 +835,7 @@ make_extension_string_es1(const GLcontext *ctx, GLubyte *str) static GLubyte * -compute_extensions_es1(const GLcontext *ctx) +compute_extensions_es1(const struct gl_context *ctx) { GLubyte *s; unsigned int len; @@ -869,7 +850,7 @@ compute_extensions_es1(const GLcontext *ctx) } static size_t -make_extension_string_es2(const GLcontext *ctx, GLubyte *str) +make_extension_string_es2(const struct gl_context *ctx, GLubyte *str) { size_t len = 0; @@ -916,11 +897,14 @@ make_extension_string_es2(const GLcontext *ctx, GLubyte *str) len += append_extension(&str, "GL_OES_EGL_image"); #endif + if (ctx->Extensions.EXT_texture_format_BGRA8888) + len += append_extension(&str, "GL_EXT_texture_format_BGRA8888"); + return len; } static GLubyte * -compute_extensions_es2(GLcontext *ctx) +compute_extensions_es2(struct gl_context *ctx) { GLubyte *s; unsigned int len; @@ -936,7 +920,7 @@ compute_extensions_es2(GLcontext *ctx) GLubyte * -_mesa_make_extension_string(GLcontext *ctx) +_mesa_make_extension_string(struct gl_context *ctx) { switch (ctx->API) { case API_OPENGL: @@ -955,7 +939,7 @@ _mesa_make_extension_string(GLcontext *ctx) * Return number of enabled extensions. */ GLuint -_mesa_get_extension_count(GLcontext *ctx) +_mesa_get_extension_count(struct gl_context *ctx) { GLuint i; @@ -980,7 +964,7 @@ _mesa_get_extension_count(GLcontext *ctx) * Return name of i-th enabled extension */ const GLubyte * -_mesa_get_enabled_extension(GLcontext *ctx, GLuint index) +_mesa_get_enabled_extension(struct gl_context *ctx, GLuint index) { GLuint i; |