diff options
author | Michael Scire <SciresM@gmail.com> | 2019-07-08 22:19:27 -0700 |
---|---|---|
committer | Michael Scire <SciresM@gmail.com> | 2019-07-08 22:52:05 -0700 |
commit | 697206092e8ac28c7dfe83eff0eea6613082740c (patch) | |
tree | 587b19d4fbf727a88524fefff496c2c12d9f7f97 /src/core | |
parent | ca6f08e3b1df011075bf4564bbb61d4cdf9a7737 (diff) |
Prevent merging of device mapped memory blocks.
This sets the DeviceMapped attribute for GPU-mapped memory blocks,
and prevents merging device mapped blocks. This prevents memory
mapped from the gpu from having its backing address changed by
block coalesce.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 775d170bf..72a9d7717 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -51,6 +51,11 @@ bool VirtualMemoryArea::CanBeMergedWith(const VirtualMemoryArea& next) const { type != next.type) { return false; } + if ((attribute & MemoryAttribute::DeviceMapped) == MemoryAttribute::DeviceMapped) { + // TODO: Can device mapped memory be merged sanely? + // Not merging it may cause inaccuracies versus hardware when memory layout is queried. + return false; + } if (type == VMAType::AllocatedMemoryBlock) { return true; } |