mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-29 14:34:18 +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)
|
if (hasPaddingBlock)
|
||||||
deswizzleBlock(pitchRob, [&](u8 *linearSector, size_t xT) __attribute__((always_inline)) {
|
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 (xT < blockPaddingOffset) {
|
||||||
if constexpr (BlockLinearToPitch)
|
size_t copyAmount{std::min<size_t>(blockPaddingOffset - xT, SectorWidth)};
|
||||||
std::memcpy(linearSector + pixelOffset, sector, formatBpb);
|
|
||||||
else
|
|
||||||
std::memcpy(sector, linearSector + pixelOffset, formatBpb);
|
|
||||||
}
|
|
||||||
xT += formatBpb;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if constexpr (BlockLinearToPitch)
|
||||||
|
std::memcpy(linearSector, sector, copyAmount);
|
||||||
|
else
|
||||||
|
std::memcpy(sector, linearSector, copyAmount);
|
||||||
|
}
|
||||||
sector += SectorWidth;
|
sector += SectorWidth;
|
||||||
});
|
});
|
||||||
}};
|
}};
|
||||||
|
Loading…
Reference in New Issue
Block a user