fix up radeon span functions using latest r200 code from Brian,
[mesa.git] / src / mesa / drivers / dri / i915 / intel_tex.c
index b6b8188275a9168e2351a131debccd79763d8739..d256dbf7cb833fc620c4970943601a3bcad4e8e0 100644 (file)
@@ -28,6 +28,7 @@
 #include "glheader.h"
 #include "mtypes.h"
 #include "imports.h"
+#include "macros.h"
 #include "simple_list.h"
 #include "enums.h"
 #include "image.h"
@@ -452,7 +453,7 @@ intelChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
 {
    intelContextPtr intel = INTEL_CONTEXT( ctx );
    const GLboolean do32bpt = ( intel->intelScreen->cpp == 4 &&
-                              intel->intelScreen->textureSize > 4*1024*1024);
+                              intel->intelScreen->tex.size > 4*1024*1024);
 
    switch ( internalFormat ) {
    case 4:
@@ -509,10 +510,7 @@ intelChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
    case GL_ALPHA12:
    case GL_ALPHA16:
    case GL_COMPRESSED_ALPHA:
-/*       if (1 || intel->intelScreen->deviceID == PCI_CHIP_I915_G) */
-        return &_mesa_texformat_a8;
-/*       else */
-/*      return &_mesa_texformat_al88; */
+      return &_mesa_texformat_a8;
 
    case 1:
    case GL_LUMINANCE:
@@ -570,8 +568,16 @@ intelChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
    case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
       return &_mesa_texformat_rgba_dxt5;
 
+   case GL_DEPTH_COMPONENT:
+   case GL_DEPTH_COMPONENT16:
+   case GL_DEPTH_COMPONENT24:
+   case GL_DEPTH_COMPONENT32:
+      return &_mesa_texformat_depth_component16;
+
    default:
-      fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__);
+      fprintf(stderr, "unexpected texture format %s in %s\n", 
+             _mesa_lookup_enum_by_nr(internalFormat),
+             __FUNCTION__);
       return NULL;
    }
 
@@ -640,8 +646,7 @@ static void intelUploadTexImage( intelContextPtr intel,
                 image->Width, image->Height, image->Depth, offset,
                 row_len, t->Pitch, t->depth_pitch);
 
-      switch(image->IntFormat)
-       {
+      switch (image->InternalFormat) {
        case GL_COMPRESSED_RGB_FXT1_3DFX:
        case GL_COMPRESSED_RGBA_FXT1_3DFX:
        case GL_RGB_S3TC:
@@ -663,9 +668,9 @@ static void intelUploadTexImage( intelContextPtr intel,
          }
          break;
        default:
-         fprintf(stderr,"Internal Compressed format not supported %d\n", image->IntFormat);
+         fprintf(stderr,"Internal Compressed format not supported %d\n", image->InternalFormat);
          break;
-       }
+      }
    }
    else {
       GLuint row_len = image->Width * image->TexFormat->TexelBytes;
@@ -743,7 +748,7 @@ int intelUploadTexImages( intelContextPtr intel,
 
         /* Set the base offset of the texture image */
         t->BufAddr = intel->intelScreen->tex.map + t->base.memBlock->ofs;
-        t->TextureOffset = intel->intelScreen->textureOffset + t->base.memBlock->ofs;
+        t->TextureOffset = intel->intelScreen->tex.offset + t->base.memBlock->ofs;
         t->dirty = ~0;
       }