summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-27 18:28:22 -0600
committerBrian Paul <[email protected]>2009-09-27 18:28:22 -0600
commitf76cbac04abf26617bd65b50e923db8728a4f33f (patch)
tree292e8b73119b5c24db22802bb58ca5e106af18b7
parente07862d2c949bcae7c71e9fc8e90e4694ed25bb3 (diff)
mesa: use _mesa_get_texstore_func()
-rw-r--r--src/mesa/main/mipmap.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index 3dca09d9f28..5b70200cd5f 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -32,6 +32,7 @@
#include "texcompress.h"
#include "texformat.h"
#include "teximage.h"
+#include "texstore.h"
#include "image.h"
@@ -1665,16 +1666,21 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
const GLenum srcFormat = convertFormat->BaseFormat;
GLint dstRowStride
= _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth);
+ const StoreTexImageFunc storeImage =
+ _mesa_get_texstore_func(dstImage->TexFormat->MesaFormat);
+
ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA);
- dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat,
- dstImage->TexFormat,
- dstImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride, 0, /* strides */
- dstWidth, dstHeight, 1, /* size */
- srcFormat, CHAN_TYPE,
- dstData, /* src data, actually */
- &ctx->DefaultPacking);
+
+ storeImage(ctx, 2, dstImage->_BaseFormat,
+ dstImage->TexFormat,
+ dstImage->Data,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride, 0, /* strides */
+ dstWidth, dstHeight, 1, /* size */
+ srcFormat, CHAN_TYPE,
+ dstData, /* src data, actually */
+ &ctx->DefaultPacking);
+
/* swap src and dest pointers */
temp = (GLubyte *) srcData;
srcData = dstData;