From d6ee86c77a8e1543557fd64c1f1c354baa0a8ad8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 16:49:57 -0600 Subject: mesa: remove _mesa_compressed_texture_size() Use _mesa_format_image_size() instead. --- src/mesa/main/texcompress.c | 24 ------------------------ src/mesa/main/texcompress.h | 6 ------ src/mesa/main/texgetimage.c | 10 ++++------ src/mesa/main/texparam.c | 8 ++------ 4 files changed, 6 insertions(+), 42 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index b07265d6d8..ad10993307 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -113,30 +113,6 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) } - -/** - * Return number of bytes needed to store a texture of the given size - * using the specified (compressed?) format. - * This is called via the ctx->Driver.CompressedTextureSize function, - * unless a device driver overrides it. A driver might override this - * if it needs to use an unusual or padded texture memory layout. - * - * \param width texture width in texels. - * \param height texture height in texels. - * \param depth texture depth in texels. - * \param mesaFormat one of the MESA_FORMAT_* compressed formats - * - * \return size in bytes, or zero if bad format - */ -GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - gl_format mesaFormat ) -{ - return _mesa_format_image_size(mesaFormat, width, height, depth); -} - - /** * As above, but format is specified by a GLenum (GL_COMPRESSED_*) token. * diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 13af148394..70247098b2 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -33,11 +33,6 @@ extern GLuint _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); -extern GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - gl_format mesaFormat ); - extern GLuint _mesa_compressed_texture_size_glenum(GLcontext *ctx, GLsizei width, GLsizei height, @@ -64,7 +59,6 @@ _mesa_init_texture_fxt1( GLcontext *ctx ); /* no-op macros */ #define _mesa_get_compressed_formats( c, f ) 0 -#define _mesa_compressed_texture_size( c, w, h, d, f ) 0 #define _mesa_compressed_texture_size_glenum( c, w, h, d, f ) 0 #define _mesa_compressed_row_stride( f, w) 0 #define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index d5cd4b2b9d..1f0a3d793f 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -320,12 +320,10 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLuint size; - - /* don't use texImage->CompressedSize since that may be padded out */ - size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, - texImage->Depth, - texImage->TexFormat); + const GLuint size = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* pack texture image into a PBO */ diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a6b611dffb..afa66f149c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -853,12 +853,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: if (_mesa_is_format_compressed(img->TexFormat) && !isProxy) { - /* Don't use ctx->Driver.CompressedTextureSize() since that - * may returned a padded hardware size. - */ - *params = _mesa_compressed_texture_size(ctx, img->Width, - img->Height, img->Depth, - texFormat); + *params = _mesa_format_image_size(texFormat, img->Width, + img->Height, img->Depth); } else { _mesa_error(ctx, GL_INVALID_OPERATION, -- cgit v1.2.3