GS: Avoid pointlessly trying to map more pages in memory than the GS has

This commit is contained in:
refractionpcsx2 2024-06-24 12:51:36 +01:00
parent 7e53cb8e99
commit fc4bdfd025
1 changed files with 7 additions and 0 deletions

View File

@ -371,6 +371,13 @@ std::vector<GSVector2i>* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0)
int tw = std::max<int>(1 << TEX0.TW, bs.x);
int th = std::max<int>(1 << TEX0.TH, bs.y);
// Limit the size to the maximum size of the GS memory, there's no point in mapping more than this.
if ((tw * th) > VM_SIZE)
{
tw = 2048;
th = 2048;
}
GSOffset off = GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM);
GSOffset::BNHelper bn = off.bnMulti(0, 0);