Avoid using interconnect for texture data copies

Since the interonnect copies aren't visible or tracked by texture manager, this could cause the texture manager to effectively miss the upload.
This commit is contained in:
Billy Laws 2023-04-05 15:09:08 +01:00
parent 4192873744
commit 9caa845d4f
2 changed files with 6 additions and 5 deletions

View File

@ -62,7 +62,7 @@ namespace skyline::soc::gm20b::engine {
inlineCopy(tempBuffer.data());
interconnect.Upload(u64{state.offsetOut}, span{tempBuffer});
channelCtx.asCtx->gmmu.Write(state.offsetOut, span(tempBuffer));
} else {
inlineCopy(dstMappings.front().data());
}

View File

@ -134,11 +134,12 @@ namespace skyline::soc::gm20b::engine {
});
} else [[likely]] {
// Both Linear, copy as is.
if ((*registers.pitchIn == *registers.pitchOut) && (*registers.pitchIn == *registers.lineLengthIn))
interconnect.Copy(dstMappings.front(), srcMappings.front());
else
if ((*registers.pitchIn == *registers.pitchOut) && (*registers.pitchIn == *registers.lineLengthIn)) {
std::memcpy(dstMappings.front().data(), srcMappings.front().data(), *registers.lineLengthIn * *registers.lineCount);
} else {
for (size_t linesToCopy{*registers.lineCount}, srcCopyOffset{}, dstCopyOffset{}; linesToCopy; --linesToCopy, srcCopyOffset += *registers.pitchIn, dstCopyOffset += *registers.pitchOut)
interconnect.Copy(dstMappings.front().subspan(dstCopyOffset, u64{*registers.lineLengthIn}), srcMappings.front().subspan(srcCopyOffset, u64{*registers.lineLengthIn}));
std::memcpy(dstMappings.front().subspan(dstCopyOffset).data(), srcMappings.front().subspan(srcCopyOffset).data(), *registers.lineLengthIn);
}
}
}