diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2009-09-09 11:12:49 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2009-09-12 20:55:59 +0800 |
commit | 5c8873a3111031e77934eeedbf81b868617183e1 (patch) | |
tree | e2ca0832591d0bccb63a464eb4bdf204adeb3b83 /src/mesa/main/texcompress_fxt1.c | |
parent | b7c133b5c23ee02fecebc70717d02dc27b157786 (diff) |
mesa/main: Provide dummy texformats when FEATURE_texture_fxt1 is disabled.
Instead of removing the related enums and texture formats, provide dummy
ones when the feature is disabled.
Diffstat (limited to 'src/mesa/main/texcompress_fxt1.c')
-rw-r--r-- | src/mesa/main/texcompress_fxt1.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index fc151605c9..14de935e71 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; -} - - -/** * Called via TexFormat->StoreImage to store an RGB_FXT1 texture. */ static GLboolean @@ -224,6 +217,8 @@ fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, } +#endif /* FEATURE_texture_fxt1 */ + const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { MESA_FORMAT_RGB_FXT1, /* MesaFormat */ @@ -239,6 +234,7 @@ const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ +#if FEATURE_texture_fxt1 texstore_rgb_fxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ fetch_texel_2d_rgb_fxt1, /* FetchTexel2D */ @@ -247,6 +243,10 @@ const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { fetch_texel_2d_f_rgb_fxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ +#else + _mesa_texstore_null, + _MESA_TEXFORMAT_NULL_OPS +#endif }; const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { @@ -263,6 +263,7 @@ const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ +#if FEATURE_texture_fxt1 texstore_rgba_fxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ fetch_texel_2d_rgba_fxt1, /* FetchTexel2D */ @@ -271,9 +272,16 @@ const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { fetch_texel_2d_f_rgba_fxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ +#else + _mesa_texstore_null, + _MESA_TEXFORMAT_NULL_OPS +#endif }; +#if FEATURE_texture_fxt1 + + /***************************************************************************\ * FXT1 encoder * @@ -1722,3 +1730,16 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */ decode_1[mode](code, t, rgba); } + + +#endif /* FEATURE_texture_fxt1 */ + + +/** + * Called during context initialization. + */ +void +_mesa_init_texture_fxt1( GLcontext *ctx ) +{ + (void) ctx; +} |