[Mesa-dev] [RFC 14/21] mesa: Fix ASTC extension functionality leak into GLES 1

Nanley Chery nanleychery at gmail.com
Mon Oct 19 15:44:52 PDT 2015


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

Stop a leak of ASTC functionality into GLES 1 contexts.

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

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 5610de2..f37b5da 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -1331,7 +1331,7 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
       return _mesa_is_desktop_gl(ctx) &&
          ctx->Extensions.ARB_texture_compression_bptc;
    case MESA_FORMAT_LAYOUT_ASTC:
-      return ctx->Extensions.KHR_texture_compression_astc_ldr;
+      return _mesa_has_KHR_texture_compression_astc_ldr(ctx);
    default:
       return GL_FALSE;
    }
@@ -2281,7 +2281,7 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat)
             return base_compressed;
    }
 
-   if (ctx->Extensions.KHR_texture_compression_astc_ldr &&
+   if (_mesa_has_KHR_texture_compression_astc_ldr(ctx) &&
       _mesa_is_astc_format(internalFormat))
         return GL_RGBA;
 
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index d9453e3..c14f941 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1374,7 +1374,7 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
        * TEXTURE_CUBE_MAP_ARRAY and the format is not ASTC.
        */
       if (target_can_be_compresed &&
-          ctx->Extensions.KHR_texture_compression_astc_ldr &&
+          _mesa_has_KHR_texture_compression_astc_ldr(ctx) &&
           layout != MESA_FORMAT_LAYOUT_ASTC)
          return write_error(error, GL_INVALID_OPERATION);
 
@@ -1391,7 +1391,7 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
          break;
       case MESA_FORMAT_LAYOUT_ASTC:
          target_can_be_compresed =
-                             ctx->Extensions.KHR_texture_compression_astc_hdr;
+                             _mesa_has_KHR_texture_compression_astc_hdr(ctx);
 
          /* Throw an INVALID_OPERATION error if the target is TEXTURE_3D and
           * and the hdr extension is not supported.
@@ -1405,7 +1405,7 @@ _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
           * the format is not ASTC.
           * See comment in switch case GL_TEXTURE_CUBE_MAP_ARRAY for more info.
           */
-         if (ctx->Extensions.KHR_texture_compression_astc_ldr)
+         if (_mesa_has_KHR_texture_compression_astc_ldr(ctx))
             return write_error(error, GL_INVALID_OPERATION);
          break;
       }
-- 
2.6.1



More information about the mesa-dev mailing list