glide: use _mesa_get_format_bytes()

This commit is contained in:
Brian Paul 2009-09-27 19:53:54 -06:00
parent 2de7683280
commit 21db8959c1
2 changed files with 5 additions and 3 deletions

View file

@ -40,6 +40,7 @@
#include "fxdrv.h"
#include "main/enums.h"
#include "main/formats.h"
#include "main/image.h"
#include "main/teximage.h"
#include "main/texstore.h"
@ -1396,7 +1397,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level,
texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx,
internalFormat, format, type);
assert(texImage->TexFormat);
texelBytes = texImage->TexFormat->TexelBytes;
texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
/*if (!fxMesa->HaveTexFmt) assert(texelBytes == 1 || texelBytes == 2);*/
mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat);
@ -1531,7 +1532,7 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
assert(texImage->Data); /* must have an existing texture image! */
assert(texImage->_BaseFormat);
texelBytes = texImage->TexFormat->TexelBytes;
texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
if (texImage->IsCompressed) {
dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, mml->width);
} else {

View file

@ -42,6 +42,7 @@
#include "fxdrv.h"
#include "main/enums.h"
#include "main/formats.h"
#include "main/texstore.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
@ -91,7 +92,7 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj)
GLint _w, _h, maxSize = 1 << fxMesa->textureMaxLod;
if ((mml->width > maxSize) || (mml->height > maxSize)) {
/* need to rescale */
GLint texelBytes = texImage->TexFormat->TexelBytes;
GLint texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat);
GLvoid *texImage_Data = texImage->Data;
_w = MIN2(texImage->Width, maxSize);
_h = MIN2(texImage->Height, maxSize);