GS: Support wrapping off-the-end offsets in GSOffset

This commit is contained in:
TellowKrinkle 2022-01-09 19:59:41 -06:00 committed by refractionpcsx2
parent 074ffacf9d
commit 283dcaffe2
2 changed files with 4 additions and 4 deletions

View File

@ -320,9 +320,9 @@ constexpr GSSizedPixelRowOffsetTable<BlocksWide * ColWidth> makeRowOffsetTable(c
{
int base = pxOffset(blockTable, colTable, 0, y);
GSSizedPixelRowOffsetTable<BlocksWide * ColWidth> table = {};
for (int x = 0; x < 2048; x++)
for (size_t x = 0; x < std::size(table.value); x++)
{
table.value[x] = pxOffset(blockTable, colTable, x, y) - base;
table.value[x] = pxOffset(blockTable, colTable, x % 2048, y) - base;
}
return table;
}

View File

@ -50,11 +50,11 @@ struct alignas(128) GSPixelColOffsetTable
/// Unlike ColOffsets, this table stretches to the maximum size of a texture so no masking is needed
struct alignas(128) GSPixelRowOffsetTable
{
int value[2048] = {};
int value[4096] = {};
int operator[](size_t x) const
{
ASSERT(x < 2048);
ASSERT(x < 4096);
return value[x];
}
};