aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/gpu.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-28 10:57:56 -0400
committerLioncash <mathew1800@gmail.com>2018-08-28 11:11:50 -0400
commit45fb74d2623182b38af422bc6c8a51040860143f (patch)
treead65e21b3984d876241fc478d7624abfceb55e86 /src/video_core/gpu.cpp
parentffe2336136dc683b8d97a355c2446aad2aaa5905 (diff)
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.cpp')
-rw-r--r--src/video_core/gpu.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 9758adcfd7..e6d8e65c61 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -22,7 +22,7 @@ u32 FramebufferConfig::BytesPerPixel(PixelFormat format) {
}
GPU::GPU(VideoCore::RasterizerInterface& rasterizer) {
- memory_manager = std::make_unique<MemoryManager>();
+ memory_manager = std::make_unique<Tegra::MemoryManager>();
maxwell_3d = std::make_unique<Engines::Maxwell3D>(rasterizer, *memory_manager);
fermi_2d = std::make_unique<Engines::Fermi2D>(*memory_manager);
maxwell_compute = std::make_unique<Engines::MaxwellCompute>();
@@ -31,14 +31,22 @@ GPU::GPU(VideoCore::RasterizerInterface& rasterizer) {
GPU::~GPU() = default;
-const Engines::Maxwell3D& GPU::Maxwell3D() const {
+Engines::Maxwell3D& GPU::Maxwell3D() {
return *maxwell_3d;
}
-Engines::Maxwell3D& GPU::Maxwell3D() {
+const Engines::Maxwell3D& GPU::Maxwell3D() const {
return *maxwell_3d;
}
+MemoryManager& GPU::MemoryManager() {
+ return *memory_manager;
+}
+
+const MemoryManager& GPU::MemoryManager() const {
+ return *memory_manager;
+}
+
u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
ASSERT(format != RenderTargetFormat::NONE);