From f782f90c45fc9a483483ebd36c1971ecd0c7988d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:38:50 -0600 Subject: mesa: use _mesa_get_texstore_func() --- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 73 ++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 29 deletions(-) (limited to 'src/mesa/drivers/dri/tdfx') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index f6a48b3ae12..91650088b98 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -138,9 +138,12 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, } if (bpt) { + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + src = _s; dst = _d; - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, + storeImage(ctx, 2, texImage->_BaseFormat, texImage->TexFormat, dstImage, 0, 0, 0, /* dstX/Y/Zoffset */ dstWidth * bpt, @@ -1228,18 +1231,21 @@ adjust2DRatio (GLcontext *ctx, if (!texImage->IsCompressed) { GLubyte *destAddr; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + tempImage = MALLOC(width * height * texelBytes); if (!tempImage) { return GL_FALSE; } - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, tempImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * texelBytes, /* dstRowStride */ - &dstImageOffsets, - width, height, 1, - format, type, pixels, packing); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, tempImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * texelBytes, /* dstRowStride */ + &dstImageOffsets, + width, height, 1, + format, type, pixels, packing); /* now rescale */ /* compute address of dest subimage within the overal tex image */ @@ -1256,6 +1262,9 @@ adjust2DRatio (GLcontext *ctx, } else { const GLint rawBytes = 4; GLvoid *rawImage = MALLOC(width * height * rawBytes); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + if (!rawImage) { return GL_FALSE; } @@ -1278,13 +1287,13 @@ adjust2DRatio (GLcontext *ctx, width, height, /* src */ newWidth, newHeight, /* dst */ rawImage /*src*/, tempImage /*dst*/ ); - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ - dstRowStride, - &dstImageOffsets, - newWidth, newHeight, 1, - GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ + dstRowStride, + &dstImageOffsets, + newWidth, newHeight, 1, + GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); FREE(rawImage); } @@ -1437,13 +1446,16 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, else { /* no rescaling needed */ /* unpack image, apply transfer ops and store in texImage->Data */ - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); } } @@ -1507,13 +1519,16 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, } else { /* no rescaling needed */ - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset, yoffset, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); } ti->reloadImages = GL_TRUE; /* signal the image needs to be reloaded */ -- cgit v1.2.3