i915g: Enable S3TC texture support
authorChristopher Egert <cme3000@gmail.com>
Fri, 29 Apr 2011 00:13:35 +0000 (02:13 +0200)
committerJakob Bornecrantz <wallbraker@gmail.com>
Fri, 29 Apr 2011 00:15:07 +0000 (02:15 +0200)
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/i915/i915_state_sampler.c

index 0f4327fdc810e994e7fe8e0948c8bccf562eb88d..0e42774963669e7074e2a9e4ed16e9e41e85a3a0 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "draw/draw_context.h"
 #include "util/u_format.h"
+#include "util/u_format_s3tc.h"
 #include "util/u_inlines.h"
 #include "util/u_memory.h"
 #include "util/u_string.h"
@@ -267,6 +268,10 @@ i915_is_format_supported(struct pipe_screen *screen,
       PIPE_FORMAT_YUYV,
       /* XXX why not?
       PIPE_FORMAT_Z16_UNORM, */
+      PIPE_FORMAT_DXT1_RGB,
+      PIPE_FORMAT_DXT1_RGBA,
+      PIPE_FORMAT_DXT3_RGBA,
+      PIPE_FORMAT_DXT5_RGBA,
       PIPE_FORMAT_Z24X8_UNORM,
       PIPE_FORMAT_Z24_UNORM_S8_USCALED,
       PIPE_FORMAT_NONE  /* list terminator */
@@ -432,5 +437,7 @@ i915_screen_create(struct i915_winsys *iws)
 
    i915_debug_init(is);
 
+   util_format_s3tc_init();
+
    return &is->base;
 }
index 916cb767536e1ab2a1d23c67b19d66c9b70b72b1..be70e7a92c9c9cab472aae82e16b0b96c4818221 100644 (file)
@@ -223,15 +223,13 @@ static uint translate_texture_format(enum pipe_format pipeFormat)
 #endif
    case PIPE_FORMAT_Z16_UNORM:
       return (MAPSURF_16BIT | MT_16BIT_L16);
-#if 0
-   case PIPE_FORMAT_RGBA_DXT1:
-   case PIPE_FORMAT_RGB_DXT1:
+   case PIPE_FORMAT_DXT1_RGBA:
+   case PIPE_FORMAT_DXT1_RGB:
       return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT1);
-   case PIPE_FORMAT_RGBA_DXT3:
+   case PIPE_FORMAT_DXT3_RGBA:
       return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3);
-   case PIPE_FORMAT_RGBA_DXT5:
+   case PIPE_FORMAT_DXT5_RGBA:
       return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5);
-#endif
    case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
    case PIPE_FORMAT_Z24X8_UNORM:
       return (MAPSURF_32BIT | MT_32BIT_xI824);