From b4a81f9bca87a8537a15bea5cee003c9aae23999 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 28 Aug 2018 10:57:56 -0400 Subject: 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. --- src/core/memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/memory.cpp') diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 1133bcbaf0..bc34bfd6d3 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) u64 num_pages = ((gpu_addr + size - 1) >> PAGE_BITS) - (gpu_addr >> PAGE_BITS) + 1; for (unsigned i = 0; i < num_pages; ++i, gpu_addr += PAGE_SIZE) { boost::optional maybe_vaddr = - Core::System::GetInstance().GPU().memory_manager->GpuToCpuAddress(gpu_addr); + Core::System::GetInstance().GPU().MemoryManager().GpuToCpuAddress(gpu_addr); // The GPU <-> CPU virtual memory mapping is not 1:1 if (!maybe_vaddr) { LOG_ERROR(HW_Memory, @@ -346,7 +346,7 @@ void RasterizerFlushVirtualRegion(VAddr start, u64 size, FlushMode mode) { const VAddr overlap_end = std::min(end, region_end); const std::vector gpu_addresses = - system_instance.GPU().memory_manager->CpuToGpuAddress(overlap_start); + system_instance.GPU().MemoryManager().CpuToGpuAddress(overlap_start); if (gpu_addresses.empty()) { return; -- cgit v1.2.3