r600g: attempt to turn on DXTn formats
authorKeith Whitwell <keithw@vmware.com>
Wed, 3 Nov 2010 14:23:45 +0000 (14:23 +0000)
committerKeith Whitwell <keithw@vmware.com>
Tue, 9 Nov 2010 20:12:46 +0000 (20:12 +0000)
Seems to sort-of work for non-mipmapped textures.  Better than just
black anyway.

src/gallium/drivers/r600/eg_state_inlines.h
src/gallium/drivers/r600/r600_state_inlines.h
src/gallium/drivers/r600/r600_texture.c

index be81c28b43f5963940aa5f6a71a9629fec8034e4..59641976403a3f574320670490724f617288203d 100644 (file)
@@ -473,7 +473,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
        case PIPE_FORMAT_UYVY:
        case PIPE_FORMAT_YUYV:
        default:
-               R600_ERR("unsupported color format %d\n", format);
+               //R600_ERR("unsupported color format %d\n", format);
                return ~0; /* Unsupported. */
        }
 }
index 1c1978f8abb74e87d14f1dcd63b205075c6a5152..1be5b156d356274362070cfbd00bbae4946c0027 100644 (file)
@@ -472,7 +472,7 @@ static INLINE uint32_t r600_translate_colorformat(enum pipe_format format)
        case PIPE_FORMAT_UYVY:
        case PIPE_FORMAT_YUYV:
        default:
-               R600_ERR("unsupported color format %d %s\n", format, util_format_name(format));
+               //R600_ERR("unsupported color format %d %s\n", format, util_format_name(format));
                return ~0; /* Unsupported. */
        }
 }
index 06d17f7709ae0bcc3b17bff77ed1ebfdb375c7e2..02160fd3bb624c0c9e90f994606c2d9696a068b9 100644 (file)
@@ -806,7 +806,7 @@ uint32_t r600_translate_texformat(enum pipe_format format,
                        result = FMT_24_8;
                        goto out_word4;
                case PIPE_FORMAT_S8_USCALED:
-                       result = V_0280A0_COLOR_8;
+                       result = FMT_8;
                        word4 |= S_038010_NUM_FORMAT_ALL(V_038010_SQ_NUM_FORMAT_INT);
                        goto out_word4;
                default:
@@ -835,7 +835,20 @@ uint32_t r600_translate_texformat(enum pipe_format format,
 
        /* S3TC formats. TODO */
        if (desc->layout == UTIL_FORMAT_LAYOUT_S3TC) {
-               goto out_unknown;
+               switch (format) {
+               case PIPE_FORMAT_DXT1_RGB:
+               case PIPE_FORMAT_DXT1_RGBA:
+                        result = FMT_BC1;
+                        goto out_word4;
+               case PIPE_FORMAT_DXT3_RGBA:
+                        result = FMT_BC2;
+                        goto out_word4;
+               case PIPE_FORMAT_DXT5_RGBA:
+                        result = FMT_BC3;
+                        goto out_word4;
+                default:
+                        goto out_unknown;
+                }
        }