-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_tex.c,v 1.7 2001/01/08 01:07:21 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
#include "r128_context.h"
#include "r128_state.h"
#include "r128_ioctl.h"
-#include "r128_vb.h"
#include "r128_tris.h"
#include "r128_tex.h"
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/simple_list.h"
+#include "main/texformat.h"
+#include "main/imports.h"
#define TEX_0 1
#define TEX_1 2
int imageWidth, imageHeight;
int remaining, rows;
int format, dwords;
- CARD32 pitch, offset;
+ uint32_t pitch, offset;
int i;
/* Ensure we have a valid texture to upload */
if ( ( level < 0 ) || ( level > R128_MAX_TEXTURE_LEVELS ) )
return;
- image = t->base.tObj->Image[level];
+ image = t->base.tObj->Image[0][level];
if ( !image )
return;
- switch ( image->TexFormat->TexelBytes ) {
+ switch ( _mesa_get_format_bytes(image->TexFormat) ) {
case 1: texelsPerDword = 4; break;
case 2: texelsPerDword = 2; break;
case 4: texelsPerDword = 1; break;
remaining > 0 ;
remaining -= rows, y += rows, i++ )
{
- CARD32 *dst;
+ uint32_t *dst;
drmBufPtr buffer;
assert(image->Data);
LOCK_HARDWARE( rmesa );
buffer = r128GetBufferLocked( rmesa );
- dst = (CARD32 *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET);
+ dst = (uint32_t *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET);
/* Copy the next chunck of the texture image into the blit buffer */
{
+ const GLuint texelBytes =
+ _mesa_get_format_bytes(image->TexFormat);
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);
}
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s( %p, %p )\n",
- __FUNCTION__, rmesa->glCtx, t );
+ __FUNCTION__, (void *) rmesa->glCtx, (void *) t );
}
assert(t);