summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/tdfx
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-27 18:38:50 -0600
committerBrian Paul <brianp@vmware.com>2009-09-27 18:38:50 -0600
commitf782f90c45fc9a483483ebd36c1971ecd0c7988d (patch)
tree0c60ae3de0da87810b413ae1d13ea5df8c5e9a0f /src/mesa/drivers/dri/tdfx
parentd73cd703161dab3f2a6890bbe62d92fd548c1ed6 (diff)
mesa: use _mesa_get_texstore_func()
Diffstat (limited to 'src/mesa/drivers/dri/tdfx')
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_tex.c73
1 files changed, 44 insertions, 29 deletions
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c
index f6a48b3ae1..91650088b9 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 */