Mesa (master): i915g: Enable S3TC texture support

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Thu Apr 28 17:18:31 PDT 2011


Module: Mesa
Branch: master
Commit: 608a4a17feea9fba2812d4e5c01dd6dbadc5d6e0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=608a4a17feea9fba2812d4e5c01dd6dbadc5d6e0

Author: Christopher Egert <cme3000 at gmail.com>
Date:   Fri Apr 29 02:13:35 2011 +0200

i915g: Enable S3TC texture support

Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
Signed-off-by: Christopher Egert <cme3000 at gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker at gmail.com>

---

 src/gallium/drivers/i915/i915_screen.c        |    7 +++++++
 src/gallium/drivers/i915/i915_state_sampler.c |   10 ++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 0f4327f..0e42774 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -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;
 }
diff --git a/src/gallium/drivers/i915/i915_state_sampler.c b/src/gallium/drivers/i915/i915_state_sampler.c
index 916cb76..be70e7a 100644
--- a/src/gallium/drivers/i915/i915_state_sampler.c
+++ b/src/gallium/drivers/i915/i915_state_sampler.c
@@ -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);



More information about the mesa-commit mailing list