diff options
author | Brian Paul <brianp@vmware.com> | 2010-04-23 12:01:50 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-04-23 12:29:31 -0600 |
commit | c34feadd1c2fa5c62022c1f48ee675b25a985ac6 (patch) | |
tree | 11b0de3a43792126ce521091debf6239a8e30abc /src/mesa/main/image.c | |
parent | 3643841079a1413695172d0e5dd5e0a5f2e22945 (diff) |
mesa: make is_compressed_format() non-static
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r-- | src/mesa/main/image.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index dc8d97728b..8aef306fd8 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -751,6 +751,40 @@ _mesa_is_dudv_format(GLenum format) /** + * Test if an image format is a supported compressed format. + * \param format the internal format token provided by the user. + * \return GL_TRUE if compressed, GL_FALSE if uncompressed + */ +GLboolean +_mesa_is_compressed_format(GLcontext *ctx, GLenum format) +{ + switch (format) { + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: + return ctx->Extensions.EXT_texture_compression_s3tc; + case GL_RGB_S3TC: + case GL_RGB4_S3TC: + case GL_RGBA_S3TC: + case GL_RGBA4_S3TC: + return ctx->Extensions.S3_s3tc; + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: + return ctx->Extensions.EXT_texture_sRGB + && ctx->Extensions.EXT_texture_compression_s3tc; + case GL_COMPRESSED_RGB_FXT1_3DFX: + case GL_COMPRESSED_RGBA_FXT1_3DFX: + return ctx->Extensions.TDFX_texture_compression_FXT1; + default: + return GL_FALSE; + } +} + + +/** * Return the address of a specific pixel in an image (1D, 2D or 3D). * * Pixel unpacking/packing parameters are observed according to \p packing. |