Mesa (master): u_format: fix RGTC support in fits 8unorm.

Dave Airlie airlied at kemper.freedesktop.org
Sun Nov 6 22:32:34 UTC 2011


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Sun Nov  6 19:32:22 2011 +0000

u_format: fix RGTC support in fits 8unorm.

Signed RGTC won't fit in a unorm, so don't allow them.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/auxiliary/util/u_format.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c
index e07462a..cfc4a17 100644
--- a/src/gallium/auxiliary/util/u_format.c
+++ b/src/gallium/auxiliary/util/u_format.c
@@ -443,11 +443,16 @@ util_format_fits_8unorm(const struct util_format_description *format_desc)
    switch (format_desc->layout) {
 
    case UTIL_FORMAT_LAYOUT_S3TC:
-   case UTIL_FORMAT_LAYOUT_RGTC:
       /*
        * These are straight forward.
        */
-
+      return TRUE;
+   case UTIL_FORMAT_LAYOUT_RGTC:
+      if (format_desc->format == PIPE_FORMAT_RGTC1_SNORM ||
+          format_desc->format == PIPE_FORMAT_RGTC2_SNORM ||
+          format_desc->format == PIPE_FORMAT_LATC1_SNORM ||
+          format_desc->format == PIPE_FORMAT_LATC2_SNORM)
+         return FALSE;
       return TRUE;
 
    case UTIL_FORMAT_LAYOUT_PLAIN:




More information about the mesa-commit mailing list