summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-11-02 18:59:07 +0100
committerLuc Verhaegen <libv@skynet.be>2009-11-18 09:52:33 +0100
commitf9dd8fd0554863aa6942a5e3327214446be02c62 (patch)
treee6bde4b55152e3f5125d85895c99f986d1a8c0d7
parent03c7f61a1ff2a0f21bcc1b67ee8c72161dad1d70 (diff)
DRI: mesa: change compressed texture size calls
Replace calls to ctx->Driver.CompressedTextureSize with calls to _mesa_format_image_size. The former always called the later. Original SHA-ID: 35efc6a1b3e3dada2cf9bd3a503c1b84f4bcb7f5
-rw-r--r--dri/via_tex.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/dri/via_tex.c b/dri/via_tex.c
index a72dcd6..1bc5ddc 100644
--- a/dri/via_tex.c
+++ b/dri/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;