Skip to content

Commit

Permalink
Merge pull request #18554 from hrydgard/tiger-woods-texture
Browse files Browse the repository at this point in the history
DXT5: Fix decoding of alpha channel for textures with a non-mod-4 width.
  • Loading branch information
hrydgard committed Dec 15, 2023
2 parents d61207b + acbc9dc commit dd4eed1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions GPU/Common/TextureDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,11 @@ void DXTDecoder::WriteColorsDXT3(u32 *dst, const DXT3Block *src, int pitch, int

void DXTDecoder::WriteColorsDXT5(u32 *dst, const DXT5Block *src, int pitch, int width, int height) {
// 48 bits, 3 bit index per pixel, 12 bits per line.
u64 alphadata = ((u64)(u16)src->alphadata1 << 32) | (u32)src->alphadata2;
u64 allAlpha = ((u64)(u16)src->alphadata1 << 32) | (u32)src->alphadata2;

for (int y = 0; y < height; y++) {
int colordata = src->color.lines[y];
uint32_t colordata = src->color.lines[y];
uint32_t alphadata = allAlpha >> (12 * y);
for (int x = 0; x < width; x++) {
dst[x] = colors_[colordata & 3] | (alpha_[alphadata & 7] << 24);
colordata >>= 2;
Expand Down
7 changes: 7 additions & 0 deletions assets/compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,13 @@ UCKS45124 = true
UCJS10104 = true
NPJG00047 = true

# Tiger Woods 06 - bloom during rain
ULUS10028 = true
ULES00153 = true
ULES00154 = true
ULJM05059 = true
ULAS42020 = true

[ForceLowerResolutionForEffectsOff]
# Some games really don't work with this. Ratchet & Clank looks terrible.
UCUS98633 = true
Expand Down

0 comments on commit dd4eed1

Please sign in to comment.