From daad31d52732b5a954360a0baacdeff89d3c153a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:09:44 -0800 Subject: EXT_pds: Alias GL_NV_packed_depth_stencil to GL_EXT_packed_depth_stencil GL_EXT_packed_depth_stencil is a functional superset of GL_NV_packed_depth_stencil. If a driver enables EXT_pds, make NV_pds available as well. --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 54cf37c5f4..96f3511273 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -169,6 +169,7 @@ static const struct { { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, + { OFF, "GL_NV_packed_depth_stencil", F(EXT_packed_depth_stencil) }, { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) }, { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) }, -- cgit v1.2.3 From 4d6ec214396461c0cf3ad8ede449b299ff06c1aa Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:33:23 -0800 Subject: ARB_fbo: Enable GL_EXT_framebuffer_multisample All of this functionality is already included in ARB_fbo. This just enables the string. I was a bit lazy in using FEATURE_ARB_framebuffer_object for this feature as well. I don't think it makes much difference in the long run. --- src/mesa/main/extensions.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 96f3511273..2138bfe40e 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -104,8 +104,9 @@ static const struct { { ON, "GL_EXT_copy_texture", F(EXT_copy_texture) }, { OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) }, { ON, "GL_EXT_draw_range_elements", F(EXT_draw_range_elements) }, - { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, { OFF, "GL_EXT_framebuffer_blit", F(EXT_framebuffer_blit) }, + { OFF, "GL_EXT_framebuffer_multisample", F(EXT_framebuffer_multisample) }, + { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, { 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) }, @@ -274,6 +275,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif #if FEATURE_EXT_framebuffer_blit ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; +#endif +#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;*/ -- cgit v1.2.3 From 8f6f1124634cf659dde4c75549b84e35505d892d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Dec 2009 16:30:54 -0700 Subject: mesa: added infrastructure for GL_EXT_draw_buffers2 --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 2138bfe40e..9e96eb0403 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -103,6 +103,7 @@ static const struct { { 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) }, { ON, "GL_EXT_draw_range_elements", F(EXT_draw_range_elements) }, { OFF, "GL_EXT_framebuffer_blit", F(EXT_framebuffer_blit) }, { OFF, "GL_EXT_framebuffer_multisample", F(EXT_framebuffer_multisample) }, -- cgit v1.2.3 From 1ec6de9f948b45e24ecd0e039819e90863ec9646 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 10:13:31 -0700 Subject: mesa: simplify some extension testing code --- src/mesa/main/extensions.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 9e96eb0403..a1561b4065 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -523,20 +523,34 @@ _mesa_disable_extension( GLcontext *ctx, const char *name ) } +/** + * Check if the i-th extension is enabled. + */ +static GLboolean +extension_enabled(GLcontext *ctx, GLuint index) +{ + const GLboolean *base = (const GLboolean *) &ctx->Extensions; + if (!default_extensions[index].flag_offset || + *(base + default_extensions[index].flag_offset)) { + return GL_TRUE; + } + else { + return GL_FALSE; + } +} + + /** * Test if the named extension is enabled in this context. */ GLboolean _mesa_extension_is_enabled( GLcontext *ctx, const char *name ) { - const GLboolean *base = (const GLboolean *) &ctx->Extensions; GLuint i; for (i = 0 ; i < Elements(default_extensions) ; i++) { if (_mesa_strcmp(default_extensions[i].name, name) == 0) { - if (!default_extensions[i].flag_offset) - return GL_TRUE; - return *(base + default_extensions[i].flag_offset); + return extension_enabled(ctx, i); } } return GL_FALSE; @@ -644,7 +658,6 @@ _mesa_init_extensions( GLcontext *ctx ) GLubyte * _mesa_make_extension_string( GLcontext *ctx ) { - const GLboolean *base = (const GLboolean *) &ctx->Extensions; const char *extraExt = get_extension_override(ctx); GLuint extStrLen = 0; char *s; @@ -652,8 +665,7 @@ _mesa_make_extension_string( GLcontext *ctx ) /* first, compute length of the extension string */ for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (!default_extensions[i].flag_offset || - *(base + default_extensions[i].flag_offset)) { + if (extension_enabled(ctx, i)) { extStrLen += (GLuint)_mesa_strlen(default_extensions[i].name) + 1; } } @@ -669,8 +681,7 @@ _mesa_make_extension_string( GLcontext *ctx ) /* second, build the extension string */ extStrLen = 0; for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (!default_extensions[i].flag_offset || - *(base + default_extensions[i].flag_offset)) { + if (extension_enabled(ctx, i)) { GLuint len = (GLuint)_mesa_strlen(default_extensions[i].name); _mesa_memcpy(s + extStrLen, default_extensions[i].name, len); extStrLen += len; -- cgit v1.2.3 From 802b80893943cf129039a37fb2afe26444b09332 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 10:16:01 -0700 Subject: mesa: implement GL3 GL_NUM_EXTENSIONS query --- src/mesa/main/extensions.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index a1561b4065..88c025ee32 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -700,3 +700,28 @@ _mesa_make_extension_string( GLcontext *ctx ) return (GLubyte *) s; } + + +/** + * Return number of enabled extensions. + */ +GLuint +_mesa_get_extension_count(GLcontext *ctx) +{ + GLuint i; + + /* only count once */ + if (!ctx->Extensions.Count) { + for (i = 0; i < Elements(default_extensions); i++) { + if (extension_enabled(ctx, i)) { + ctx->Extensions.Count++; + } + } + } + + if (0) + _mesa_debug(ctx, "%u of %d extensions enabled\n", ctx->Extensions.Count, + Elements(default_extensions)); + + return ctx->Extensions.Count; +} -- cgit v1.2.3 From 56bdaca03e2289f56d1c88668d0a0f1dbd5abeca Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 10:29:53 -0700 Subject: mesa: _mesa_get_enabled_extension() function --- src/mesa/main/extensions.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 88c025ee32..7aec95f048 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -725,3 +725,23 @@ _mesa_get_extension_count(GLcontext *ctx) return ctx->Extensions.Count; } + + +/** + * Return name of i-th enabled extension + */ +const GLubyte * +_mesa_get_enabled_extension(GLcontext *ctx, GLuint index) +{ + GLuint i; + + for (i = 0; i < Elements(default_extensions); i++) { + if (extension_enabled(ctx, i)) { + if (index == 0) + return (const GLubyte *) default_extensions[i].name; + index--; + } + } + + return NULL; +} -- cgit v1.2.3 From 2be0d77a97cbe92f09dd97fb85a3d5372e52ad4c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 14:49:49 -0700 Subject: mesa: add flag for GL_NV_conditional_render extension --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 7aec95f048..1ccbe13d65 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -167,6 +167,7 @@ static const struct { { OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) }, { ON, "GL_MESA_window_pos", F(ARB_window_pos) }, { OFF, "GL_NV_blend_square", F(NV_blend_square) }, + { OFF, "GL_NV_conditional_render", F(NV_conditional_render) }, { OFF, "GL_NV_depth_clamp", F(ARB_depth_clamp) }, { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, -- cgit v1.2.3 From aa491c19b9a5de350834b5f416e69e1e0a67a194 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 21:40:54 -0700 Subject: mesa: turn on NV_conditional_render for software drivers --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 1ccbe13d65..2002e4dfaa 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -311,6 +311,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.MESA_texture_array = GL_TRUE; ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; ctx->Extensions.NV_blend_square = GL_TRUE; + ctx->Extensions.NV_conditional_render = GL_TRUE; /*ctx->Extensions.NV_light_max_exponent = GL_TRUE;*/ ctx->Extensions.NV_point_sprite = GL_TRUE; ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; -- cgit v1.2.3 From fcc2e1a729e93bfe64f82d95d007ceab98f3dbc2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 31 Dec 2009 08:46:09 -0700 Subject: mesa: enable GL_EXT_draw_buffers2 for sw drivers --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/main/extensions.c') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 2002e4dfaa..5fc0b1cfde 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -271,6 +271,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) 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; #if FEATURE_EXT_framebuffer_object ctx->Extensions.EXT_framebuffer_object = GL_TRUE; -- cgit v1.2.3