i965: roland's DXTn format texture patch(bug10347)
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 10 Aug 2007 08:37:30 +0000 (16:37 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 10 Aug 2007 08:37:30 +0000 (16:37 +0800)
src/mesa/drivers/dri/i965/brw_tex.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index a62395a4327cace59e6e5813ad3478583400b550..ad29316a42a453b62bd97987767de30396cf34c2 100644 (file)
@@ -154,13 +154,19 @@ brwChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
 
    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:
index acf5771e77931402d3bbe6faee39f40a1f809b9d..0a45164a0fd09b79e040f387682029bdb093b5a8 100644 (file)
@@ -116,9 +116,17 @@ static GLuint translate_tex_format( GLuint mesa_format )
    case MESA_FORMAT_Z16:
       return BRW_SURFACEFORMAT_I16_UNORM;
 
-   case MESA_FORMAT_RGBA_DXT1:
    case MESA_FORMAT_RGB_DXT1:
-      return BRW_SURFACEFORMAT_DXT1_RGB;
+       return BRW_SURFACEFORMAT_DXT1_RGB;
+
+   case MESA_FORMAT_RGBA_DXT1:
+       return BRW_SURFACEFORMAT_BC1_UNORM;
+       
+   case MESA_FORMAT_RGBA_DXT3:
+       return BRW_SURFACEFORMAT_BC2_UNORM;
+       
+   case MESA_FORMAT_RGBA_DXT5:
+       return BRW_SURFACEFORMAT_BC3_UNORM;
 
    case MESA_FORMAT_SRGBA8:
       return BRW_SURFACEFORMAT_R8G8B8A8_UNORM_SRGB;