summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-28 10:57:56 -0400
committerGravatar Lioncash2018-08-28 11:11:50 -0400
commit45fb74d2623182b38af422bc6c8a51040860143f (patch)
treead65e21b3984d876241fc478d7624abfceb55e86 /src/core/memory.cpp
parentMerge pull request #1165 from bunnei/shader-cache (diff)
downloadyuzu-45fb74d2623182b38af422bc6c8a51040860143f.tar.gz
yuzu-45fb74d2623182b38af422bc6c8a51040860143f.tar.xz
yuzu-45fb74d2623182b38af422bc6c8a51040860143f.zip
gpu: Make memory_manager private
Makes the class interface consistent and provides accessors for obtaining a reference to the memory manager instance. Given we also return references, this makes our more flimsy uses of const apparent, given const doesn't propagate through pointers in the way one would typically expect. This makes our mutable state more apparent in some places.
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 1133bcbaf..bc34bfd6d 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -264,7 +264,7 @@ void RasterizerMarkRegionCached(Tegra::GPUVAddr gpu_addr, u64 size, bool cached)
264 u64 num_pages = ((gpu_addr + size - 1) >> PAGE_BITS) - (gpu_addr >> PAGE_BITS) + 1; 264 u64 num_pages = ((gpu_addr + size - 1) >> PAGE_BITS) - (gpu_addr >> PAGE_BITS) + 1;
265 for (unsigned i = 0; i < num_pages; ++i, gpu_addr += PAGE_SIZE) { 265 for (unsigned i = 0; i < num_pages; ++i, gpu_addr += PAGE_SIZE) {
266 boost::optional<VAddr> maybe_vaddr = 266 boost::optional<VAddr> maybe_vaddr =
267 Core::System::GetInstance().GPU().memory_manager->GpuToCpuAddress(gpu_addr); 267 Core::System::GetInstance().GPU().MemoryManager().GpuToCpuAddress(gpu_addr);
268 // The GPU <-> CPU virtual memory mapping is not 1:1 268 // The GPU <-> CPU virtual memory mapping is not 1:1
269 if (!maybe_vaddr) { 269 if (!maybe_vaddr) {
270 LOG_ERROR(HW_Memory, 270 LOG_ERROR(HW_Memory,
@@ -346,7 +346,7 @@ void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode) {
346 const VAddr overlap_end = std::min(end, region_end); 346 const VAddr overlap_end = std::min(end, region_end);
347 347
348 const std::vector<Tegra::GPUVAddr> gpu_addresses = 348 const std::vector<Tegra::GPUVAddr> gpu_addresses =
349 system_instance.GPU().memory_manager->CpuToGpuAddress(overlap_start); 349 system_instance.GPU().MemoryManager().CpuToGpuAddress(overlap_start);
350 350
351 if (gpu_addresses.empty()) { 351 if (gpu_addresses.empty()) {
352 return; 352 return;