summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/graphics_cmdlists.cpp
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-12-06 19:10:08 +0100
committerGravatar Tony Wasserka2014-12-20 18:05:53 +0100
commitfd2539121cddd6177a964770a6985f8880ca1646 (patch)
tree67d2e0e33ee435569e3a82eaa891c2154ed83d53 /src/citra_qt/debugger/graphics_cmdlists.cpp
parentBitField: Add an explicit Assign method. (diff)
downloadyuzu-fd2539121cddd6177a964770a6985f8880ca1646.tar.gz
yuzu-fd2539121cddd6177a964770a6985f8880ca1646.tar.xz
yuzu-fd2539121cddd6177a964770a6985f8880ca1646.zip
Pica: Initial support for multitexturing.
Diffstat (limited to 'src/citra_qt/debugger/graphics_cmdlists.cpp')
-rw-r--r--src/citra_qt/debugger/graphics_cmdlists.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp
index 7f97cf143..bdd676470 100644
--- a/src/citra_qt/debugger/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics_cmdlists.cpp
@@ -223,9 +223,21 @@ void GPUCommandListModel::OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&
223 223
224void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) { 224void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
225 const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt(); 225 const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt();
226 if (COMMAND_IN_RANGE(command_id, texture0)) { 226 if (COMMAND_IN_RANGE(command_id, texture0) ||
227 auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(Pica::registers.texture0, 227 COMMAND_IN_RANGE(command_id, texture1) ||
228 Pica::registers.texture0_format); 228 COMMAND_IN_RANGE(command_id, texture2)) {
229
230 unsigned index;
231 if (COMMAND_IN_RANGE(command_id, texture0)) {
232 index = 0;
233 } else if (COMMAND_IN_RANGE(command_id, texture1)) {
234 index = 1;
235 } else {
236 index = 2;
237 }
238 auto config = Pica::registers.GetTextures()[index].config;
239 auto format = Pica::registers.GetTextures()[index].format;
240 auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
229 241
230 // TODO: Instead, emit a signal here to be caught by the main window widget. 242 // TODO: Instead, emit a signal here to be caught by the main window widget.
231 auto main_window = static_cast<QMainWindow*>(parent()); 243 auto main_window = static_cast<QMainWindow*>(parent());
@@ -237,10 +249,23 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
237 QWidget* new_info_widget; 249 QWidget* new_info_widget;
238 250
239 const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt(); 251 const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt();
240 if (COMMAND_IN_RANGE(command_id, texture0)) { 252 if (COMMAND_IN_RANGE(command_id, texture0) ||
241 u8* src = Memory::GetPointer(Pica::registers.texture0.GetPhysicalAddress()); 253 COMMAND_IN_RANGE(command_id, texture1) ||
242 auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(Pica::registers.texture0, 254 COMMAND_IN_RANGE(command_id, texture2)) {
243 Pica::registers.texture0_format); 255
256 unsigned index;
257 if (COMMAND_IN_RANGE(command_id, texture0)) {
258 index = 0;
259 } else if (COMMAND_IN_RANGE(command_id, texture1)) {
260 index = 1;
261 } else {
262 index = 2;
263 }
264 auto config = Pica::registers.GetTextures()[index].config;
265 auto format = Pica::registers.GetTextures()[index].format;
266
267 auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
268 u8* src = Memory::GetPointer(config.GetPhysicalAddress());
244 new_info_widget = new TextureInfoWidget(src, info); 269 new_info_widget = new TextureInfoWidget(src, info);
245 } else { 270 } else {
246 new_info_widget = new QWidget; 271 new_info_widget = new QWidget;