mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
Memory Manager: ensure safety of GPU to CPU address.
This commit is contained in:
parent
5a568b1655
commit
7cfa28a666
1 changed files with 3 additions and 0 deletions
|
@ -193,6 +193,9 @@ void MemoryManager::Unmap(GPUVAddr gpu_addr, std::size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) const {
|
std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) const {
|
||||||
|
if (gpu_addr >= address_space_size) [[unlikely]] {
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
if (GetEntry<true>(gpu_addr) != EntryType::Mapped) [[unlikely]] {
|
if (GetEntry<true>(gpu_addr) != EntryType::Mapped) [[unlikely]] {
|
||||||
if (GetEntry<false>(gpu_addr) != EntryType::Mapped) {
|
if (GetEntry<false>(gpu_addr) != EntryType::Mapped) {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
|
Loading…
Reference in a new issue