diff options
author | Brian Paul <brianp@vmware.com> | 2009-09-27 18:34:12 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-09-27 18:34:12 -0600 |
commit | d73cd703161dab3f2a6890bbe62d92fd548c1ed6 (patch) | |
tree | 8101633bf9b459d0ec7fd4084ab2d3b9f15a1071 /src/mesa | |
parent | 9525b92efbe0d2b44b3b5518464ca28575188bf7 (diff) |
glide: use _mesa_get_texstore_func()
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/glide/fxddtex.c | 86 |
1 files changed, 51 insertions, 35 deletions
diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index f3cd908181..a63301d964 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -42,6 +42,7 @@ #include "main/enums.h" #include "main/image.h" #include "main/teximage.h" +#include "main/texstore.h" #include "main/texformat.h" #include "main/texcompress.h" #include "main/texobj.h" @@ -135,15 +136,18 @@ _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, - texImage->TexFormat, dstImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstWidth * bpt, - 0, /* dstImageStride */ - dstWidth, dstHeight, 1, - GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, dstImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstWidth * bpt, + 0, /* dstImageStride */ + dstWidth, dstHeight, 1, + GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); FREE(dst); FREE(src); } @@ -1234,18 +1238,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 */ - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, tempImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * texelBytes, /* dstRowStride */ + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); /* now rescale */ /* compute address of dest subimage within the overal tex image */ @@ -1262,6 +1269,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; } @@ -1283,13 +1293,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, - 0, /* dstImageStride */ - 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, + 0, /* dstImageStride */ + newWidth, newHeight, 1, + GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); FREE(rawImage); } @@ -1430,13 +1440,16 @@ fxDDTexImage2D(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, - 0, /* dstImageStride */ - 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, + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); } /* GL_SGIS_generate_mipmap */ @@ -1543,13 +1556,16 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, } else { /* no rescaling needed */ - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, (GLubyte *) texImage->Data, - xoffset, yoffset, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, (GLubyte *) texImage->Data, + xoffset, yoffset, 0, /* dstX/Y/Zoffset */ + dstRowStride, + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); } /* GL_SGIS_generate_mipmap */ |