mirror of
https://git.zaroz.cloud/nintendo-back-up/yuzu/yuzu-mainline.git
synced 2025-12-14 00:12:40 +00:00
memory_manager: Make GpuToCpuAddress return an optional.
This commit is contained in:
@@ -73,9 +73,14 @@ boost::optional<GPUVAddr> MemoryManager::FindFreeBlock(u64 size, u64 align) {
|
||||
return {};
|
||||
}
|
||||
|
||||
VAddr MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) {
|
||||
boost::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) {
|
||||
VAddr base_addr = PageSlot(gpu_addr);
|
||||
ASSERT(base_addr != static_cast<u64>(PageStatus::Unmapped));
|
||||
|
||||
if (base_addr == static_cast<u64>(PageStatus::Allocated)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return base_addr + (gpu_addr & PAGE_MASK);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user