gsdx sw: handle the invalidation of the palette when written by the GS

Manual gives all setup to upload a palette from the host. But nothing forbid to render
directly in the palette buffer. (GS rule nb 1, there is no rule ^^)

Fix Virtua Fighter 2 dark colors

However I'm not sure we can fix HW renderer. Rendering is done on the GPU but palette
handling is done on the CPU... So we need to read back data (ouch, and slow). A quick
test didn't get the expected results. Potentially there are others bugs (aka not gonna
happen on the HW renderer)
This commit is contained in:
Gregory Hainaut 2016-09-03 00:11:56 +02:00
parent d01194da0b
commit a123e65185
3 changed files with 10 additions and 0 deletions

View File

@ -98,6 +98,13 @@ void GSClut::Invalidate()
m_write.dirty = true;
}
void GSClut::Invalidate(uint32 block)
{
if (block == m_write.TEX0.CBP) {
m_write.dirty = true;
}
}
bool GSClut::WriteTest(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT)
{
switch(TEX0.CLD)

View File

@ -103,6 +103,7 @@ public:
virtual ~GSClut();
void Invalidate();
void Invalidate(uint32 block);
bool WriteTest(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT);
void Write(const GIFRegTEX0& TEX0, const GIFRegTEXCLUT& TEXCLUT);
//void Read(const GIFRegTEX0& TEX0);

View File

@ -665,6 +665,8 @@ void GSRendererSW::Queue(shared_ptr<GSRasterizerData>& item)
if(sd->global.sel.fwrite)
{
m_tc->InvalidatePages(sd->m_fb_pages, sd->m_fpsm);
m_mem.m_clut.Invalidate(m_context->FRAME.Block());
}
if(sd->global.sel.zwrite)