Skip to content

Commit dd4eed1

Browse files
authored
Merge pull request #18554 from hrydgard/tiger-woods-texture
DXT5: Fix decoding of alpha channel for textures with a non-mod-4 width.
2 parents d61207b + acbc9dc commit dd4eed1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

GPU/Common/TextureDecoder.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,11 @@ void DXTDecoder::WriteColorsDXT3(u32 *dst, const DXT3Block *src, int pitch, int
566566

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

571571
for (int y = 0; y < height; y++) {
572-
int colordata = src->color.lines[y];
572+
uint32_t colordata = src->color.lines[y];
573+
uint32_t alphadata = allAlpha >> (12 * y);
573574
for (int x = 0; x < width; x++) {
574575
dst[x] = colors_[colordata & 3] | (alpha_[alphadata & 7] << 24);
575576
colordata >>= 2;

assets/compat.ini

+7
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,13 @@ UCKS45124 = true
13511351
UCJS10104 = true
13521352
NPJG00047 = true
13531353

1354+
# Tiger Woods 06 - bloom during rain
1355+
ULUS10028 = true
1356+
ULES00153 = true
1357+
ULES00154 = true
1358+
ULJM05059 = true
1359+
ULAS42020 = true
1360+
13541361
[ForceLowerResolutionForEffectsOff]
13551362
# Some games really don't work with this. Ratchet & Clank looks terrible.
13561363
UCUS98633 = true

0 commit comments

Comments
 (0)