diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index 0cffc776cc..647c4a3829 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -518,7 +518,8 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour bilinear = false; ps_sel.fmt = cpsm.fmt | 4; - ps_sel.ifmt = (context->TEX0.PSM == 0x1B) ? 3 + ps_sel.ifmt = !tex->m_alpha_palette ? 0 + : (context->TEX0.PSM == 0x1B) ? 3 : (context->TEX0.PSM == 0x24) ? 2 : (context->TEX0.PSM == 0x2C) ? 1 : 0; diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 894ea44c98..0aa827af5f 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -756,6 +756,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con bool linear = true; if (psm.pal > 0) { src->m_palette = m_renderer->m_dev->CreateTexture(256, 1); + src->m_alpha_palette = true; // Palette is used to interpret the alpha channel of the RT as an index. // Star Ocean 3 uses it to emulate a stencil buffer. // It is a very bad idea to force bilinear filtering on it. @@ -906,6 +907,7 @@ void GSTextureCache::Surface::Update() GSTextureCache::Source::Source(GSRenderer* r, const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, uint8* temp) : Surface(r, temp) , m_palette(NULL) + , m_alpha_palette(false) , m_initpalette(true) , m_target(false) , m_complete(false) diff --git a/plugins/GSdx/GSTextureCache.h b/plugins/GSdx/GSTextureCache.h index a4292acfc5..4bd5fbe629 100644 --- a/plugins/GSdx/GSTextureCache.h +++ b/plugins/GSdx/GSTextureCache.h @@ -57,6 +57,7 @@ public: public: GSTexture* m_palette; + bool m_alpha_palette; // in opengl palette value is either in red or alpha channel bool m_initpalette; uint32 m_valid[MAX_PAGES]; // each uint32 bits map to the 32 blocks of that page uint32* m_clut;