diff options
author | Daniel Borca <[email protected]> | 2003-10-29 14:35:31 +0000 |
---|---|---|
committer | Daniel Borca <[email protected]> | 2003-10-29 14:35:31 +0000 |
commit | 40bd9d0b190e11d39350d1b08d2c2b28e3040bca (patch) | |
tree | e41b12cb816b27f7d0380f8b305c582a039ea7a4 /src/mesa/main/texformat.c | |
parent | e96a12101003ffdd61ce37f131631f4e6edaaa91 (diff) |
texture compression
Diffstat (limited to 'src/mesa/main/texformat.c')
-rw-r--r-- | src/mesa/main/texformat.c | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index b5c721f211d..0000767f4cc 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -453,6 +453,40 @@ const struct gl_texture_format _mesa_texformat_ycbcr_rev = { fetch_3d_texel_ycbcr_rev, /* FetchTexel3D */ }; +const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { + MESA_FORMAT_RGB_FXT1, /* MesaFormat */ + GL_RGB, /* BaseFormat */ + 4, /*approx*/ /* RedBits */ + 4, /*approx*/ /* GreenBits */ + 4, /*approx*/ /* BlueBits */ + 0, /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* TexelBytes */ + NULL, /*impossible*/ /* FetchTexel1D */ + fetch_2d_texel_rgb_fxt1, /* FetchTexel2D */ + NULL, /*impossible*/ /* FetchTexel3D */ +}; + +const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { + MESA_FORMAT_RGBA_FXT1, /* MesaFormat */ + GL_RGBA, /* BaseFormat */ + 4, /*approx*/ /* RedBits */ + 4, /*approx*/ /* GreenBits */ + 4, /*approx*/ /* BlueBits */ + 1, /*approx*/ /* AlphaBits */ + 0, /* LuminanceBits */ + 0, /* IntensityBits */ + 0, /* IndexBits */ + 0, /* DepthBits */ + 0, /* TexelBytes */ + NULL, /*impossible*/ /* FetchTexel1D */ + fetch_2d_texel_rgba_fxt1, /* FetchTexel2D */ + NULL, /*impossible*/ /* FetchTexel3D */ +}; + const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { MESA_FORMAT_RGB_DXT1, /* MesaFormat */ GL_RGB, /* BaseFormat */ @@ -838,13 +872,17 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_COMPRESSED_RGB_ARB: if (!ctx->Extensions.ARB_texture_compression) _mesa_problem(ctx, "texture compression extension not enabled"); - if (ctx->Extensions.EXT_texture_compression_s3tc) + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_rgb_fxt1; + else if (ctx->Extensions.EXT_texture_compression_s3tc) return &_mesa_texformat_rgb_dxt1; return &_mesa_texformat_rgb; case GL_COMPRESSED_RGBA_ARB: if (!ctx->Extensions.ARB_texture_compression) _mesa_problem(ctx, "texture compression extension not enabled"); - if (ctx->Extensions.EXT_texture_compression_s3tc) + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_rgba_fxt1; + else if (ctx->Extensions.EXT_texture_compression_s3tc) return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1! See the spec */ return &_mesa_texformat_rgba; @@ -855,6 +893,18 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, else return &_mesa_texformat_ycbcr_rev; + /* GL_3DFX_texture_compression_FXT1 */ + case GL_COMPRESSED_RGB_FXT1_3DFX: + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_rgb_fxt1; + else + return NULL; + case GL_COMPRESSED_RGBA_FXT1_3DFX: + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_rgba_fxt1; + else + return NULL; + /* GL_EXT_texture_compression_s3tc */ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) |