fix up radeon span functions using latest r200 code from Brian,
[mesa.git] / src / mesa / drivers / dri / i915 / i830_texstate.c
index a393fd1d52ecf1da5f343f3e28eb5d94762e6fb4..ba972dac8f176b1d4b2023f338c42a8abeb5fd7a 100644 (file)
@@ -125,6 +125,25 @@ static GLboolean i830SetTexImages( i830ContextPtr i830,
      textureFormat = MAPSURF_COMPRESSED | MT_COMPRESS_FXT1;
      break;
 
+   case MESA_FORMAT_RGBA_DXT1:
+   case MESA_FORMAT_RGB_DXT1:
+     /* 
+      * DXTn pitches are Width/4 * blocksize in bytes 
+      * for DXT1: blocksize=8 so Width/4*8 = Width * 2 
+      * for DXT3/5: blocksize=16 so Width/4*16 = Width * 4
+      */
+     t->intel.texelBytes = 2;
+     textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1);
+     break;
+   case MESA_FORMAT_RGBA_DXT3:
+     t->intel.texelBytes = 4;
+     textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3);
+     break;
+   case MESA_FORMAT_RGBA_DXT5:
+     t->intel.texelBytes = 4;
+     textureFormat = (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
+     break;
+
    default:
       fprintf(stderr, "%s: bad image format\n", __FUNCTION__);
       abort();
@@ -180,7 +199,7 @@ static GLboolean i830SetTexImages( i830ContextPtr i830,
         
            t->intel.image[face][i].offset = 
               y * pitch + x * t->intel.texelBytes;
-           t->intel.image[face][i].internalFormat = baseImage->Format;
+           t->intel.image[face][i].internalFormat = baseImage->_BaseFormat;
 
            d >>= 1;
            x += step_offsets[face][0] * d;
@@ -200,7 +219,7 @@ static GLboolean i830SetTexImages( i830ContextPtr i830,
            break;
         
         t->intel.image[0][i].offset = total_height * pitch;
-        t->intel.image[0][i].internalFormat = baseImage->Format;
+        t->intel.image[0][i].internalFormat = baseImage->_BaseFormat;
         if (t->intel.image[0][i].image->IsCompressed)
         {
           if (t->intel.image[0][i].image->Height > 4)
@@ -417,7 +436,7 @@ static GLboolean i830UpdateTexUnit( GLcontext *ctx, GLuint unit )
    struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
 
    if (texUnit->_ReallyEnabled &&
-       INTEL_CONTEXT(ctx)->intelScreen->textureSize < 2048 * 1024)
+       INTEL_CONTEXT(ctx)->intelScreen->tex.size < 2048 * 1024)
       return GL_FALSE;
 
    switch(texUnit->_ReallyEnabled) {