diff options
Diffstat (limited to 'src/mesa/drivers/dri/r128')
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_texmem.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/r128_texstate.c | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index 111fe1fd74..c369e14bd5 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -95,7 +95,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, if ( !image ) return; - switch ( image->TexFormat->TexelBytes ) { + switch ( _mesa_get_format_bytes(image->TexFormat->MesaFormat) ) { case 1: texelsPerDword = 4; break; case 2: texelsPerDword = 2; break; case 4: texelsPerDword = 1; break; @@ -215,9 +215,11 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, /* Copy the next chunck of the texture image into the blit buffer */ { + const GLuint texelBytes = + _mesa_get_format_bytes(image->TexFormat->MesaFormat); const GLubyte *src = (const GLubyte *) image->Data + - (y * image->Width + x) * image->TexFormat->TexelBytes; - const GLuint bytes = width * height * image->TexFormat->TexelBytes; + (y * image->Width + x) * texelBytes; + const GLuint bytes = width * height * texelBytes; memcpy(dst, src, bytes); } diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c index a9c9568003..9f4f9aea2d 100644 --- a/src/mesa/drivers/dri/r128/r128_texstate.c +++ b/src/mesa/drivers/dri/r128/r128_texstate.c @@ -123,7 +123,7 @@ static void r128SetTexImages( r128ContextPtr rmesa, totalSize += (tObj->Image[0][i]->Height * tObj->Image[0][i]->Width * - tObj->Image[0][i]->TexFormat->TexelBytes); + _mesa_get_format_bytes(tObj->Image[0][i]->TexFormat->MesaFormat)); /* Offsets must be 32-byte aligned for host data blits and tiling */ totalSize = (totalSize + 31) & ~31; |