Mesa (master): mesa: Rip out more extension checking from texformat.c.

Eric Anholt anholt at kemper.freedesktop.org
Fri Aug 30 18:49:28 UTC 2013


Module: Mesa
Branch: master
Commit: b188467fdf71d8f4c5fab4aafae1253f64d9aab4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b188467fdf71d8f4c5fab4aafae1253f64d9aab4

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Aug 29 08:07:09 2013 -0700

mesa: Rip out more extension checking from texformat.c.

You should only be flagging the formats as supported if you support them
anyway.

NOTE: This is a candidate for the 9.2 branch. (required for next commit)
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/texformat.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index c2f9257..fdbf695 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -239,11 +239,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
        * 1D ARRAY textures in S3TC format.
        */
       if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) {
-         if (ctx->Extensions.EXT_texture_compression_s3tc ||
-             ctx->Extensions.ANGLE_texture_compression_dxt)
-            RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1);
-         if (ctx->Extensions.TDFX_texture_compression_FXT1)
-            RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1);
       }
       RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
       RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
@@ -252,11 +249,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
    case GL_COMPRESSED_RGBA_ARB:
       /* We don't use texture compression for 1D and 1D array textures. */
       if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) {
-         if (ctx->Extensions.EXT_texture_compression_s3tc ||
-             ctx->Extensions.ANGLE_texture_compression_dxt)
-            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */
-         if (ctx->Extensions.TDFX_texture_compression_FXT1)
-            RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1);
+         RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */
+         RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1);
       }
       RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
       RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);




More information about the mesa-commit mailing list