mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: fix paltex on opengl
RT uses as palette must use the alpha channel Palette texture uses the red channel
This commit is contained in:
parent
2f2ae2bc89
commit
d301848848
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue