OSDN Git Service

mesa/main: Make FEATURE_texture_s3tc follow feature conventions.
authorChia-I Wu <olvaffe@gmail.com>
Thu, 29 Oct 2009 06:59:42 +0000 (14:59 +0800)
committerBrian Paul <brianp@vmware.com>
Thu, 29 Oct 2009 13:52:58 +0000 (07:52 -0600)
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/mesa/main/context.c
src/mesa/main/texcompress.h
src/mesa/main/texcompress_s3tc.c
src/mesa/main/texcompress_s3tc.h

index 1d540eb..101d3c6 100644 (file)
 #include "simple_list.h"
 #include "state.h"
 #include "stencil.h"
-#include "texcompress.h"
+#include "texcompress_s3tc.h"
 #include "teximage.h"
 #include "texobj.h"
 #include "texstate.h"
@@ -703,9 +703,7 @@ init_attrib_groups(GLcontext *ctx)
    if (!_mesa_init_texture( ctx ))
       return GL_FALSE;
 
-#if FEATURE_texture_s3tc
    _mesa_init_texture_s3tc( ctx );
-#endif
 
    /* Miscellaneous */
    ctx->NewState = _NEW_ALL;
index d4873db..5e73a31 100644 (file)
@@ -44,11 +44,6 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img,
                                gl_format mesaFormat,
                                GLsizei width, const GLubyte *image);
 
-
-extern void
-_mesa_init_texture_s3tc( GLcontext *ctx );
-
-
 #else /* _HAVE_FULL_GL */
 
 /* no-op macros */
index 9fc73fe..b271a53 100644 (file)
 #include "texcompress_s3tc.h"
 #include "texstore.h"
 
+
+#if FEATURE_texture_s3tc
+
+
 #ifdef __MINGW32__
 #define DXTN_LIBNAME "dxtn.dll"
 #define RTLD_LAZY 0
@@ -564,5 +568,7 @@ _mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage,
    texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
    texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
 }
-#endif
+#endif /* FEATURE_EXT_texture_sRGB */
+
 
+#endif /* FEATURE_texture_s3tc */
index 4041d24..2e7688d 100644 (file)
 #ifndef TEXCOMPRESS_S3TC_H
 #define TEXCOMPRESS_S3TC_H
 
+#include "main/mtypes.h"
 #include "texstore.h"
 
+
+#if FEATURE_texture_s3tc
+
 extern GLboolean
 _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS);
 
@@ -71,5 +75,32 @@ extern void
 _mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage,
                                   GLint i, GLint j, GLint k, GLfloat *texel);
 
+extern void
+_mesa_init_texture_s3tc(GLcontext *ctx);
+
+#else /* FEATURE_texture_s3tc */
+
+/* these are used only in texstore_funcs[] */
+#define _mesa_texstore_rgb_dxt1 NULL
+#define _mesa_texstore_rgba_dxt1 NULL
+#define _mesa_texstore_rgba_dxt3 NULL
+#define _mesa_texstore_rgba_dxt5 NULL
+
+/* these are used only in texfetch_funcs[] */
+#define _mesa_fetch_texel_2d_f_rgb_dxt1 NULL
+#define _mesa_fetch_texel_2d_f_rgba_dxt1 NULL
+#define _mesa_fetch_texel_2d_f_rgba_dxt3 NULL
+#define _mesa_fetch_texel_2d_f_rgba_dxt5 NULL
+#define _mesa_fetch_texel_2d_f_srgb_dxt1 NULL
+#define _mesa_fetch_texel_2d_f_srgba_dxt1 NULL
+#define _mesa_fetch_texel_2d_f_srgba_dxt3 NULL
+#define _mesa_fetch_texel_2d_f_srgba_dxt5 NULL
+
+static INLINE void
+_mesa_init_texture_s3tc(GLcontext *ctx)
+{
+}
+
+#endif /* FEATURE_texture_s3tc */
 
 #endif /* TEXCOMPRESS_S3TC_H */