Handle unmapped blocks in CachedMappedBufferView

This commit is contained in:
Billy Laws 2022-09-29 21:04:20 +01:00
parent 5c0e4a839d
commit 33f16ca26e

View File

@ -12,6 +12,12 @@ namespace skyline::gpu::interconnect::maxwell3d {
if (address < blockMappingStartAddr || address >= blockMappingEndAddr) {
u64 blockOffset{};
std::tie(blockMapping, blockOffset) = ctx.channelCtx.asCtx->gmmu.LookupBlock(address);
if (!blockMapping.valid()) {
view = {};
blockMappingEndAddr = 0;
return;
}
blockMappingStartAddr = address - blockOffset;
blockMappingEndAddr = blockMappingStartAddr + blockMapping.size();
}