summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-10-29 14:59:42 +0800
committerBrian Paul <[email protected]>2009-10-29 07:52:58 -0600
commit59798cd8864b601e035cf2414517cd90d24ed786 (patch)
tree8bc1b44d4f2d492da4a3ae6596e24aa08152bbf8 /src
parent20e20fc5afa7525e247fd607e04d9adfffe730b4 (diff)
mesa/main: Make FEATURE_texture_s3tc follow feature conventions.
Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/context.c4
-rw-r--r--src/mesa/main/texcompress.h5
-rw-r--r--src/mesa/main/texcompress_s3tc.c8
-rw-r--r--src/mesa/main/texcompress_s3tc.h31
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 */