diff options
| author | 2017-01-06 01:19:06 -0200 | |
|---|---|---|
| committer | 2017-02-04 12:33:25 -0800 | |
| commit | 09a750e8662e5d4d608177fdfb69b398c3202cd6 (patch) | |
| tree | 6d5b6af7cd77de75406516eb41eda42f2c963f4a /src/citra_qt/debugger/graphics/graphics_surface.cpp | |
| parent | VideoCore: Move LookupTexture out of debug_utils.h (diff) | |
| download | yuzu-09a750e8662e5d4d608177fdfb69b398c3202cd6.tar.gz yuzu-09a750e8662e5d4d608177fdfb69b398c3202cd6.tar.xz yuzu-09a750e8662e5d4d608177fdfb69b398c3202cd6.zip | |
Pica/Texture: Simplify/cleanup texture tile addressing
Diffstat (limited to 'src/citra_qt/debugger/graphics/graphics_surface.cpp')
| -rw-r--r-- | src/citra_qt/debugger/graphics/graphics_surface.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp index c0a72a6ef..bd82b00d4 100644 --- a/src/citra_qt/debugger/graphics/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp | |||
| @@ -568,19 +568,14 @@ void GraphicsSurfaceWidget::OnUpdate() { | |||
| 568 | 568 | ||
| 569 | surface_picture_label->show(); | 569 | surface_picture_label->show(); |
| 570 | 570 | ||
| 571 | unsigned nibbles_per_pixel = GraphicsSurfaceWidget::NibblesPerPixel(surface_format); | ||
| 572 | unsigned stride = nibbles_per_pixel * surface_width / 2; | ||
| 573 | |||
| 574 | // We handle depth formats here because DebugUtils only supports TextureFormats | ||
| 575 | if (surface_format <= Format::MaxTextureFormat) { | 571 | if (surface_format <= Format::MaxTextureFormat) { |
| 576 | |||
| 577 | // Generate a virtual texture | 572 | // Generate a virtual texture |
| 578 | Pica::Texture::TextureInfo info; | 573 | Pica::Texture::TextureInfo info; |
| 579 | info.physical_address = surface_address; | 574 | info.physical_address = surface_address; |
| 580 | info.width = surface_width; | 575 | info.width = surface_width; |
| 581 | info.height = surface_height; | 576 | info.height = surface_height; |
| 582 | info.format = static_cast<Pica::Regs::TextureFormat>(surface_format); | 577 | info.format = static_cast<Pica::Regs::TextureFormat>(surface_format); |
| 583 | info.stride = stride; | 578 | info.SetDefaultStride(); |
| 584 | 579 | ||
| 585 | for (unsigned int y = 0; y < surface_height; ++y) { | 580 | for (unsigned int y = 0; y < surface_height; ++y) { |
| 586 | for (unsigned int x = 0; x < surface_width; ++x) { | 581 | for (unsigned int x = 0; x < surface_width; ++x) { |
| @@ -588,8 +583,12 @@ void GraphicsSurfaceWidget::OnUpdate() { | |||
| 588 | decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a())); | 583 | decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a())); |
| 589 | } | 584 | } |
| 590 | } | 585 | } |
| 591 | |||
| 592 | } else { | 586 | } else { |
| 587 | // We handle depth formats here because DebugUtils only supports TextureFormats | ||
| 588 | |||
| 589 | // TODO(yuriks): Convert to newer tile-based addressing | ||
| 590 | unsigned nibbles_per_pixel = GraphicsSurfaceWidget::NibblesPerPixel(surface_format); | ||
| 591 | unsigned stride = nibbles_per_pixel * surface_width / 2; | ||
| 593 | 592 | ||
| 594 | ASSERT_MSG(nibbles_per_pixel >= 2, | 593 | ASSERT_MSG(nibbles_per_pixel >= 2, |
| 595 | "Depth decoder only supports formats with at least one byte per pixel"); | 594 | "Depth decoder only supports formats with at least one byte per pixel"); |