TextureCLUTInShader: Build the CLUT texture from the raw CLUT

The GLES texture cache keeps 16-bit CLUTs in clutBuf_ converted to its own
component order, and GetClutTexture converted them again, so Fushigi no
Dungeon 4's tiles came out black on OpenGL. The framebuffer depal path
already passed clutBufRaw_.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-08 10:36:18 +02:00
1 parent e30d67946a
commit b40c8a0197
1 file changed
+2 -1
+2 -1
View File
@@ -975,7 +975,8 @@ TextureApplyResult TextureCacheCommon::ApplyTextureFinish(TexCacheEntry *entry,
if (entry->status & TexStatus::CLUT8_INDEXED) {
bool smoothedDepal = false;
u32 depthUpperBits = 0;
ClutTexture clutTexture = clutTextureCache_.GetClutTexture(gstate.getClutPaletteFormat(), clutHash_, clutBuf_);
// The raw CLUT: GetClutTexture converts it itself, and the GLES backend's clutBuf_ is already converted to its order.
ClutTexture clutTexture = clutTextureCache_.GetClutTexture(gstate.getClutPaletteFormat(), clutHash_, clutBufRaw_);
BindAsClutTexture(clutTexture.texture, false);
gstate_c.SetShaderDepal(ShaderDepalMode::NORMAL, GE_FORMAT_CLUT8);
} else {