mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 22:45:45 +00:00
memory_manager: Make GpuToCpuAddress return an optional.
This commit is contained in:
parent
ebef12f037
commit
b6bed8fd74
7 changed files with 37 additions and 28 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue