Permalink
Browse files

TexCache: Respect color order in DXT3/5.

Hardware is still doing DXT1 style colors in this scenario.
  • Loading branch information...
unknownbrackets committed Nov 4, 2018
1 parent 11ab4e8 commit c31e01771ea4501e2b100aa6cbb8aa85707a64f0
Showing with 2 additions and 2 deletions.
  1. +2 −2 GPU/Common/TextureDecoder.cpp
@@ -368,15 +368,15 @@ void DXTDecoder::DecodeColors(const DXT1Block *src, bool ignore1bitAlpha) {
colors_[0] = makecol(red1, green1, blue1, alpha);
colors_[1] = makecol(red2, green2, blue2, alpha);
if (c1 > c2 || ignore1bitAlpha) {
if (c1 > c2) {
colors_[2] = makecol(mix_2_3(red1, red2), mix_2_3(green1, green2), mix_2_3(blue1, blue2), alpha);
colors_[3] = makecol(mix_2_3(red2, red1), mix_2_3(green2, green1), mix_2_3(blue2, blue1), alpha);
} else {
// Average - these are always left shifted, so no need to worry about ties.
int red3 = (red1 + red2) / 2;
int green3 = (green1 + green2) / 2;
int blue3 = (blue1 + blue2) / 2;
colors_[2] = makecol(red3, green3, blue3, 255);
colors_[2] = makecol(red3, green3, blue3, alpha);
colors_[3] = makecol(0, 0, 0, 0);
}
}

0 comments on commit c31e017

Please sign in to comment.