summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r128
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-27 20:24:59 -0600
committerBrian Paul <[email protected]>2009-09-27 20:24:59 -0600
commit9fbb8884f034e0d691fed0e099d4d796f3b42848 (patch)
treeba0555d8abd2864234f9770e0e99fe97533c9526 /src/mesa/drivers/dri/r128
parente0bc4533ebccbfb844522e2b6ddd171b97d693e8 (diff)
mesa/drivers: use _mesa_get_format_bytes()
Diffstat (limited to 'src/mesa/drivers/dri/r128')
-rw-r--r--src/mesa/drivers/dri/r128/r128_texmem.c8
-rw-r--r--src/mesa/drivers/dri/r128/r128_texstate.c2
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 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);
}
diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c
index a9c9568003b..9f4f9aea2db 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;