summaryrefslogtreecommitdiff
path: root/src/mesa/main/texformat.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-09-21 19:29:15 -0700
committerKeith Whitwell <keith@tungstengraphics.com>2008-09-21 22:13:52 -0700
commit34a61c66fd1b625a5606b795d192a49632ff1787 (patch)
tree6c185413739b4af3b9790df17dc53a76a32f2312 /src/mesa/main/texformat.c
parent24172fe595eede2649dd88363d2cda68f928a03e (diff)
mesa: refactor: move #define FEATURE flags into new mfeatures.h file
Also, check the FEATURE flags in many places. (cherry picked from commit 40d1a40f294f1ed2dacfad6f5498322fc08cc2d1) Conflicts: src/mesa/main/config.h src/mesa/main/context.c src/mesa/main/texobj.c src/mesa/main/texstate.c src/mesa/main/texstore.c
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r--src/mesa/main/texformat.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index a32ad6380c..62acdba1bb 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -1445,21 +1445,27 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
case GL_COMPRESSED_INTENSITY_ARB:
return &_mesa_texformat_intensity;
case GL_COMPRESSED_RGB_ARB:
+#if FEATURE_texture_fxt1
if (ctx->Extensions.TDFX_texture_compression_FXT1)
return &_mesa_texformat_rgb_fxt1;
- else if (ctx->Extensions.EXT_texture_compression_s3tc ||
- ctx->Extensions.S3_s3tc)
+#endif
+#if FEATURE_texture_s3tc
+ if (ctx->Extensions.EXT_texture_compression_s3tc ||
+ ctx->Extensions.S3_s3tc)
return &_mesa_texformat_rgb_dxt1;
- else
- return &_mesa_texformat_rgb;
+#endif
+ return &_mesa_texformat_rgb;
case GL_COMPRESSED_RGBA_ARB:
+#if FEATURE_texture_fxt1
if (ctx->Extensions.TDFX_texture_compression_FXT1)
return &_mesa_texformat_rgba_fxt1;
- else if (ctx->Extensions.EXT_texture_compression_s3tc ||
- ctx->Extensions.S3_s3tc)
+#endif
+#if FEATURE_texture_s3tc
+ if (ctx->Extensions.EXT_texture_compression_s3tc ||
+ ctx->Extensions.S3_s3tc)
return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */
- else
- return &_mesa_texformat_rgba;
+#endif
+ return &_mesa_texformat_rgba;
default:
; /* fallthrough */
}
@@ -1474,6 +1480,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
}
}
+#if FEATURE_texture_fxt1
if (ctx->Extensions.TDFX_texture_compression_FXT1) {
switch (internalFormat) {
case GL_COMPRESSED_RGB_FXT1_3DFX:
@@ -1484,7 +1491,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
; /* fallthrough */
}
}
+#endif
+#if FEATURE_texture_s3tc
if (ctx->Extensions.EXT_texture_compression_s3tc) {
switch (internalFormat) {
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
@@ -1512,6 +1521,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
; /* fallthrough */
}
}
+#endif
if (ctx->Extensions.ARB_texture_float) {
switch (internalFormat) {