Skip to content

Commit 2494176

Browse files
Remove incorrect CLUT4 optimization.
1 parent 959015f commit 2494176

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

GPU/Directx9/TextureCacheDX9.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -695,13 +695,8 @@ void TextureCacheDX9::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase
695695
clutAlphaLinear_ = true;
696696
clutAlphaLinearColor_ = clut[15] & 0x0FFF;
697697
for (int i = 0; i < 16; ++i) {
698-
if ((clut[i] >> 12) != i) {
699-
clutAlphaLinear_ = false;
700-
break;
701-
}
702-
// Alpha 0 doesn't matter.
703-
// TODO: Well, depending on blend mode etc, it can actually matter, although unlikely.
704-
if (i != 0 && (clut[i] >> 12) != clutAlphaLinearColor_) {
698+
u16 step = clutAlphaLinearColor_ | (i << 12);
699+
if (clut[i] != step) {
705700
clutAlphaLinear_ = false;
706701
break;
707702
}

GPU/GLES/TextureCache.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -729,13 +729,8 @@ void TextureCache::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, b
729729
clutAlphaLinear_ = true;
730730
clutAlphaLinearColor_ = clut[15] & 0xFFF0;
731731
for (int i = 0; i < 16; ++i) {
732-
if ((clut[i] & 0xf) != i) {
733-
clutAlphaLinear_ = false;
734-
break;
735-
}
736-
// Alpha 0 doesn't matter.
737-
// TODO: Well, depending on blend mode etc, it can actually matter, although unlikely.
738-
if (i != 0 && (clut[i] & 0xFFF0) != clutAlphaLinearColor_) {
732+
u16 step = clutAlphaLinearColor_ | i;
733+
if (clut[i] != step) {
739734
clutAlphaLinear_ = false;
740735
break;
741736
}

0 commit comments

Comments
 (0)