From 45fb74d2623182b38af422bc6c8a51040860143f 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/video_core/gpu.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/video_core/gpu.h') diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 2697e1c27..2c3dbd97b 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h @@ -117,18 +117,24 @@ public: /// Processes a command list stored at the specified address in GPU memory. void ProcessCommandList(GPUVAddr address, u32 size); + /// Returns a reference to the Maxwell3D GPU engine. + Engines::Maxwell3D& Maxwell3D(); + /// Returns a const reference to the Maxwell3D GPU engine. const Engines::Maxwell3D& Maxwell3D() const; - /// Returns a reference to the Maxwell3D GPU engine. - Engines::Maxwell3D& Maxwell3D(); + /// Returns a reference to the GPU memory manager. + Tegra::MemoryManager& MemoryManager(); - std::unique_ptr memory_manager; + /// Returns a const reference to the GPU memory manager. + const Tegra::MemoryManager& MemoryManager() const; private: /// Writes a single register in the engine bound to the specified subchannel void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params); + std::unique_ptr memory_manager; + /// Mapping of command subchannels to their bound engine ids. std::unordered_map bound_engines; -- cgit v1.2.3