summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/graphics
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-01-27 20:51:59 -0800
committerGravatar Yuri Kunde Schlesner2017-02-04 13:59:09 -0800
commit9017093f58fb08b85cfb842f305efa667d62cecb (patch)
tree98a1e77b197a562a8f13565e62f2e8bb9220ff94 /src/citra_qt/debugger/graphics
parentVideoCore: Split rasterizer regs from Regs struct (diff)
downloadyuzu-9017093f58fb08b85cfb842f305efa667d62cecb.tar.gz
yuzu-9017093f58fb08b85cfb842f305efa667d62cecb.tar.xz
yuzu-9017093f58fb08b85cfb842f305efa667d62cecb.zip
VideoCore: Split texturing regs from Regs struct
Diffstat (limited to 'src/citra_qt/debugger/graphics')
-rw-r--r--src/citra_qt/debugger/graphics/graphics_cmdlists.cpp22
-rw-r--r--src/citra_qt/debugger/graphics/graphics_surface.cpp7
2 files changed, 16 insertions, 13 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
index ee79f0edf..adaa18cfc 100644
--- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
@@ -123,15 +123,16 @@ void GPUCommandListModel::OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&
123void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) { 123void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
124 const unsigned int command_id = 124 const unsigned int command_id =
125 list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt(); 125 list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
126 if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) || 126 if (COMMAND_IN_RANGE(command_id, texturing.texture0) ||
127 COMMAND_IN_RANGE(command_id, texture2)) { 127 COMMAND_IN_RANGE(command_id, texturing.texture1) ||
128 COMMAND_IN_RANGE(command_id, texturing.texture2)) {
128 129
129 unsigned texture_index; 130 unsigned texture_index;
130 if (COMMAND_IN_RANGE(command_id, texture0)) { 131 if (COMMAND_IN_RANGE(command_id, texturing.texture0)) {
131 texture_index = 0; 132 texture_index = 0;
132 } else if (COMMAND_IN_RANGE(command_id, texture1)) { 133 } else if (COMMAND_IN_RANGE(command_id, texturing.texture1)) {
133 texture_index = 1; 134 texture_index = 1;
134 } else if (COMMAND_IN_RANGE(command_id, texture2)) { 135 } else if (COMMAND_IN_RANGE(command_id, texturing.texture2)) {
135 texture_index = 2; 136 texture_index = 2;
136 } else { 137 } else {
137 UNREACHABLE_MSG("Unknown texture command"); 138 UNREACHABLE_MSG("Unknown texture command");
@@ -146,19 +147,20 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
146 147
147 const unsigned int command_id = 148 const unsigned int command_id =
148 list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt(); 149 list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
149 if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) || 150 if (COMMAND_IN_RANGE(command_id, texturing.texture0) ||
150 COMMAND_IN_RANGE(command_id, texture2)) { 151 COMMAND_IN_RANGE(command_id, texturing.texture1) ||
152 COMMAND_IN_RANGE(command_id, texturing.texture2)) {
151 153
152 unsigned texture_index; 154 unsigned texture_index;
153 if (COMMAND_IN_RANGE(command_id, texture0)) { 155 if (COMMAND_IN_RANGE(command_id, texturing.texture0)) {
154 texture_index = 0; 156 texture_index = 0;
155 } else if (COMMAND_IN_RANGE(command_id, texture1)) { 157 } else if (COMMAND_IN_RANGE(command_id, texturing.texture1)) {
156 texture_index = 1; 158 texture_index = 1;
157 } else { 159 } else {
158 texture_index = 2; 160 texture_index = 2;
159 } 161 }
160 162
161 const auto texture = Pica::g_state.regs.GetTextures()[texture_index]; 163 const auto texture = Pica::g_state.regs.texturing.GetTextures()[texture_index];
162 const auto config = texture.config; 164 const auto config = texture.config;
163 const auto format = texture.format; 165 const auto format = texture.format;
164 166
diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp
index bd82b00d4..406a49f42 100644
--- a/src/citra_qt/debugger/graphics/graphics_surface.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp
@@ -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
690unsigned int GraphicsSurfaceWidget::NibblesPerPixel(GraphicsSurfaceWidget::Format format) { 690unsigned 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) {