diff options
Diffstat (limited to '')
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics.cpp (renamed from src/citra_qt/debugger/graphics.cpp) | 18 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics.h (renamed from src/citra_qt/debugger/graphics.h) | 2 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_breakpoint_observer.cpp (renamed from src/citra_qt/debugger/graphics_breakpoint_observer.cpp) | 2 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_breakpoint_observer.h (renamed from src/citra_qt/debugger/graphics_breakpoint_observer.h) | 0 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_breakpoints.cpp (renamed from src/citra_qt/debugger/graphics_breakpoints.cpp) | 4 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_breakpoints.h (renamed from src/citra_qt/debugger/graphics_breakpoints.h) | 4 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_breakpoints_p.h (renamed from src/citra_qt/debugger/graphics_breakpoints_p.h) | 0 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_cmdlists.cpp (renamed from src/citra_qt/debugger/graphics_cmdlists.cpp) | 44 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_cmdlists.h (renamed from src/citra_qt/debugger/graphics_cmdlists.h) | 4 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_surface.cpp (renamed from src/citra_qt/debugger/graphics_surface.cpp) | 2 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_surface.h (renamed from src/citra_qt/debugger/graphics_surface.h) | 9 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_tracing.cpp (renamed from src/citra_qt/debugger/graphics_tracing.cpp) | 2 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_tracing.h (renamed from src/citra_qt/debugger/graphics_tracing.h) | 6 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp (renamed from src/citra_qt/debugger/graphics_vertex_shader.cpp) | 2 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics/graphics_vertex_shader.h (renamed from src/citra_qt/debugger/graphics_vertex_shader.h) | 4 |
15 files changed, 55 insertions, 48 deletions
diff --git a/src/citra_qt/debugger/graphics.cpp b/src/citra_qt/debugger/graphics/graphics.cpp index ef6712bfa..6a76adeae 100644 --- a/src/citra_qt/debugger/graphics.cpp +++ b/src/citra_qt/debugger/graphics/graphics.cpp @@ -3,7 +3,7 @@ // Refer to the license.txt file included. #include <QListView> -#include "citra_qt/debugger/graphics.h" +#include "citra_qt/debugger/graphics/graphics.h" #include "citra_qt/util/util.h" extern GraphicsDebugger g_debugger; @@ -22,15 +22,15 @@ QVariant GPUCommandStreamItemModel::data(const QModelIndex& index, int role) con return QVariant(); int command_index = index.row(); - const GSP_GPU::Command& command = GetDebugger()->ReadGXCommandHistory(command_index); + const Service::GSP::Command& command = GetDebugger()->ReadGXCommandHistory(command_index); if (role == Qt::DisplayRole) { - std::map<GSP_GPU::CommandId, const char*> command_names = { - {GSP_GPU::CommandId::REQUEST_DMA, "REQUEST_DMA"}, - {GSP_GPU::CommandId::SUBMIT_GPU_CMDLIST, "SUBMIT_GPU_CMDLIST"}, - {GSP_GPU::CommandId::SET_MEMORY_FILL, "SET_MEMORY_FILL"}, - {GSP_GPU::CommandId::SET_DISPLAY_TRANSFER, "SET_DISPLAY_TRANSFER"}, - {GSP_GPU::CommandId::SET_TEXTURE_COPY, "SET_TEXTURE_COPY"}, - {GSP_GPU::CommandId::CACHE_FLUSH, "CACHE_FLUSH"}, + std::map<Service::GSP::CommandId, const char*> command_names = { + {Service::GSP::CommandId::REQUEST_DMA, "REQUEST_DMA"}, + {Service::GSP::CommandId::SUBMIT_GPU_CMDLIST, "SUBMIT_GPU_CMDLIST"}, + {Service::GSP::CommandId::SET_MEMORY_FILL, "SET_MEMORY_FILL"}, + {Service::GSP::CommandId::SET_DISPLAY_TRANSFER, "SET_DISPLAY_TRANSFER"}, + {Service::GSP::CommandId::SET_TEXTURE_COPY, "SET_TEXTURE_COPY"}, + {Service::GSP::CommandId::CACHE_FLUSH, "CACHE_FLUSH"}, }; const u32* command_data = reinterpret_cast<const u32*>(&command); QString str = QString("%1 %2 %3 %4 %5 %6 %7 %8 %9") diff --git a/src/citra_qt/debugger/graphics.h b/src/citra_qt/debugger/graphics/graphics.h index bedf3e596..8837fb792 100644 --- a/src/citra_qt/debugger/graphics.h +++ b/src/citra_qt/debugger/graphics/graphics.h @@ -13,7 +13,7 @@ class GPUCommandStreamItemModel : public QAbstractListModel, Q_OBJECT public: - GPUCommandStreamItemModel(QObject* parent); + explicit GPUCommandStreamItemModel(QObject* parent); int rowCount(const QModelIndex& parent = QModelIndex()) const override; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.cpp index e01d3440e..dc6070dea 100644 --- a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp +++ b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.cpp @@ -3,7 +3,7 @@ // Refer to the license.txt file included. #include <QMetaType> -#include "citra_qt/debugger/graphics_breakpoint_observer.h" +#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr<Pica::DebugContext> debug_context, const QString& title, QWidget* parent) diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.h b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.h index e77df4f5b..e77df4f5b 100644 --- a/src/citra_qt/debugger/graphics_breakpoint_observer.h +++ b/src/citra_qt/debugger/graphics/graphics_breakpoint_observer.h diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp index d2a036dfa..030828ba8 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics/graphics_breakpoints.cpp @@ -7,8 +7,8 @@ #include <QPushButton> #include <QTreeView> #include <QVBoxLayout> -#include "citra_qt/debugger/graphics_breakpoints.h" -#include "citra_qt/debugger/graphics_breakpoints_p.h" +#include "citra_qt/debugger/graphics/graphics_breakpoints.h" +#include "citra_qt/debugger/graphics/graphics_breakpoints_p.h" #include "common/assert.h" BreakPointModel::BreakPointModel(std::shared_ptr<Pica::DebugContext> debug_context, QObject* parent) diff --git a/src/citra_qt/debugger/graphics_breakpoints.h b/src/citra_qt/debugger/graphics/graphics_breakpoints.h index 5fc40c916..bec72a2db 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.h +++ b/src/citra_qt/debugger/graphics/graphics_breakpoints.h @@ -20,8 +20,8 @@ class GraphicsBreakPointsWidget : public QDockWidget, Pica::DebugContext::BreakP using Event = Pica::DebugContext::Event; public: - GraphicsBreakPointsWidget(std::shared_ptr<Pica::DebugContext> debug_context, - QWidget* parent = nullptr); + explicit GraphicsBreakPointsWidget(std::shared_ptr<Pica::DebugContext> debug_context, + QWidget* parent = nullptr); void OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) override; void OnPicaResume() override; diff --git a/src/citra_qt/debugger/graphics_breakpoints_p.h b/src/citra_qt/debugger/graphics/graphics_breakpoints_p.h index dc64706bd..dc64706bd 100644 --- a/src/citra_qt/debugger/graphics_breakpoints_p.h +++ b/src/citra_qt/debugger/graphics/graphics_breakpoints_p.h diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp index 8a784d108..dab529e3a 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp @@ -13,7 +13,7 @@ #include <QSpinBox> #include <QTreeView> #include <QVBoxLayout> -#include "citra_qt/debugger/graphics_cmdlists.h" +#include "citra_qt/debugger/graphics/graphics_cmdlists.h" #include "citra_qt/util/spinbox.h" #include "citra_qt/util/util.h" #include "common/vector_math.h" @@ -21,7 +21,8 @@ #include "video_core/pica.h" #include "video_core/pica_state.h" -QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) { +namespace { +QImage LoadTexture(const u8* src, const Pica::DebugUtils::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) { @@ -35,7 +36,8 @@ QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) { class TextureInfoWidget : public QWidget { public: - TextureInfoWidget(u8* src, const Pica::DebugUtils::TextureInfo& info, QWidget* parent = nullptr) + TextureInfoWidget(const u8* src, const Pica::DebugUtils::TextureInfo& info, + QWidget* parent = nullptr) : QWidget(parent) { QLabel* image_widget = new QLabel; QPixmap image_pixmap = QPixmap::fromImage(LoadTexture(src, info)); @@ -47,6 +49,7 @@ public: setLayout(layout); } }; +} // Anonymous namespace GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {} @@ -65,7 +68,6 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const { const auto& write = pica_trace.writes[index.row()]; if (role == Qt::DisplayRole) { - QString content; switch (index.column()) { case 0: return QString::fromLatin1(Pica::Regs::GetCommandName(write.cmd_id).c_str()); @@ -122,19 +124,21 @@ void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) { if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) || COMMAND_IN_RANGE(command_id, texture2)) { - unsigned index; + unsigned texture_index; if (COMMAND_IN_RANGE(command_id, texture0)) { - index = 0; + texture_index = 0; } else if (COMMAND_IN_RANGE(command_id, texture1)) { - index = 1; + texture_index = 1; } else if (COMMAND_IN_RANGE(command_id, texture2)) { - index = 2; + texture_index = 2; } else { UNREACHABLE_MSG("Unknown texture command"); } - auto config = Pica::g_state.regs.GetTextures()[index].config; - auto format = Pica::g_state.regs.GetTextures()[index].format; - auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format); + + const auto texture = Pica::g_state.regs.GetTextures()[texture_index]; + const auto config = texture.config; + const auto format = texture.format; + const auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format); // TODO: Open a surface debugger } @@ -148,19 +152,21 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) { if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) || COMMAND_IN_RANGE(command_id, texture2)) { - unsigned index; + unsigned texture_index; if (COMMAND_IN_RANGE(command_id, texture0)) { - index = 0; + texture_index = 0; } else if (COMMAND_IN_RANGE(command_id, texture1)) { - index = 1; + texture_index = 1; } else { - index = 2; + texture_index = 2; } - auto config = Pica::g_state.regs.GetTextures()[index].config; - auto format = Pica::g_state.regs.GetTextures()[index].format; - auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format); - u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress()); + const auto texture = Pica::g_state.regs.GetTextures()[texture_index]; + const auto config = texture.config; + const auto format = texture.format; + + const auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format); + const u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress()); new_info_widget = new TextureInfoWidget(src, info); } if (command_info_widget) { diff --git a/src/citra_qt/debugger/graphics_cmdlists.h b/src/citra_qt/debugger/graphics/graphics_cmdlists.h index fa2b9122b..8f40b94c5 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.h +++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.h @@ -20,7 +20,7 @@ public: CommandIdRole = Qt::UserRole, }; - GPUCommandListModel(QObject* parent); + explicit GPUCommandListModel(QObject* parent); int columnCount(const QModelIndex& parent = QModelIndex()) const override; int rowCount(const QModelIndex& parent = QModelIndex()) const override; @@ -39,7 +39,7 @@ class GPUCommandListWidget : public QDockWidget { Q_OBJECT public: - GPUCommandListWidget(QWidget* parent = nullptr); + explicit GPUCommandListWidget(QWidget* parent = nullptr); public slots: void OnToggleTracing(); diff --git a/src/citra_qt/debugger/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp index 906daaa50..4efd95d3c 100644 --- a/src/citra_qt/debugger/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp @@ -11,7 +11,7 @@ #include <QPushButton> #include <QScrollArea> #include <QSpinBox> -#include "citra_qt/debugger/graphics_surface.h" +#include "citra_qt/debugger/graphics/graphics_surface.h" #include "citra_qt/util/spinbox.h" #include "common/color.h" #include "core/hw/gpu.h" diff --git a/src/citra_qt/debugger/graphics_surface.h b/src/citra_qt/debugger/graphics/graphics_surface.h index 21e6b5b8b..28f5650a7 100644 --- a/src/citra_qt/debugger/graphics_surface.h +++ b/src/citra_qt/debugger/graphics/graphics_surface.h @@ -6,7 +6,7 @@ #include <QLabel> #include <QPushButton> -#include "citra_qt/debugger/graphics_breakpoint_observer.h" +#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" class QComboBox; class QSpinBox; @@ -18,7 +18,8 @@ class SurfacePicture : public QLabel { Q_OBJECT public: - SurfacePicture(QWidget* parent = 0, GraphicsSurfaceWidget* surface_widget = nullptr); + explicit SurfacePicture(QWidget* parent = nullptr, + GraphicsSurfaceWidget* surface_widget = nullptr); ~SurfacePicture(); protected slots: @@ -71,8 +72,8 @@ class GraphicsSurfaceWidget : public BreakPointObserverDock { static unsigned int NibblesPerPixel(Format format); public: - GraphicsSurfaceWidget(std::shared_ptr<Pica::DebugContext> debug_context, - QWidget* parent = nullptr); + explicit GraphicsSurfaceWidget(std::shared_ptr<Pica::DebugContext> debug_context, + QWidget* parent = nullptr); void Pick(int x, int y); public slots: diff --git a/src/citra_qt/debugger/graphics_tracing.cpp b/src/citra_qt/debugger/graphics/graphics_tracing.cpp index 5c6b74034..716ed50b8 100644 --- a/src/citra_qt/debugger/graphics_tracing.cpp +++ b/src/citra_qt/debugger/graphics/graphics_tracing.cpp @@ -12,7 +12,7 @@ #include <QMessageBox> #include <QPushButton> #include <boost/range/algorithm/copy.hpp> -#include "citra_qt/debugger/graphics_tracing.h" +#include "citra_qt/debugger/graphics/graphics_tracing.h" #include "common/common_types.h" #include "core/hw/gpu.h" #include "core/hw/lcd.h" diff --git a/src/citra_qt/debugger/graphics_tracing.h b/src/citra_qt/debugger/graphics/graphics_tracing.h index e04a3dac3..3f73bcd2e 100644 --- a/src/citra_qt/debugger/graphics_tracing.h +++ b/src/citra_qt/debugger/graphics/graphics_tracing.h @@ -4,7 +4,7 @@ #pragma once -#include "citra_qt/debugger/graphics_breakpoint_observer.h" +#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" class EmuThread; @@ -12,8 +12,8 @@ class GraphicsTracingWidget : public BreakPointObserverDock { Q_OBJECT public: - GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext> debug_context, - QWidget* parent = nullptr); + explicit GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext> debug_context, + QWidget* parent = nullptr); private slots: void StartRecording(); diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 96b40db1e..b75b94ef8 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -14,7 +14,7 @@ #include <QSignalMapper> #include <QSpinBox> #include <QTreeView> -#include "citra_qt/debugger/graphics_vertex_shader.h" +#include "citra_qt/debugger/graphics/graphics_vertex_shader.h" #include "citra_qt/util/util.h" #include "video_core/pica.h" #include "video_core/pica_state.h" diff --git a/src/citra_qt/debugger/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h index ec42f24bb..bedea0bed 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.h @@ -6,7 +6,7 @@ #include <QAbstractTableModel> #include <QTreeView> -#include "citra_qt/debugger/graphics_breakpoint_observer.h" +#include "citra_qt/debugger/graphics/graphics_breakpoint_observer.h" #include "nihstro/parser_shbin.h" #include "video_core/shader/shader.h" @@ -19,7 +19,7 @@ class GraphicsVertexShaderModel : public QAbstractTableModel { Q_OBJECT public: - GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent); + explicit GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent); int columnCount(const QModelIndex& parent = QModelIndex()) const override; int rowCount(const QModelIndex& parent = QModelIndex()) const override; |