Improve NCE and Finish Up Refactor

This commit mainly finishes up refactor by fixing everything brought up in the CR + Improving NCE somewhat and actually killing the child processes properly now.
This commit is contained in:
◱ PixelyIon
2020-04-22 22:32:27 +05:30
committed by ◱ PixelyIon
parent c76ef3730b
commit 05f3e3c3ac
68 changed files with 529 additions and 429 deletions

View File

@ -20,10 +20,10 @@ namespace skyline::gpu {
if (guest->tileMode == texture::TileMode::Block) {
// Reference on Block-linear tiling: https://gist.github.com/PixelyIon/d9c35050af0ef5690566ca9f0965bc32
constexpr auto sectorWidth = 16; // The width of a sector in bytes
constexpr auto sectorHeight = 2; // The height of a sector in lines
constexpr auto gobWidth = 64; // The width of a GOB in bytes
constexpr auto gobHeight = 8; // The height of a GOB in lines
constexpr u8 sectorWidth = 16; // The width of a sector in bytes
constexpr u8 sectorHeight = 2; // The height of a sector in lines
constexpr u8 gobWidth = 64; // The width of a GOB in bytes
constexpr u8 gobHeight = 8; // The height of a GOB in lines
auto robHeight = gobHeight * guest->tileConfig.blockHeight; // The height of a single ROB (Row of Blocks) in lines
auto surfaceHeightRobs = util::AlignUp(dimensions.height / format.blockHeight, robHeight) / robHeight; // The height of the surface in ROBs (Row Of Blocks)
@ -41,8 +41,8 @@ namespace skyline::gpu {
auto outputGob = outputBlock; // We iterate through a GOB independently of the block
for (u32 gobY = 0; gobY < guest->tileConfig.blockHeight; gobY++) { // Every Block contains `blockHeight` Y-axis GOBs
for (u32 index = 0; index < sectorWidth * sectorHeight; index++) { // Every Y-axis GOB contains `sectorWidth * sectorHeight` sectors
const u32 xT = ((index << 3) & 0b10000) | ((index << 1) & 0b100000); // Morton-Swizzle on the X-axis
const u32 yT = ((index >> 1) & 0b110) | (index & 0b1); // Morton-Swizzle on the Y-axis
u32 xT = ((index << 3) & 0b10000) | ((index << 1) & 0b100000); // Morton-Swizzle on the X-axis
u32 yT = ((index >> 1) & 0b110) | (index & 0b1); // Morton-Swizzle on the Y-axis
std::memcpy(outputGob + (yT * robWidthBytes) + xT, inputSector, sectorWidth);
inputSector += sectorWidth; // `sectorWidth` bytes are of sequential image data
}
@ -59,7 +59,7 @@ namespace skyline::gpu {
auto inputLine = texture; // The address of the input line
auto outputLine = output; // The address of the output line
for (auto line = 0; line < dimensions.height; line++) {
for (u32 line = 0; line < dimensions.height; line++) {
std::memcpy(outputLine, inputLine, sizeLine);
inputLine += sizeStride;
outputLine += sizeLine;