Mesa (master): llvmpipe: Support S3TC when util_format_s3tc_enabled is set.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Apr 6 21:52:48 UTC 2010


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Apr  6 22:49:57 2010 +0100

llvmpipe: Support S3TC when util_format_s3tc_enabled is set.

---

 src/gallium/drivers/llvmpipe/lp_screen.c |   28 ++++++++++------------------
 1 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 625d409..6999599 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -28,6 +28,7 @@
 
 #include "util/u_memory.h"
 #include "util/u_format.h"
+#include "util/u_format_s3tc.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_screen.h"
 
@@ -186,19 +187,19 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
    case PIPE_FORMAT_DXT1_RGBA:
    case PIPE_FORMAT_DXT3_RGBA:
    case PIPE_FORMAT_DXT5_RGBA:
-      return FALSE;
+      return util_format_s3tc_enabled;
    default:
       break;
    }
 
-   if(format_desc->block.width != 1 ||
-      format_desc->block.height != 1)
-      return FALSE;
+   if(tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) {
+      if(format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
+         return FALSE;
 
-   if(format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
-      return FALSE;
+      if(format_desc->block.width != 1 ||
+         format_desc->block.height != 1)
+         return FALSE;
 
-   if(tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) {
       if(format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB &&
          format_desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB)
          return FALSE;
@@ -220,17 +221,6 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
          return FALSE;
    }
 
-   /* FIXME: Temporary restrictions. See lp_bld_sample_soa.c */
-   if(tex_usage & PIPE_TEXTURE_USAGE_SAMPLER) {
-      if(!format_desc->is_bitmask &&
-         format != PIPE_FORMAT_R32_FLOAT)
-         return FALSE;
-
-      if(format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB &&
-         format_desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS)
-         return FALSE;
-   }
-
    return TRUE;
 }
 
@@ -297,6 +287,8 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
    screen->base.context_create = llvmpipe_create_context;
    screen->base.flush_frontbuffer = llvmpipe_flush_frontbuffer;
 
+   util_format_s3tc_init();
+
    llvmpipe_init_screen_texture_funcs(&screen->base);
    llvmpipe_init_screen_buffer_funcs(&screen->base);
    llvmpipe_init_screen_fence_funcs(&screen->base);




More information about the mesa-commit mailing list