diff options
author | Daniel Borca <[email protected]> | 2004-05-04 06:27:06 +0000 |
---|---|---|
committer | Daniel Borca <[email protected]> | 2004-05-04 06:27:06 +0000 |
commit | 33ffbd1c58dc8582f67d946f9eb26127e9851a10 (patch) | |
tree | a3a97552ee012bb549701e0b98020e6adaf3e479 /src/mesa/drivers/glide | |
parent | abe4a72cfcde712d4b18832e2751d26b94a7718e (diff) |
texture compression: getting warmer
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r-- | src/mesa/drivers/glide/fxddtex.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 3137195abb6..b0deb252b5d 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -46,7 +46,6 @@ #include "texcompress.h" #include "texobj.h" #include "texstore.h" -#include "texutil.h" void @@ -1207,7 +1206,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxTexInfo *ti; tfxMipMapLevel *mml; - GLint texelBytes; + GLint texelBytes, dstRowStride; if (TDFX_DEBUG & VERBOSE_TEXTURE) { fprintf(stderr, "fxDDTexImage2D: id=%d int 0x%x format 0x%x type 0x%x %dx%d\n", @@ -1279,14 +1278,17 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, /*if (!fxMesa->HaveTexFmt) assert(texelBytes == 1 || texelBytes == 2);*/ mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat); - /* [dBorca] Hack alert ZZZ: how do we handle FX_TC_NCC/FX_TC_NAPALM? */ - /* [dBorca] Hack alert ZZZ: how do we handle S3TC outside MESA?!?!?! */ + /* [dBorca] ZYX: how do we handle FX_TC_NCC/FX_TC_NAPALM? */ + /* [dBorca] ZYX: how do we handle S3TC outside MESA?!?!?! */ + /* [dBorca] ZYX: how do we handle aspectratio adjustemnt? */ /* allocate mipmap buffer */ assert(!texImage->Data); if (texImage->IsCompressed) { + dstRowStride = _mesa_compressed_row_stride(texImage->IntFormat, mml->width); texImage->Data = MESA_PBUFFER_ALLOC(texImage->CompressedSize); } else { + dstRowStride = mml->width * texelBytes; texImage->Data = MESA_PBUFFER_ALLOC(mml->width * mml->height * texelBytes); } if (!texImage->Data) { @@ -1332,10 +1334,10 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, texImage->TexFormat, texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ - mml->width * texelBytes, /* dstRowStride */ + dstRowStride, 0, /* dstImageStride */ mml->width, mml->height, 1, - GL_BGRA, type, tempImage, packing); + GL_BGRA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); FREE(rgbaImage); } else { /* [dBorca] mild case: @@ -1370,7 +1372,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, texImage->TexFormat->StoreImage(ctx, 2, texImage->Format, texImage->TexFormat, texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ - mml->width * texelBytes, /* dstRowStride */ + dstRowStride, 0, /* dstImageStride */ width, height, 1, format, type, pixels, packing); |