diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 195197ef5..081c63ff0 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -17,6 +17,7 @@ GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractItemModel(p QModelIndex GPUCommandListModel::index(int row, int column, const QModelIndex& parent) const { TreeItem* item; + TreeItem* internal; if (!parent.isValid()) { item = root_item; @@ -24,7 +25,13 @@ QModelIndex GPUCommandListModel::index(int row, int column, const QModelIndex& p item = (TreeItem*)parent.internalPointer(); } - return createIndex(row, column, item->children[row]); + if (item->children.size() <= row) { + internal = item; + } + else { internal = item->children[row]; } + + + return createIndex(row, column, internal); } QModelIndex GPUCommandListModel::parent(const QModelIndex& child) const diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h index 6a1e04244..13edb9a47 100644 --- a/src/video_core/gpu_debugger.h +++ b/src/video_core/gpu_debugger.h @@ -20,9 +20,9 @@ public: // A vector of commands represented by their raw byte sequence struct PicaCommand : public std::vector { - Pica::CommandHeader& GetHeader() + Pica::CommandHeader& GetHeader() const { - u32& val = at(1); + const u32& val = at(1); return *(Pica::CommandHeader*)&val; } }; @@ -64,7 +64,7 @@ public: } protected: - GraphicsDebugger* GetDebugger() + GraphicsDebugger* GetDebugger() const { return observed; }