[Mesa-dev] [PATCH v2 12/18] mesa: Fix EXT_texture_compression_s3tc functionality leaks

Nanley Chery nanleychery at gmail.com
Fri Oct 30 14:19:29 PDT 2015


From: Nanley Chery <nanley.g.chery at intel.com>

Stop leaks into GLES 1 contexts in _mesa_get_compressed_formats()
and lookup_view_class().

The extension spec lists GLES 2.0.25 and 3.0.2 dependencies,
so update the extension table accordingly.

v2. Remove references to pre-1.2 desktop GL contexts

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
 src/mesa/main/extensions_table.h | 2 +-
 src/mesa/main/glformats.c        | 2 +-
 src/mesa/main/texcompress.c      | 2 +-
 src/mesa/main/textureview.c      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index c1b0192..6c76ee5 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -184,7 +184,7 @@ EXT(ANGLE_texture_compression_dxt3          , ANGLE_texture_compression_dxt
 EXT(ANGLE_texture_compression_dxt5          , ANGLE_texture_compression_dxt          , GLL, GLC, ES1, ES2, 2011)
 EXT(EXT_texture_compression_latc            , EXT_texture_compression_latc           , GLL,  x ,  x ,  x , 2006)
 EXT(EXT_texture_compression_rgtc            , ARB_texture_compression_rgtc           , GLL, GLC,  x ,  x , 2004)
-EXT(EXT_texture_compression_s3tc            , EXT_texture_compression_s3tc           , GLL, GLC,  x ,  x , 2000)
+EXT(EXT_texture_compression_s3tc            , EXT_texture_compression_s3tc           , GLL, GLC,  x , ES2, 2000)
 EXT(EXT_texture_cube_map                    , ARB_texture_cube_map                   , GLL,  x ,  x ,  x , 2001)
 EXT(EXT_texture_edge_clamp                  , dummy_true                             , GLL,  x ,  x ,  x , 1997)
 EXT(EXT_texture_env_add                     , dummy_true                             , GLL,  x ,  x ,  x , 1999)
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 3ad9e3c..5610de2 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -1312,7 +1312,7 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
       } else {
          return _mesa_is_desktop_gl(ctx)
             && ctx->Extensions.EXT_texture_sRGB
-            && ctx->Extensions.EXT_texture_compression_s3tc;
+            && _mesa_has_EXT_texture_compression_s3tc(ctx);
       }
    case MESA_FORMAT_LAYOUT_FXT1:
       return _mesa_has_3DFX_texture_compression_FXT1(ctx);
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index d036bce..59bb0e1 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -274,7 +274,7 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
       }
    }
 
-   if (ctx->Extensions.EXT_texture_compression_s3tc) {
+   if (_mesa_has_EXT_texture_compression_s3tc(ctx)) {
       if (formats) {
          formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
          formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c
index 04b7d73..1ac46d6 100644
--- a/src/mesa/main/textureview.c
+++ b/src/mesa/main/textureview.c
@@ -176,7 +176,7 @@ lookup_view_class(const struct gl_context *ctx, GLenum internalformat)
          return compatible_internal_formats[i].view_class;
    }
 
-   if (ctx->Extensions.EXT_texture_compression_s3tc &&
+   if (_mesa_has_EXT_texture_compression_s3tc(ctx) &&
        ctx->Extensions.EXT_texture_sRGB) {
       for (i = 0; i < ARRAY_SIZE(s3tc_compatible_internal_formats); i++) {
          if (s3tc_compatible_internal_formats[i].internal_format
-- 
2.6.2



More information about the mesa-dev mailing list