gsdx: allow to control the filtering of texture cache

When the RT is used as an input texture, we need to rescale it.

Previous behavior was to always uses a linear filtering (more smooth).
Unfortunately it broke some games that expected an exact value like Star Ocean 3

This commit will disable the linear filtering in normal filtering mode (filter = 0
or filter = 2)

This way, shadow of Star Ocean 3 will appear correctly in upscaling (not
100% perfect but can't do better)

Note: SO3 only requires a nearest sampling of the alpha channel but
I don't know the behavior for others games.
This commit is contained in:
Gregory Hainaut 2015-05-24 18:59:27 +02:00
parent b0af54d33e
commit 11708486d8
3 changed files with 5 additions and 2 deletions

View File

@ -205,7 +205,7 @@ public:
"\tFBP (*32):0x%x\n"
"\tFBW:%d\n"
"\tPSM:0x%x\n"
"\tFBMSK:%d\n\n"
"\tFBMSK:0x%x\n\n"
, FRAME.FBP*32, FRAME.FBW, FRAME.PSM, FRAME.FBMSK);
fprintf(fp, "ZBUF\n"
"\tZBP (*32):0x%x\n"

View File

@ -30,6 +30,7 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
UserHacks_HalfPixelOffset = !!theApp.GetConfig("UserHacks", 0) && !!theApp.GetConfig("UserHacks_HalfPixelOffset", 0);
UserHacks_NVIDIAHack = !!theApp.GetConfig("UserHacks_NVIDIAHack", 0) && !!theApp.GetConfig("UserHacks", 0);
m_paltex = !!theApp.GetConfig("paltex", 0);
m_filter = theApp.GetConfig("filter", 2);
m_temp = (uint8*)_aligned_malloc(1024 * 1024 * sizeof(uint32), 32);
}
@ -772,7 +773,8 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
sRect.z /= sTex->GetWidth();
sRect.w /= sTex->GetHeight();
m_renderer->m_dev->StretchRect(sTex, sRect, dTex, dRect);
// Note linear filtering can break some games (like star ocean 3)
m_renderer->m_dev->StretchRect(sTex, sRect, dTex, dRect, 0, (m_filter == 1));
}
if(dTex != src->m_texture)

View File

@ -109,6 +109,7 @@ protected:
list<Target*> m_dst[2];
bool m_paltex;
int m_spritehack;
int m_filter;
uint8* m_temp;
virtual Source* CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* t = NULL);