summaryrefslogtreecommitdiff
path: root/src/yuzu/debugger/graphics/graphics_surface.cpp
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2018-04-26 14:28:54 -0700
committerDavid Marcec <dmarcecguzman@gmail.com>2018-04-26 14:28:54 -0700
commit7391741a204d6f25a06132eda214b2199b60a084 (patch)
treeaeeb723744c4563ad608361b82dd938b062a3e09 /src/yuzu/debugger/graphics/graphics_surface.cpp
parentf1f7f2cba93631c67dfd8767f69a2a23a6edcf23 (diff)
parent4ac9b47dca0ecb450c51a521fec22f4e62021156 (diff)
Merge branch 'master' of https://github.com/yuzu-emu/yuzu into service-impl
Diffstat (limited to 'src/yuzu/debugger/graphics/graphics_surface.cpp')
-rw-r--r--src/yuzu/debugger/graphics/graphics_surface.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/yuzu/debugger/graphics/graphics_surface.cpp b/src/yuzu/debugger/graphics/graphics_surface.cpp
index 1e4844b57..1fbca8ad0 100644
--- a/src/yuzu/debugger/graphics/graphics_surface.cpp
+++ b/src/yuzu/debugger/graphics/graphics_surface.cpp
@@ -25,6 +25,8 @@ static Tegra::Texture::TextureFormat ConvertToTextureFormat(
switch (render_target_format) {
case Tegra::RenderTargetFormat::RGBA8_UNORM:
return Tegra::Texture::TextureFormat::A8R8G8B8;
+ case Tegra::RenderTargetFormat::RGB10_A2_UNORM:
+ return Tegra::Texture::TextureFormat::A2B10G10R10;
default:
UNIMPLEMENTED_MSG("Unimplemented RT format");
}
@@ -376,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->PhysicalToVirtualAddress(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);
@@ -435,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->PhysicalToVirtualAddress(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);