memory_manager: Allow GpuToCpuAddress to return a zero address.
- Rationale: It's up to the caller to handle this or assert.
This commit is contained in:
@@ -100,9 +100,10 @@ boost::optional<GPUVAddr> MemoryManager::FindFreeBlock(u64 size, u64 align) {
|
||||
|
||||
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)) {
|
||||
switch (static_cast<PageStatus>(base_addr)) {
|
||||
case PageStatus::Unmapped:
|
||||
case PageStatus::Allocated:
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user