Mesa (master): mesa/main: Make FEATURE_texture_fxt1 follow feature conventions.

Brian Paul brianp at kemper.freedesktop.org
Thu Oct 29 13:54:50 UTC 2009


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

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Thu Oct 29 14:14:04 2009 +0800

mesa/main: Make FEATURE_texture_fxt1 follow feature conventions.

Also remove the unused initialization and GLchan fetch functions.

Signed-off-by: Chia-I Wu <olvaffe at gmail.com>

---

 src/mesa/main/context.c          |    3 ---
 src/mesa/main/texcompress.h      |    3 ---
 src/mesa/main/texcompress_fxt1.c |   35 ++++++-----------------------------
 src/mesa/main/texcompress_fxt1.h |   22 ++++++++++++++--------
 4 files changed, 20 insertions(+), 43 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index c57d7c1..1d540eb 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -706,9 +706,6 @@ init_attrib_groups(GLcontext *ctx)
 #if FEATURE_texture_s3tc
    _mesa_init_texture_s3tc( ctx );
 #endif
-#if FEATURE_texture_fxt1
-   _mesa_init_texture_fxt1( ctx );
-#endif
 
    /* Miscellaneous */
    ctx->NewState = _NEW_ALL;
diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h
index 4184167..d4873db 100644
--- a/src/mesa/main/texcompress.h
+++ b/src/mesa/main/texcompress.h
@@ -48,9 +48,6 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
 extern void
 _mesa_init_texture_s3tc( GLcontext *ctx );
 
-extern void
-_mesa_init_texture_fxt1( GLcontext *ctx );
-
 
 #else /* _HAVE_FULL_GL */
 
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c
index ef42fb9..85becb8 100644
--- a/src/mesa/main/texcompress_fxt1.c
+++ b/src/mesa/main/texcompress_fxt1.c
@@ -41,6 +41,9 @@
 #include "texstore.h"
 
 
+#if FEATURE_texture_fxt1
+
+
 static void
 fxt1_encode (GLuint width, GLuint height, GLint comps,
              const void *source, GLint srcRowStride,
@@ -52,16 +55,6 @@ fxt1_decode_1 (const void *texture, GLint stride,
 
 
 /**
- * Called during context initialization.
- */
-void
-_mesa_init_texture_fxt1( GLcontext *ctx )
-{
-   (void) ctx;
-}
-
-
-/**
  * Store user's image in rgb_fxt1 format.
  */
 GLboolean
@@ -176,15 +169,6 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
 
 
 void
-_mesa_fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage,
-                                GLint i, GLint j, GLint k, GLchan *texel )
-{
-   (void) k;
-   fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel);
-}
-
-
-void
 _mesa_fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage,
                                   GLint i, GLint j, GLint k, GLfloat *texel )
 {
@@ -200,16 +184,6 @@ _mesa_fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage,
 
 
 void
-_mesa_fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage,
-                               GLint i, GLint j, GLint k, GLchan *texel )
-{
-   (void) k;
-   fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel);
-   texel[ACOMP] = 255;
-}
-
-
-void
 _mesa_fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage,
                                  GLint i, GLint j, GLint k, GLfloat *texel )
 {
@@ -1673,3 +1647,6 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */
 
    decode_1[mode](code, t, rgba);
 }
+
+
+#endif /* FEATURE_texture_fxt1 */
diff --git a/src/mesa/main/texcompress_fxt1.h b/src/mesa/main/texcompress_fxt1.h
index b74f955..d63ca71 100644
--- a/src/mesa/main/texcompress_fxt1.h
+++ b/src/mesa/main/texcompress_fxt1.h
@@ -25,8 +25,11 @@
 #ifndef TEXCOMPRESS_FXT1_H
 #define TEXCOMPRESS_FXT1_H
 
+#include "main/mtypes.h"
 #include "texstore.h"
 
+#if FEATURE_texture_fxt1
+
 extern GLboolean
 _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS);
 
@@ -34,20 +37,23 @@ extern GLboolean
 _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS);
 
 extern void
-_mesa_fetch_texel_2d_rgba_fxt1(const struct gl_texture_image *texImage,
-                               GLint i, GLint j, GLint k, GLchan *texel);
-
-extern void
 _mesa_fetch_texel_2d_f_rgba_fxt1(const struct gl_texture_image *texImage,
                                  GLint i, GLint j, GLint k, GLfloat *texel);
 
 extern void
-_mesa_fetch_texel_2d_rgb_fxt1(const struct gl_texture_image *texImage,
-                              GLint i, GLint j, GLint k, GLchan *texel);
-
-extern void
 _mesa_fetch_texel_2d_f_rgb_fxt1(const struct gl_texture_image *texImage,
                                 GLint i, GLint j, GLint k, GLfloat *texel);
 
+#else /* FEATURE_texture_fxt1 */
+
+/* these are used only in texstore_funcs[] */
+#define _mesa_texstore_rgb_fxt1 NULL
+#define _mesa_texstore_rgba_fxt1 NULL
+
+/* these are used only in texfetch_funcs[] */
+#define _mesa_fetch_texel_2d_f_rgba_fxt1 NULL
+#define _mesa_fetch_texel_2d_f_rgb_fxt1 NULL
+
+#endif /* FEATURE_texture_fxt1 */
 
 #endif /* TEXCOMPRESS_FXT1_H */




More information about the mesa-commit mailing list