summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/debugger/graphics/graphics_cmdlists.cpp')
-rw-r--r--src/citra_qt/debugger/graphics/graphics_cmdlists.cpp36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
index f5a2ec761..c68fe753b 100644
--- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
@@ -18,15 +18,16 @@
#include "citra_qt/util/util.h"
#include "common/vector_math.h"
#include "video_core/debug_utils/debug_utils.h"
-#include "video_core/pica.h"
#include "video_core/pica_state.h"
+#include "video_core/regs.h"
+#include "video_core/texture/texture_decode.h"
namespace {
-QImage LoadTexture(const u8* src, const Pica::DebugUtils::TextureInfo& info) {
+QImage LoadTexture(const u8* src, const Pica::Texture::TextureInfo& info) {
QImage decoded_image(info.width, info.height, QImage::Format_ARGB32);
for (int y = 0; y < info.height; ++y) {
for (int x = 0; x < info.width; ++x) {
- Math::Vec4<u8> color = Pica::DebugUtils::LookupTexture(src, x, y, info, true);
+ Math::Vec4<u8> color = Pica::Texture::LookupTexture(src, x, y, info, true);
decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a()));
}
}
@@ -36,9 +37,10 @@ QImage LoadTexture(const u8* src, const Pica::DebugUtils::TextureInfo& info) {
class TextureInfoWidget : public QWidget {
public:
- TextureInfoWidget(const u8* src, const Pica::DebugUtils::TextureInfo& info,
+ TextureInfoWidget(const u8* src, const Pica::Texture::TextureInfo& info,
QWidget* parent = nullptr)
: QWidget(parent) {
+
QLabel* image_widget = new QLabel;
QPixmap image_pixmap = QPixmap::fromImage(LoadTexture(src, info));
image_pixmap = image_pixmap.scaled(200, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation);
@@ -70,7 +72,7 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const {
if (role == Qt::DisplayRole) {
switch (index.column()) {
case 0:
- return QString::fromLatin1(Pica::Regs::GetCommandName(write.cmd_id).c_str());
+ return QString::fromLatin1(Pica::Regs::GetRegisterName(write.cmd_id));
case 1:
return QString("%1").arg(write.cmd_id, 3, 16, QLatin1Char('0'));
case 2:
@@ -121,15 +123,16 @@ void GPUCommandListModel::OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&
void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
const unsigned int command_id =
list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
- if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) ||
- COMMAND_IN_RANGE(command_id, texture2)) {
+ if (COMMAND_IN_RANGE(command_id, texturing.texture0) ||
+ COMMAND_IN_RANGE(command_id, texturing.texture1) ||
+ COMMAND_IN_RANGE(command_id, texturing.texture2)) {
unsigned texture_index;
- if (COMMAND_IN_RANGE(command_id, texture0)) {
+ if (COMMAND_IN_RANGE(command_id, texturing.texture0)) {
texture_index = 0;
- } else if (COMMAND_IN_RANGE(command_id, texture1)) {
+ } else if (COMMAND_IN_RANGE(command_id, texturing.texture1)) {
texture_index = 1;
- } else if (COMMAND_IN_RANGE(command_id, texture2)) {
+ } else if (COMMAND_IN_RANGE(command_id, texturing.texture2)) {
texture_index = 2;
} else {
UNREACHABLE_MSG("Unknown texture command");
@@ -144,23 +147,24 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
const unsigned int command_id =
list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
- if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) ||
- COMMAND_IN_RANGE(command_id, texture2)) {
+ if (COMMAND_IN_RANGE(command_id, texturing.texture0) ||
+ COMMAND_IN_RANGE(command_id, texturing.texture1) ||
+ COMMAND_IN_RANGE(command_id, texturing.texture2)) {
unsigned texture_index;
- if (COMMAND_IN_RANGE(command_id, texture0)) {
+ if (COMMAND_IN_RANGE(command_id, texturing.texture0)) {
texture_index = 0;
- } else if (COMMAND_IN_RANGE(command_id, texture1)) {
+ } else if (COMMAND_IN_RANGE(command_id, texturing.texture1)) {
texture_index = 1;
} else {
texture_index = 2;
}
- const auto texture = Pica::g_state.regs.GetTextures()[texture_index];
+ const auto texture = Pica::g_state.regs.texturing.GetTextures()[texture_index];
const auto config = texture.config;
const auto format = texture.format;
- const auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
+ const auto info = Pica::Texture::TextureInfo::FromPicaRegister(config, format);
const u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress());
new_info_widget = new TextureInfoWidget(src, info);
}