summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.h
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/video_core/gpu.h
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/video_core/gpu.h')
-rw-r--r--src/video_core/gpu.h12
1 files changed, 9 insertions, 3 deletions
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:
117 /// Processes a command list stored at the specified address in GPU memory. 117 /// Processes a command list stored at the specified address in GPU memory.
118 void ProcessCommandList(GPUVAddr address, u32 size); 118 void ProcessCommandList(GPUVAddr address, u32 size);
119 119
120 /// Returns a reference to the Maxwell3D GPU engine.
121 Engines::Maxwell3D& Maxwell3D();
122
120 /// Returns a const reference to the Maxwell3D GPU engine. 123 /// Returns a const reference to the Maxwell3D GPU engine.
121 const Engines::Maxwell3D& Maxwell3D() const; 124 const Engines::Maxwell3D& Maxwell3D() const;
122 125
123 /// Returns a reference to the Maxwell3D GPU engine. 126 /// Returns a reference to the GPU memory manager.
124 Engines::Maxwell3D& Maxwell3D(); 127 Tegra::MemoryManager& MemoryManager();
125 128
126 std::unique_ptr<MemoryManager> memory_manager; 129 /// Returns a const reference to the GPU memory manager.
130 const Tegra::MemoryManager& MemoryManager() const;
127 131
128private: 132private:
129 /// Writes a single register in the engine bound to the specified subchannel 133 /// Writes a single register in the engine bound to the specified subchannel
130 void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params); 134 void WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params);
131 135
136 std::unique_ptr<Tegra::MemoryManager> memory_manager;
137
132 /// Mapping of command subchannels to their bound engine ids. 138 /// Mapping of command subchannels to their bound engine ids.
133 std::unordered_map<u32, EngineID> bound_engines; 139 std::unordered_map<u32, EngineID> bound_engines;
134 140