-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_texstate.c,v 1.1 2002/02/22 21:44:58 dawes Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
* Brian Paul <brianp@valinux.com>
*/
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/texformat.h"
#include "r128_context.h"
#include "r128_state.h"
#include "r128_ioctl.h"
-#include "r128_vb.h"
#include "r128_tris.h"
#include "r128_tex.h"
const struct gl_texture_object *tObj )
{
r128TexObjPtr t = (r128TexObjPtr) tObj->DriverData;
- struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel];
+ struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel];
int log2Pitch, log2Height, log2Size, log2MinSize;
int totalSize;
int i;
assert(baseImage);
if ( R128_DEBUG & DEBUG_VERBOSE_API )
- fprintf( stderr, "%s( %p )\n", __FUNCTION__, tObj );
+ fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *) tObj );
switch (baseImage->TexFormat->MesaFormat) {
case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_ARGB8888_REV:
t->textureFormat = R128_DATATYPE_ARGB8888;
break;
case MESA_FORMAT_ARGB4444:
+ case MESA_FORMAT_ARGB4444_REV:
t->textureFormat = R128_DATATYPE_ARGB4444;
break;
case MESA_FORMAT_RGB565:
+ case MESA_FORMAT_RGB565_REV:
t->textureFormat = R128_DATATYPE_RGB565;
break;
case MESA_FORMAT_RGB332:
firstLevel = t->base.firstLevel;
lastLevel = t->base.lastLevel;
- log2Pitch = tObj->Image[firstLevel]->WidthLog2;
- log2Height = tObj->Image[firstLevel]->HeightLog2;
+ log2Pitch = tObj->Image[0][firstLevel]->WidthLog2;
+ log2Height = tObj->Image[0][firstLevel]->HeightLog2;
log2Size = MAX2(log2Pitch, log2Height);
log2MinSize = log2Size;
for ( i = firstLevel; i <= lastLevel; i++ ) {
const struct gl_texture_image *texImage;
- texImage = tObj->Image[i];
+ texImage = tObj->Image[0][i];
if ( !texImage || !texImage->Data ) {
lastLevel = i - 1;
break;
log2MinSize = texImage->MaxLog2;
t->image[i - firstLevel].offset = totalSize;
- t->image[i - firstLevel].width = tObj->Image[i]->Width;
- t->image[i - firstLevel].height = tObj->Image[i]->Height;
+ t->image[i - firstLevel].width = tObj->Image[0][i]->Width;
+ t->image[i - firstLevel].height = tObj->Image[0][i]->Height;
t->base.dirty_images[0] |= (1 << i);
- totalSize += (tObj->Image[i]->Height *
- tObj->Image[i]->Width *
- tObj->Image[i]->TexFormat->TexelBytes);
+ totalSize += (tObj->Image[0][i]->Height *
+ tObj->Image[0][i]->Width *
+ tObj->Image[0][i]->TexFormat->TexelBytes);
/* Offsets must be 32-byte aligned for host data blits and tiling */
totalSize = (totalSize + 31) & ~31;
GLint source = rmesa->tmu_source[unit];
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[source];
const struct gl_texture_object *tObj = texUnit->_Current;
- const GLenum format = tObj->Image[tObj->BaseLevel]->Format;
+ const GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
GLuint combine;
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s( %p, %d )\n",
- __FUNCTION__, ctx, unit );
+ __FUNCTION__, (void *) ctx, unit );
}
if ( unit == 0 ) {
/* Fallback if there's a texture border */
- if ( tObj->Image[tObj->BaseLevel]->Border > 0 ) {
+ if ( tObj->Image[0][tObj->BaseLevel]->Border > 0 ) {
return GL_FALSE;
}