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/yuzu/debugger/graphics/graphics_surface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/yuzu/debugger') diff --git a/src/yuzu/debugger/graphics/graphics_surface.cpp b/src/yuzu/debugger/graphics/graphics_surface.cpp index 2b20cf5b9..7e37962d5 100644 --- a/src/yuzu/debugger/graphics/graphics_surface.cpp +++ b/src/yuzu/debugger/graphics/graphics_surface.cpp @@ -382,7 +382,7 @@ void GraphicsSurfaceWidget::OnUpdate() { // TODO: Implement a good way to visualize alpha components! QImage decoded_image(surface_width, surface_height, QImage::Format_ARGB32); - boost::optional address = gpu.memory_manager->GpuToCpuAddress(surface_address); + boost::optional address = gpu.MemoryManager().GpuToCpuAddress(surface_address); // TODO(bunnei): Will not work with BCn formats that swizzle 4x4 tiles. // Needs to be fixed if we plan to use this feature more, otherwise we may remove it. @@ -443,7 +443,7 @@ void GraphicsSurfaceWidget::SaveSurface() { pixmap->save(&file, "PNG"); } else if (selectedFilter == bin_filter) { auto& gpu = Core::System::GetInstance().GPU(); - boost::optional address = gpu.memory_manager->GpuToCpuAddress(surface_address); + boost::optional address = gpu.MemoryManager().GpuToCpuAddress(surface_address); const u8* buffer = Memory::GetPointer(*address); ASSERT_MSG(buffer != nullptr, "Memory not accessible"); -- cgit v1.2.3