Skip to content

Commit

Permalink
GS: Avoid pointlessly trying to map more pages in memory than the GS has
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Jun 24, 2024
1 parent 7e53cb8 commit fc4bdfd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pcsx2/GS/GSLocalMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit fc4bdfd

Please sign in to comment.