summaryrefslogtreecommitdiff
path: root/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-10-01 21:13:25 -0600
committerBrian Paul <brianp@vmware.com>2009-10-01 21:13:34 -0600
commit32aa40eee46fd0b15f3873069f2440ea2dd75408 (patch)
tree68290ae1fc589a11650093cb0840405e8a520053 /src/mesa/main/mipmap.c
parent8c92a531fb7e0d2de2a06610b2dff98eeb19c985 (diff)
mesa: removed gl_texture_image::CompressedSize field
Just call ctx->Driver.CompressedTextureSize() when we need to get the compressed image size.
Diffstat (limited to 'src/mesa/main/mipmap.c')
-rw-r--r--src/mesa/main/mipmap.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index f6d6ce33c8..e24e7285c3 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -1614,24 +1614,19 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
dstImage->TexFormat = srcImage->TexFormat;
dstImage->FetchTexelc = srcImage->FetchTexelc;
dstImage->FetchTexelf = srcImage->FetchTexelf;
+
+ /* Alloc new teximage data buffer.
+ * Setup src and dest data pointers.
+ */
if (_mesa_is_format_compressed(dstImage->TexFormat)) {
- dstImage->CompressedSize
+ GLuint dstCompressedSize
= ctx->Driver.CompressedTextureSize(ctx, dstImage->Width,
dstImage->Height,
dstImage->Depth,
dstImage->TexFormat);
- ASSERT(dstImage->CompressedSize > 0);
- }
-
- ASSERT(dstImage->TexFormat);
- ASSERT(dstImage->FetchTexelc);
- ASSERT(dstImage->FetchTexelf);
+ ASSERT(dstCompressedSize > 0);
- /* Alloc new teximage data buffer.
- * Setup src and dest data pointers.
- */
- if (_mesa_is_format_compressed(dstImage->TexFormat)) {
- dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize);
+ dstImage->Data = _mesa_alloc_texmemory(dstCompressedSize);
if (!dstImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps");
return;
@@ -1653,6 +1648,10 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
dstData = (GLubyte *) dstImage->Data;
}
+ ASSERT(dstImage->TexFormat);
+ ASSERT(dstImage->FetchTexelc);
+ ASSERT(dstImage->FetchTexelf);
+
_mesa_generate_mipmap_level(target, datatype, comps, border,
srcWidth, srcHeight, srcDepth,
srcData, srcImage->RowStride,