summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/graphics_framebuffer.cpp
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2015-04-21 22:18:58 +0200
committerGravatar Tony Wasserka2015-07-13 23:54:38 +0200
commit302e9a20f36b62e47ab95dc9b9a3d495265a2133 (patch)
tree9b0081cb9a7e35127525d079f27a794c0f73595e /src/citra_qt/debugger/graphics_framebuffer.cpp
parentcitra-qt: Properly specify the framebuffer format. (diff)
downloadyuzu-302e9a20f36b62e47ab95dc9b9a3d495265a2133.tar.gz
yuzu-302e9a20f36b62e47ab95dc9b9a3d495265a2133.tar.xz
yuzu-302e9a20f36b62e47ab95dc9b9a3d495265a2133.zip
citra-qt: Add depth formats to framebuffer viewing widget.
Diffstat (limited to 'src/citra_qt/debugger/graphics_framebuffer.cpp')
-rw-r--r--src/citra_qt/debugger/graphics_framebuffer.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp
index d9e73a46a..39eefbf75 100644
--- a/src/citra_qt/debugger/graphics_framebuffer.cpp
+++ b/src/citra_qt/debugger/graphics_framebuffer.cpp
@@ -55,7 +55,9 @@ GraphicsFramebufferWidget::GraphicsFramebufferWidget(std::shared_ptr<Pica::Debug
55 framebuffer_format_control->addItem(tr("RGBA4")); 55 framebuffer_format_control->addItem(tr("RGBA4"));
56 framebuffer_format_control->addItem(tr("D16")); 56 framebuffer_format_control->addItem(tr("D16"));
57 framebuffer_format_control->addItem(tr("D24")); 57 framebuffer_format_control->addItem(tr("D24"));
58 framebuffer_format_control->addItem(tr("D24S8")); 58 framebuffer_format_control->addItem(tr("D24X8"));
59 framebuffer_format_control->addItem(tr("X24S8"));
60 framebuffer_format_control->addItem(tr("(unknown)"));
59 61
60 // TODO: This QLabel should shrink the image to the available space rather than just expanding... 62 // TODO: This QLabel should shrink the image to the available space rather than just expanding...
61 framebuffer_picture_label = new QLabel; 63 framebuffer_picture_label = new QLabel;
@@ -221,7 +223,24 @@ void GraphicsFramebufferWidget::OnUpdate()
221 framebuffer_address = framebuffer.GetDepthBufferPhysicalAddress(); 223 framebuffer_address = framebuffer.GetDepthBufferPhysicalAddress();
222 framebuffer_width = framebuffer.GetWidth(); 224 framebuffer_width = framebuffer.GetWidth();
223 framebuffer_height = framebuffer.GetHeight(); 225 framebuffer_height = framebuffer.GetHeight();
224 framebuffer_format = Format::D16; 226
227 switch (framebuffer.depth_format) {
228 case Pica::Regs::DepthFormat::D16:
229 framebuffer_format = Format::D16;
230 break;
231
232 case Pica::Regs::DepthFormat::D24:
233 framebuffer_format = Format::D24;
234 break;
235
236 case Pica::Regs::DepthFormat::D24S8:
237 framebuffer_format = Format::D24X8;
238 break;
239
240 default:
241 framebuffer_format = Format::Unknown;
242 break;
243 }
225 244
226 break; 245 break;
227 } 246 }
@@ -282,7 +301,7 @@ void GraphicsFramebufferWidget::OnUpdate()
282 color.b() = (data >> 16) & 0xFF; 301 color.b() = (data >> 16) & 0xFF;
283 break; 302 break;
284 } 303 }
285 case Format::D24S8: 304 case Format::D24X8:
286 { 305 {
287 Math::Vec2<u32> data = Color::DecodeD24S8(pixel); 306 Math::Vec2<u32> data = Color::DecodeD24S8(pixel);
288 color.r() = data.x & 0xFF; 307 color.r() = data.x & 0xFF;
@@ -290,6 +309,12 @@ void GraphicsFramebufferWidget::OnUpdate()
290 color.b() = (data.x >> 16) & 0xFF; 309 color.b() = (data.x >> 16) & 0xFF;
291 break; 310 break;
292 } 311 }
312 case Format::X24S8:
313 {
314 Math::Vec2<u32> data = Color::DecodeD24S8(pixel);
315 color.r() = color.g() = color.b() = data.y;
316 break;
317 }
293 default: 318 default:
294 qDebug() << "Unknown fb color format " << static_cast<int>(framebuffer_format); 319 qDebug() << "Unknown fb color format " << static_cast<int>(framebuffer_format);
295 break; 320 break;
@@ -310,7 +335,8 @@ void GraphicsFramebufferWidget::OnUpdate()
310u32 GraphicsFramebufferWidget::BytesPerPixel(GraphicsFramebufferWidget::Format format) { 335u32 GraphicsFramebufferWidget::BytesPerPixel(GraphicsFramebufferWidget::Format format) {
311 switch (format) { 336 switch (format) {
312 case Format::RGBA8: 337 case Format::RGBA8:
313 case Format::D24S8: 338 case Format::D24X8:
339 case Format::X24S8:
314 return 4; 340 return 4;
315 case Format::RGB8: 341 case Format::RGB8:
316 case Format::D24: 342 case Format::D24: