aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r128/r128_texmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r128/r128_texmem.c')
-rw-r--r--src/mesa/drivers/dri/r128/r128_texmem.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c
index 111fe1fd742..c369e14bd50 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);
}