From 59798cd8864b601e035cf2414517cd90d24ed786 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 29 Oct 2009 14:59:42 +0800 Subject: [PATCH] mesa/main: Make FEATURE_texture_s3tc follow feature conventions. Signed-off-by: Chia-I Wu --- src/mesa/main/context.c | 4 +--- src/mesa/main/texcompress.h | 5 ----- src/mesa/main/texcompress_s3tc.c | 8 +++++++- src/mesa/main/texcompress_s3tc.h | 31 +++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 1d540eb7329..101d3c6b675 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -123,7 +123,7 @@ #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; diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index d4873db54a8..5e73a3149bd 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -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 */ diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 9fc73fec511..b271a539a72 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -44,6 +44,10 @@ #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 */ diff --git a/src/mesa/main/texcompress_s3tc.h b/src/mesa/main/texcompress_s3tc.h index 4041d244d16..2e7688d3669 100644 --- a/src/mesa/main/texcompress_s3tc.h +++ b/src/mesa/main/texcompress_s3tc.h @@ -25,8 +25,12 @@ #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 */ -- 2.30.2