mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-25 21:54:17 +01:00
Fix swizzling regression + minor optimizations to swizzling
This commit is contained in:
parent
3e1db818cf
commit
444e35e34f
@ -177,17 +177,14 @@ namespace skyline::gpu::texture {
|
||||
|
||||
if (hasPaddingBlock)
|
||||
deswizzleBlock(pitchRob, [&](u8 *linearSector, size_t xT) __attribute__((always_inline)) {
|
||||
#pragma clang loop unroll_count(4)
|
||||
for (size_t pixelOffset{}; pixelOffset < SectorWidth; pixelOffset += formatBpb) {
|
||||
if (xT < blockPaddingOffset) {
|
||||
if constexpr (BlockLinearToPitch)
|
||||
std::memcpy(linearSector + pixelOffset, sector, formatBpb);
|
||||
else
|
||||
std::memcpy(sector, linearSector + pixelOffset, formatBpb);
|
||||
}
|
||||
xT += formatBpb;
|
||||
}
|
||||
if (xT < blockPaddingOffset) {
|
||||
size_t copyAmount{std::min<size_t>(blockPaddingOffset - xT, SectorWidth)};
|
||||
|
||||
if constexpr (BlockLinearToPitch)
|
||||
std::memcpy(linearSector, sector, copyAmount);
|
||||
else
|
||||
std::memcpy(sector, linearSector, copyAmount);
|
||||
}
|
||||
sector += SectorWidth;
|
||||
});
|
||||
}};
|
||||
|
Loading…
Reference in New Issue
Block a user