diff options
author | Michael Scire <SciresM@gmail.com> | 2019-07-09 08:17:44 +0200 |
---|---|---|
committer | Michael Scire <SciresM@gmail.com> | 2019-07-09 17:11:35 +0200 |
commit | a1845d1dd3e6b03159c66e0c925688c98e373956 (patch) | |
tree | 015775a2c7425f1417c239f429db676216f828a4 /src/video_core/memory_manager.cpp | |
parent | Prevent merging of device mapped memory blocks. (diff) | |
download | yuzu-a1845d1dd3e6b03159c66e0c925688c98e373956.tar yuzu-a1845d1dd3e6b03159c66e0c925688c98e373956.tar.gz yuzu-a1845d1dd3e6b03159c66e0c925688c98e373956.tar.bz2 yuzu-a1845d1dd3e6b03159c66e0c925688c98e373956.tar.lz yuzu-a1845d1dd3e6b03159c66e0c925688c98e373956.tar.xz yuzu-a1845d1dd3e6b03159c66e0c925688c98e373956.tar.zst yuzu-a1845d1dd3e6b03159c66e0c925688c98e373956.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/memory_manager.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 3a158fa26..bffae940c 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -14,7 +14,8 @@ namespace Tegra { -MemoryManager::MemoryManager(VideoCore::RasterizerInterface& rasterizer) : rasterizer{rasterizer} { +MemoryManager::MemoryManager(Core::System& system, VideoCore::RasterizerInterface& rasterizer) + : rasterizer{rasterizer}, system{system} { std::fill(page_table.pointers.begin(), page_table.pointers.end(), nullptr); std::fill(page_table.attributes.begin(), page_table.attributes.end(), Common::PageType::Unmapped); @@ -52,8 +53,7 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, u64 size) { const GPUVAddr gpu_addr{FindFreeRegion(address_space_base, aligned_size)}; MapBackingMemory(gpu_addr, Memory::GetPointer(cpu_addr), aligned_size, cpu_addr); - ASSERT(Core::System::GetInstance() - .CurrentProcess() + ASSERT(system.CurrentProcess() ->VMManager() .SetMemoryAttribute(cpu_addr, size, Kernel::MemoryAttribute::DeviceMapped, Kernel::MemoryAttribute::DeviceMapped) @@ -68,8 +68,7 @@ GPUVAddr MemoryManager::MapBufferEx(VAddr cpu_addr, GPUVAddr gpu_addr, u64 size) const u64 aligned_size{Common::AlignUp(size, page_size)}; MapBackingMemory(gpu_addr, Memory::GetPointer(cpu_addr), aligned_size, cpu_addr); - ASSERT(Core::System::GetInstance() - .CurrentProcess() + ASSERT(system.CurrentProcess() ->VMManager() .SetMemoryAttribute(cpu_addr, size, Kernel::MemoryAttribute::DeviceMapped, Kernel::MemoryAttribute::DeviceMapped) @@ -87,8 +86,7 @@ GPUVAddr MemoryManager::UnmapBuffer(GPUVAddr gpu_addr, u64 size) { rasterizer.FlushAndInvalidateRegion(cache_addr, aligned_size); UnmapRange(gpu_addr, aligned_size); - ASSERT(Core::System::GetInstance() - .CurrentProcess() + ASSERT(system.CurrentProcess() ->VMManager() .SetMemoryAttribute(cpu_addr.value(), size, Kernel::MemoryAttribute::DeviceMapped, Kernel::MemoryAttribute::None) |