diff options
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_image.c | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texture.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/tdfx/tdfx_tex.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_tex.c | 14 |
4 files changed, 16 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index b159010b8ea..cbe29f61a2b 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -488,11 +488,10 @@ intelTexImage(GLcontext * ctx, else { /* Allocate regular memory and store the image there temporarily. */ if (_mesa_is_format_compressed(texImage->TexFormat)) { - sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, - texImage->Width, - texImage->Height, - texImage->Depth, - texImage->TexFormat); + sizeInBytes = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 8e9276c5ae2..1a48e8c9554 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -580,12 +580,10 @@ static void radeon_teximage( } else { int size; if (_mesa_is_format_compressed(texImage->TexFormat)) { - size = ctx->Driver.CompressedTextureSize(ctx, - texImage->Width, - texImage->Height, - texImage->Depth, - texImage->TexFormat); - + size = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); } else { size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat); } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 0cd9051613b..63783d6ecd8 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1408,11 +1408,8 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (_mesa_is_format_compressed(texImage->TexFormat)) { - GLuint compressedSize = ctx->Driver.CompressedTextureSize(ctx, - mml->width, - mml->height, - 1, - mesaFormat); + GLuint compressedSize = _mesa_format_image_size(mesaFormat, mml->width, + mml->height, 1); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); texImage->Data = _mesa_alloc_texmemory(compressedSize); } else { @@ -1637,11 +1634,8 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, /* allocate new storage for texture image, if needed */ if (!texImage->Data) { - compressedSize = ctx->Driver.CompressedTextureSize(ctx, - mml->width, - mml->height, - 1, - mesaFormat); + compressedSize = _mesa_format_image_size(mesaFormat, mml->width, + mml->height, 1); texImage->Data = _mesa_alloc_texmemory(compressedSize); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index a72dcd6be21..1bc5ddc429c 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -672,7 +672,6 @@ static void viaTexImage(GLcontext *ctx, struct via_texture_object *viaObj = (struct via_texture_object *)texObj; struct via_texture_image *viaImage = (struct via_texture_image *)texImage; int heaps[3], nheaps, i; - GLuint compressedSize; if (!is_empty_list(&vmesa->freed_tex_buffers)) { viaCheckBreadcrumb(vmesa, 0); @@ -692,14 +691,6 @@ static void viaTexImage(GLcontext *ctx, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - if (texelBytes == 0) { - /* compressed format */ - compressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat); - } - /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { postConvWidth = 32 / texelBytes; @@ -711,7 +702,10 @@ static void viaTexImage(GLcontext *ctx, /* allocate memory */ if (_mesa_is_format_compressed(texImage->TexFormat)) - sizeInBytes = compressedSize; + sizeInBytes = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); else sizeInBytes = postConvWidth * postConvHeight * texelBytes; |