Merge branch 'texformat-rework'
[mesa.git] / src / mesa / drivers / dri / r128 / r128_texstate.c
index b287fc6f25e4058175d66e2e0e5f5d4c40e7575e..cb2b5f9536099e045e9a4cab672e473a5d5e5d8f 100644 (file)
@@ -1,4 +1,3 @@
-/* $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.,
@@ -33,16 +32,14 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
  *   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 "r128_context.h"
 #include "r128_state.h"
 #include "r128_ioctl.h"
-#include "r128_vb.h"
 #include "r128_tris.h"
 #include "r128_tex.h"
 
@@ -63,7 +60,7 @@ static void r128SetTexImages( r128ContextPtr rmesa,
    if ( R128_DEBUG & DEBUG_VERBOSE_API )
       fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *) tObj );
 
-   switch (baseImage->TexFormat->MesaFormat) {
+   switch (baseImage->TexFormat) {
    case MESA_FORMAT_ARGB8888:
    case MESA_FORMAT_ARGB8888_REV:
       t->textureFormat = R128_DATATYPE_ARGB8888;
@@ -125,7 +122,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));
 
       /* Offsets must be 32-byte aligned for host data blits and tiling */
       totalSize = (totalSize + 31) & ~31;
@@ -202,7 +199,7 @@ static GLboolean r128UpdateTextureEnv( GLcontext *ctx, int unit )
    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[0][tObj->BaseLevel]->Format;
+   const GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
    GLuint combine;
 
    if ( R128_DEBUG & DEBUG_VERBOSE_API ) {