mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-28 09:15:28 +03:00
Fix incorrect swizzling Y extent calculation
This calculation for the amount of lines on the Y axis relative to the start of the last block was wrong and would instead determine the amount of lines to the last Y-axis GOB which wasn't accurate when padding was considered, this resulted in titles like Celeste having broken texture decoding (on a 1922x1082 texture) for the last ROB as most pixels would be masked out.
This commit is contained in:
parent
018df355f0
commit
56c9b03843
@ -99,9 +99,9 @@ namespace skyline::gpu::texture {
|
||||
}
|
||||
|
||||
if (surfaceHeightLines % robHeight != 0) {
|
||||
blockHeight = (util::AlignUp(surfaceHeightLines, GobHeight) - (surfaceHeightRobs * robHeight)) / GobHeight; // Calculate the amount of Y GOBs which aren't padding
|
||||
u32 surfaceHeightLinesCeil{util::DivideCeil(guest.dimensions.height, u32{guest.format->blockHeight})};
|
||||
deswizzleRob(linearRob, std::true_type{}, (guest.tileConfig.blockHeight - blockHeight) * (SectorWidth * SectorWidth * SectorHeight), surfaceHeightLinesCeil - util::AlignDown(surfaceHeightLinesCeil, GobHeight));
|
||||
u32 robOffsetLines{surfaceHeightRobs * robHeight};
|
||||
blockHeight = (util::AlignUp(surfaceHeightLines, GobHeight) - robOffsetLines) / GobHeight; // Calculate the amount of Y GOBs which aren't padding
|
||||
deswizzleRob(linearRob, std::true_type{}, (guest.tileConfig.blockHeight - blockHeight) * (SectorWidth * SectorWidth * SectorHeight), util::DivideCeil(guest.dimensions.height, u32{guest.format->blockHeight}) - robOffsetLines);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user