summaryrefslogtreecommitdiff
path: root/src/yuzu/debugger/graphics/graphics_surface.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-04-21 12:31:30 -0400
committerbunnei <bunneidev@gmail.com>2018-04-24 17:49:19 -0400
commit239ac8abe228b9080741ba7d50d9e13cc4a1ceae (patch)
tree14b6df493ec5ff15faf2c7b71e45fe7d8ebb53df /src/yuzu/debugger/graphics/graphics_surface.cpp
parent9e11a76e926a7190880063d8fc8c3d97003b9938 (diff)
memory_manager: Make GpuToCpuAddress return an optional.
Diffstat (limited to 'src/yuzu/debugger/graphics/graphics_surface.cpp')
-rw-r--r--src/yuzu/debugger/graphics/graphics_surface.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/yuzu/debugger/graphics/graphics_surface.cpp b/src/yuzu/debugger/graphics/graphics_surface.cpp
index 5cadb807e..1fbca8ad0 100644
--- a/src/yuzu/debugger/graphics/graphics_surface.cpp
+++ b/src/yuzu/debugger/graphics/graphics_surface.cpp
@@ -378,10 +378,10 @@ void GraphicsSurfaceWidget::OnUpdate() {
// TODO: Implement a good way to visualize alpha components!
QImage decoded_image(surface_width, surface_height, QImage::Format_ARGB32);
- VAddr address = gpu.memory_manager->GpuToCpuAddress(surface_address);
+ boost::optional<VAddr> address = gpu.memory_manager->GpuToCpuAddress(surface_address);
auto unswizzled_data =
- Tegra::Texture::UnswizzleTexture(address, surface_format, surface_width, surface_height);
+ Tegra::Texture::UnswizzleTexture(*address, surface_format, surface_width, surface_height);
auto texture_data = Tegra::Texture::DecodeTexture(unswizzled_data, surface_format,
surface_width, surface_height);
@@ -437,9 +437,9 @@ void GraphicsSurfaceWidget::SaveSurface() {
pixmap->save(&file, "PNG");
} else if (selectedFilter == bin_filter) {
auto& gpu = Core::System::GetInstance().GPU();
- VAddr address = gpu.memory_manager->GpuToCpuAddress(surface_address);
+ boost::optional<VAddr> address = gpu.memory_manager->GpuToCpuAddress(surface_address);
- const u8* buffer = Memory::GetPointer(address);
+ const u8* buffer = Memory::GetPointer(*address);
ASSERT_MSG(buffer != nullptr, "Memory not accessible");
QFile file(filename);