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

This commit is contained in:
TellowKrinkle authored and refractionpcsx2 committed 2022-01-16 02:00:53 +00:00
1 parent 074ffacf9d
commit 283dcaffe2
2 files changed
+4 -4

No files matched your search

+2 -2
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;
}
+2 -2
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];
}
};