[Mesa-dev] [PATCH 7/8] mesa: Remove EXT_bgra and EXT_texture_format_BGRA8888 extension enable flags

Ian Romanick idr at freedesktop.org
Mon Sep 19 12:18:21 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

EXT_texture_format_BGRA8888 is mostly a subset of EXT_bgra.  The only
difference seems to be that EXT_texture_format_BGRA8888 allows GL_BGRA
as an internal format to glTexImage2D and friends.
---
 src/mesa/drivers/dri/intel/intel_extensions_es.c |    1 -
 src/mesa/main/extensions.c                       |    5 ++---
 src/mesa/main/mtypes.h                           |    2 --
 src/mesa/main/texformat.c                        |    4 +++-
 src/mesa/main/teximage.c                         |    6 ++++--
 src/mesa/state_tracker/st_extensions.c           |    2 --
 6 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_extensions_es.c b/src/mesa/drivers/dri/intel/intel_extensions_es.c
index 6fcd047..bbc3220 100644
--- a/src/mesa/drivers/dri/intel/intel_extensions_es.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions_es.c
@@ -48,7 +48,6 @@ static const char *common_extensions[] = {
 #endif
    "GL_EXT_texture_filter_anisotropic",
    "GL_EXT_packed_depth_stencil",
-   "GL_EXT_texture_format_BGRA8888",
    "GL_EXT_blend_minmax",
 
    NULL
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 069fce6..4d43fde 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -147,7 +147,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_window_pos",                          o(ARB_window_pos),                          GL,             2001 },
    /* EXT extensions */
    { "GL_EXT_abgr",                                o(EXT_abgr),                                GL,             1995 },
-   { "GL_EXT_bgra",                                o(EXT_bgra),                                GL,             1995 },
+   { "GL_EXT_bgra",                                o(dummy_true),                              GL,             1995 },
    { "GL_EXT_blend_color",                         o(EXT_blend_color),                         GL,             1995 },
    { "GL_EXT_blend_equation_separate",             o(EXT_blend_equation_separate),             GL,             2003 },
    { "GL_EXT_blend_func_separate",                 o(EXT_blend_func_separate),                 GL,             1999 },
@@ -195,7 +195,7 @@ static const struct extension extension_table[] = {
    { "GL_EXT_texture_env_combine",                 o(EXT_texture_env_combine),                 GL,             2000 },
    { "GL_EXT_texture_env_dot3",                    o(EXT_texture_env_dot3),                    GL,             2000 },
    { "GL_EXT_texture_filter_anisotropic",          o(EXT_texture_filter_anisotropic),          GL | ES1 | ES2, 1999 },
-   { "GL_EXT_texture_format_BGRA8888",             o(EXT_texture_format_BGRA8888),                  ES1 | ES2, 2009 },
+   { "GL_EXT_texture_format_BGRA8888",             o(dummy_true),                                   ES1 | ES2, 2005 },
    { "GL_EXT_texture_integer",                     o(EXT_texture_integer),                     GL,             2006 },
    { "GL_EXT_texture_lod_bias",                    o(EXT_texture_lod_bias),                    GL | ES1,       1999 },
    { "GL_EXT_texture_mirror_clamp",                o(EXT_texture_mirror_clamp),                GL,             2004 },
@@ -347,7 +347,6 @@ static const size_t default_extensions[] = {
    o(ARB_window_pos),
 
    o(EXT_abgr),
-   o(EXT_bgra),
    o(EXT_compiled_vertex_array),
    o(EXT_draw_range_elements),
    o(EXT_packed_pixels),
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 7b81616..22de4c4 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2818,7 +2818,6 @@ struct gl_extensions
    GLboolean ARB_vertex_type_2_10_10_10_rev;
    GLboolean ARB_window_pos;
    GLboolean EXT_abgr;
-   GLboolean EXT_bgra;
    GLboolean EXT_blend_color;
    GLboolean EXT_blend_equation_separate;
    GLboolean EXT_blend_func_separate;
@@ -2906,7 +2905,6 @@ struct gl_extensions
    GLboolean S3_s3tc;
    GLboolean OES_EGL_image;
    GLboolean OES_draw_texture;
-   GLboolean EXT_texture_format_BGRA8888;
    GLboolean extension_sentinel;
    /** The extension string */
    const GLubyte *String;
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 4f02720..b763a68 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -703,7 +703,9 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
       }
    }
 
-   if (ctx->Extensions.EXT_texture_format_BGRA8888) {
+   /* GL_BGRA can be an internal format *only* in OpenGL ES (1.x or 2.0).
+    */
+   if (ctx->API != API_OPENGL) {
       switch (internalFormat) {
       case GL_BGRA:
 	 RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index fa00183..f0e98b1 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -149,9 +149,11 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
          ; /* fallthrough */
    }
 
-   if (ctx->Extensions.EXT_texture_format_BGRA8888) {
+   /* GL_BGRA can be an internal format *only* in OpenGL ES (1.x or 2.0).
+    */
+   if (ctx->API != API_OPENGL) {
       switch (internalFormat) {
-         case GL_BGRA_EXT:
+         case GL_BGRA:
             return GL_RGBA;
          default:
             ; /* fallthrough */
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 7f9a948..ef284ad 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -281,8 +281,6 @@ void st_init_extensions(struct st_context *st)
    ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
    ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
    ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
-   if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2)
-	   ctx->Extensions.EXT_texture_format_BGRA8888 = GL_TRUE;
 
    ctx->Extensions.APPLE_vertex_array_object = GL_TRUE;
 
-- 
1.7.6



More information about the mesa-dev mailing list