mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2025-07-03 05:30:47 -07: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