GPU/TextureCache: Fix palette reduction in C4 mode

It was only looking at the first row...
This commit is contained in:
Stenzek 2024-10-01 23:01:18 +10:00
parent 51fefb36a0
commit 7e72b9fb7b
No known key found for this signature in database
1 changed files with 5 additions and 2 deletions

View File

@ -1498,9 +1498,12 @@ std::pair<u32, u32> GPUTextureCache::ReducePaletteBounds(const GSVector4i rect,
if (mode == GPUTextureMode::Palette4Bit)
{
const u16* row_ptr = &g_vram[rect.y * VRAM_WIDTH + rect.x];
for (u32 y = 0; y < rect_height; y++)
{
const u16* ptr = &g_vram[rect.y * VRAM_WIDTH + rect.x];
const u16* ptr = row_ptr;
row_ptr += VRAM_WIDTH;
for (u32 x = 0; x < rect_width; x++)
{
const u16 val = *(ptr++);
@ -1519,7 +1522,7 @@ std::pair<u32, u32> GPUTextureCache::ReducePaletteBounds(const GSVector4i rect,
const u16* row_ptr = &g_vram[rect.y * VRAM_WIDTH + rect.x];
for (u32 y = 0; y < rect_height; y++)
{
const u16* ptr = reinterpret_cast<const u16*>(row_ptr);
const u16* ptr = row_ptr;
row_ptr += VRAM_WIDTH;
if (aligned_width > 0) [[likely]]