Mesa (master): Revert "util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)"

Dave Airlie airlied at kemper.freedesktop.org
Wed Feb 16 06:10:38 UTC 2011


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Feb 16 16:13:58 2011 +1000

Revert "util: fix DXT1 RGBA texture compression if the source color is (0, 0, 0, 0)"

This reverts commit 6e7d782da506da233b2ac695b022ac393e1c719e.

Oops, I just had this locally for testing and forgot to remove it before pushing.

---

 src/gallium/auxiliary/util/u_format_s3tc.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format_s3tc.c b/src/gallium/auxiliary/util/u_format_s3tc.c
index 31288e3..bb989c2 100644
--- a/src/gallium/auxiliary/util/u_format_s3tc.c
+++ b/src/gallium/auxiliary/util/u_format_s3tc.c
@@ -416,20 +416,8 @@ util_format_dxt1_rgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
          uint8_t tmp[4][4][4];  /* [bh][bw][comps] */
          for(j = 0; j < bh; ++j) {
             for(i = 0; i < bw; ++i) {
-               const uint8_t *srcp = &src[(y + j)*src_stride/sizeof(*src) + (x + i)*comps];
-               /* Workaround for a bug in libtxc_dxtn.
-                * If the color is (0,0,0,0), it is compressed as (0,0,0,1),
-                * which is incorrect. Any other (x,y,z,0) color is compressed
-                * correctly as (0,0,0,0), so let's use (1,0,0,0). */
-               if (srcp[0] == 0 && srcp[1] == 0 && srcp[2] == 0 && srcp[3] == 0) {
-                  tmp[j][i][0] = 255;
-                  tmp[j][i][1] = 0;
-                  tmp[j][i][2] = 0;
-                  tmp[j][i][3] = 0;
-               } else {
-                  for(k = 0; k < comps; ++k) {
-                     tmp[j][i][k] = srcp[k];
-                  }
+               for(k = 0; k < comps; ++k) {
+                  tmp[j][i][k] = src[(y + j)*src_stride/sizeof(*src) + (x + i)*comps + k];
                }
             }
          }




More information about the mesa-commit mailing list