From 87f54ae0ffa517e41374e970a8966a282726f31e Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 20 Jun 2015 16:19:02 +0200 Subject: [PATCH] gsdx: report error on unsupported case in texture cache It seems to impacts lots of games that still have issue (VP2, MTG3, PoP) The PSMT32 format is read a PSMT8. I think we need to convert it as PSMT8H (i.e. unpack it to have only an alpha channel) --- plugins/GSdx/GSTextureCache.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 6985d0a581..6dc1c8f63d 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -183,9 +183,9 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con #ifdef ENABLE_OGL_DEBUG } else { - GL_CACHE("TC: src hit: %d (0x%x)", + GL_CACHE("TC: src hit: %d (0x%x F:0x%x)", src->m_texture ? src->m_texture->GetID() : 0, - TEX0.TBP0); + TEX0.TBP0, TEX0.PSM); #endif } @@ -748,8 +748,14 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con if (dst) { // TODO: clean up this mess - src->m_32_bits_fmt = dst->m_32_bits_fmt; +#ifdef ENABLE_OGL_DEBUG + if (TEX0.PSM == PSM_PSMT8 || TEX0.PSM == PSM_PSMT4) { + GL_INS("ERROR: Reading RT as a packed-indexed (0x%x) format is not supported", TEX0.PSM); + } +#endif + + src->m_32_bits_fmt = dst->m_32_bits_fmt; src->m_target = true; dst->Update();