GS/HW: Don't allow region textures to make sources larger

Currently not handled. Fixes Ridge Racer V intro again.
This commit is contained in:
Stenzek 2023-02-20 20:58:21 +10:00 committed by refractionpcsx2
parent 39fb64cdcd
commit 0c9f44d8a4
1 changed files with 2 additions and 2 deletions

View File

@ -299,7 +299,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
// to offset the actual texture data to elsewhere. So, we'll just force any cases like this down
// the region texture path.
const u32 rw = ((CLAMP.MINU | CLAMP.MAXU) - CLAMP.MAXU) + 1;
if (rw < (1u << TEX0.TW) || CLAMP.MAXU != 0)
if (rw < (1u << TEX0.TW) || (CLAMP.MAXU != 0 && (rw <= (1u << TEX0.TW))))
{
region.SetX(CLAMP.MAXU, (CLAMP.MINU | CLAMP.MAXU) + 1);
GL_CACHE("TC: Region repeat optimization: %d width -> %d", 1 << TEX0.TW, region.GetWidth());
@ -317,7 +317,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
else if (CLAMP.WMT == CLAMP_REGION_REPEAT && CLAMP.MINV != 0)
{
const u32 rh = ((CLAMP.MINV | CLAMP.MAXV) - CLAMP.MAXV) + 1;
if (rh < (1u << TEX0.TH) || CLAMP.MAXV != 0)
if (rh < (1u << TEX0.TH) || (CLAMP.MAXV != 0 && (rh <= (1u << TEX0.TH))))
{
region.SetY(CLAMP.MAXV, (CLAMP.MINV | CLAMP.MAXV) + 1);
GL_CACHE("TC: Region repeat optimization: %d height -> %d", 1 << TEX0.TW, region.GetHeight());