i965: fix for FXT1 & S3TC texture format
authorXiang, Haihao <haihao.xiang@intel.com>
Sun, 18 Mar 2007 10:26:16 +0000 (18:26 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Sun, 18 Mar 2007 10:26:16 +0000 (18:26 +0800)
choose the right mesa texformat for FXT1 & S3TC

src/mesa/drivers/dri/i965/brw_tex.c

index c3ffa9e65777b9a46e75d8a7d38f99d7a69aceea..467aec64a01a1d0b0ac41d560b2056c1cdc61798 100644 (file)
@@ -148,18 +148,25 @@ brwChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
          return &_mesa_texformat_ycbcr_rev;
 
    case GL_COMPRESSED_RGB_FXT1_3DFX:
+       return &_mesa_texformat_rgb_fxt1;
    case GL_COMPRESSED_RGBA_FXT1_3DFX:
-     return &_mesa_texformat_rgb_fxt1;
+       return &_mesa_texformat_rgba_fxt1;
 
    case GL_RGB_S3TC:
    case GL_RGB4_S3TC:
+   case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+       return &_mesa_texformat_rgb_dxt1;
+
+   case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+       return &_mesa_texformat_rgba_dxt1;
+
    case GL_RGBA_S3TC:
    case GL_RGBA4_S3TC:
    case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+       return &_mesa_texformat_rgba_dxt3;
+
    case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
-   case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
-   case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
-     return &_mesa_texformat_rgb_dxt1; /* there is no rgba support? */
+       return &_mesa_texformat_rgba_dxt5;
 
    case GL_DEPTH_COMPONENT:
    case GL_DEPTH_COMPONENT16: