diff options
| author | 2017-02-08 22:07:34 -0800 | |
|---|---|---|
| committer | 2017-02-08 22:07:34 -0800 | |
| commit | 2889372e47624e368df0d0361cb38b8100f047dd (patch) | |
| tree | 183cd1cd6edb60ab566bd1fe181b712643bef30c /src/citra_qt/debugger/graphics/graphics_surface.cpp | |
| parent | Merge pull request #2539 from Kloen/re-killing-warnings (diff) | |
| parent | VideoCore: Move Regs to its own file (diff) | |
| download | yuzu-2889372e47624e368df0d0361cb38b8100f047dd.tar.gz yuzu-2889372e47624e368df0d0361cb38b8100f047dd.tar.xz yuzu-2889372e47624e368df0d0361cb38b8100f047dd.zip | |
Merge pull request #2482 from yuriks/pica-refactor
Split up monolithic Regs struct
Diffstat (limited to 'src/citra_qt/debugger/graphics/graphics_surface.cpp')
| -rw-r--r-- | src/citra_qt/debugger/graphics/graphics_surface.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp index bd82b00d4..f83c1f96c 100644 --- a/src/citra_qt/debugger/graphics/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp | |||
| @@ -16,8 +16,8 @@ | |||
| 16 | #include "common/color.h" | 16 | #include "common/color.h" |
| 17 | #include "core/hw/gpu.h" | 17 | #include "core/hw/gpu.h" |
| 18 | #include "core/memory.h" | 18 | #include "core/memory.h" |
| 19 | #include "video_core/pica.h" | ||
| 20 | #include "video_core/pica_state.h" | 19 | #include "video_core/pica_state.h" |
| 20 | #include "video_core/regs.h" | ||
| 21 | #include "video_core/texture/texture_decode.h" | 21 | #include "video_core/texture/texture_decode.h" |
| 22 | #include "video_core/utils.h" | 22 | #include "video_core/utils.h" |
| 23 | 23 | ||
| @@ -414,30 +414,30 @@ void GraphicsSurfaceWidget::OnUpdate() { | |||
| 414 | // TODO: Store a reference to the registers in the debug context instead of accessing them | 414 | // TODO: Store a reference to the registers in the debug context instead of accessing them |
| 415 | // directly... | 415 | // directly... |
| 416 | 416 | ||
| 417 | const auto& framebuffer = Pica::g_state.regs.framebuffer; | 417 | const auto& framebuffer = Pica::g_state.regs.framebuffer.framebuffer; |
| 418 | 418 | ||
| 419 | surface_address = framebuffer.GetColorBufferPhysicalAddress(); | 419 | surface_address = framebuffer.GetColorBufferPhysicalAddress(); |
| 420 | surface_width = framebuffer.GetWidth(); | 420 | surface_width = framebuffer.GetWidth(); |
| 421 | surface_height = framebuffer.GetHeight(); | 421 | surface_height = framebuffer.GetHeight(); |
| 422 | 422 | ||
| 423 | switch (framebuffer.color_format) { | 423 | switch (framebuffer.color_format) { |
| 424 | case Pica::Regs::ColorFormat::RGBA8: | 424 | case Pica::FramebufferRegs::ColorFormat::RGBA8: |
| 425 | surface_format = Format::RGBA8; | 425 | surface_format = Format::RGBA8; |
| 426 | break; | 426 | break; |
| 427 | 427 | ||
| 428 | case Pica::Regs::ColorFormat::RGB8: | 428 | case Pica::FramebufferRegs::ColorFormat::RGB8: |
| 429 | surface_format = Format::RGB8; | 429 | surface_format = Format::RGB8; |
| 430 | break; | 430 | break; |
| 431 | 431 | ||
| 432 | case Pica::Regs::ColorFormat::RGB5A1: | 432 | case Pica::FramebufferRegs::ColorFormat::RGB5A1: |
| 433 | surface_format = Format::RGB5A1; | 433 | surface_format = Format::RGB5A1; |
| 434 | break; | 434 | break; |
| 435 | 435 | ||
| 436 | case Pica::Regs::ColorFormat::RGB565: | 436 | case Pica::FramebufferRegs::ColorFormat::RGB565: |
| 437 | surface_format = Format::RGB565; | 437 | surface_format = Format::RGB565; |
| 438 | break; | 438 | break; |
| 439 | 439 | ||
| 440 | case Pica::Regs::ColorFormat::RGBA4: | 440 | case Pica::FramebufferRegs::ColorFormat::RGBA4: |
| 441 | surface_format = Format::RGBA4; | 441 | surface_format = Format::RGBA4; |
| 442 | break; | 442 | break; |
| 443 | 443 | ||
| @@ -450,22 +450,22 @@ void GraphicsSurfaceWidget::OnUpdate() { | |||
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | case Source::DepthBuffer: { | 452 | case Source::DepthBuffer: { |
| 453 | const auto& framebuffer = Pica::g_state.regs.framebuffer; | 453 | const auto& framebuffer = Pica::g_state.regs.framebuffer.framebuffer; |
| 454 | 454 | ||
| 455 | surface_address = framebuffer.GetDepthBufferPhysicalAddress(); | 455 | surface_address = framebuffer.GetDepthBufferPhysicalAddress(); |
| 456 | surface_width = framebuffer.GetWidth(); | 456 | surface_width = framebuffer.GetWidth(); |
| 457 | surface_height = framebuffer.GetHeight(); | 457 | surface_height = framebuffer.GetHeight(); |
| 458 | 458 | ||
| 459 | switch (framebuffer.depth_format) { | 459 | switch (framebuffer.depth_format) { |
| 460 | case Pica::Regs::DepthFormat::D16: | 460 | case Pica::FramebufferRegs::DepthFormat::D16: |
| 461 | surface_format = Format::D16; | 461 | surface_format = Format::D16; |
| 462 | break; | 462 | break; |
| 463 | 463 | ||
| 464 | case Pica::Regs::DepthFormat::D24: | 464 | case Pica::FramebufferRegs::DepthFormat::D24: |
| 465 | surface_format = Format::D24; | 465 | surface_format = Format::D24; |
| 466 | break; | 466 | break; |
| 467 | 467 | ||
| 468 | case Pica::Regs::DepthFormat::D24S8: | 468 | case Pica::FramebufferRegs::DepthFormat::D24S8: |
| 469 | surface_format = Format::D24X8; | 469 | surface_format = Format::D24X8; |
| 470 | break; | 470 | break; |
| 471 | 471 | ||
| @@ -478,14 +478,14 @@ void GraphicsSurfaceWidget::OnUpdate() { | |||
| 478 | } | 478 | } |
| 479 | 479 | ||
| 480 | case Source::StencilBuffer: { | 480 | case Source::StencilBuffer: { |
| 481 | const auto& framebuffer = Pica::g_state.regs.framebuffer; | 481 | const auto& framebuffer = Pica::g_state.regs.framebuffer.framebuffer; |
| 482 | 482 | ||
| 483 | surface_address = framebuffer.GetDepthBufferPhysicalAddress(); | 483 | surface_address = framebuffer.GetDepthBufferPhysicalAddress(); |
| 484 | surface_width = framebuffer.GetWidth(); | 484 | surface_width = framebuffer.GetWidth(); |
| 485 | surface_height = framebuffer.GetHeight(); | 485 | surface_height = framebuffer.GetHeight(); |
| 486 | 486 | ||
| 487 | switch (framebuffer.depth_format) { | 487 | switch (framebuffer.depth_format) { |
| 488 | case Pica::Regs::DepthFormat::D24S8: | 488 | case Pica::FramebufferRegs::DepthFormat::D24S8: |
| 489 | surface_format = Format::X24S8; | 489 | surface_format = Format::X24S8; |
| 490 | break; | 490 | break; |
| 491 | 491 | ||
| @@ -512,7 +512,7 @@ void GraphicsSurfaceWidget::OnUpdate() { | |||
| 512 | break; | 512 | break; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | const auto texture = Pica::g_state.regs.GetTextures()[texture_index]; | 515 | const auto texture = Pica::g_state.regs.texturing.GetTextures()[texture_index]; |
| 516 | auto info = Pica::Texture::TextureInfo::FromPicaRegister(texture.config, texture.format); | 516 | auto info = Pica::Texture::TextureInfo::FromPicaRegister(texture.config, texture.format); |
| 517 | 517 | ||
| 518 | surface_address = info.physical_address; | 518 | surface_address = info.physical_address; |
| @@ -574,7 +574,7 @@ void GraphicsSurfaceWidget::OnUpdate() { | |||
| 574 | info.physical_address = surface_address; | 574 | info.physical_address = surface_address; |
| 575 | info.width = surface_width; | 575 | info.width = surface_width; |
| 576 | info.height = surface_height; | 576 | info.height = surface_height; |
| 577 | info.format = static_cast<Pica::Regs::TextureFormat>(surface_format); | 577 | info.format = static_cast<Pica::TexturingRegs::TextureFormat>(surface_format); |
| 578 | info.SetDefaultStride(); | 578 | info.SetDefaultStride(); |
| 579 | 579 | ||
| 580 | for (unsigned int y = 0; y < surface_height; ++y) { | 580 | for (unsigned int y = 0; y < surface_height; ++y) { |
| @@ -689,7 +689,8 @@ void GraphicsSurfaceWidget::SaveSurface() { | |||
| 689 | 689 | ||
| 690 | unsigned int GraphicsSurfaceWidget::NibblesPerPixel(GraphicsSurfaceWidget::Format format) { | 690 | unsigned int GraphicsSurfaceWidget::NibblesPerPixel(GraphicsSurfaceWidget::Format format) { |
| 691 | if (format <= Format::MaxTextureFormat) { | 691 | if (format <= Format::MaxTextureFormat) { |
| 692 | return Pica::Regs::NibblesPerPixel(static_cast<Pica::Regs::TextureFormat>(format)); | 692 | return Pica::TexturingRegs::NibblesPerPixel( |
| 693 | static_cast<Pica::TexturingRegs::TextureFormat>(format)); | ||
| 693 | } | 694 | } |
| 694 | 695 | ||
| 695 | switch (format) { | 696 | switch (format) { |