Refine command list debugging functionality and its qt interface.
This commit is contained in:
parent
6893732348
commit
b0051b2203
4 changed files with 124 additions and 27 deletions
|
@ -4,18 +4,22 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QDockWidget>
|
||||
|
||||
#include "video_core/gpu_debugger.h"
|
||||
|
||||
class GPUCommandListModel : public QAbstractListModel, public GraphicsDebugger::DebuggerObserver
|
||||
// TODO: Rename class, since it's not actually a list model anymore...
|
||||
class GPUCommandListModel : public QAbstractItemModel, public GraphicsDebugger::DebuggerObserver
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GPUCommandListModel(QObject* parent);
|
||||
|
||||
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex& child) const;
|
||||
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
|
@ -29,8 +33,24 @@ signals:
|
|||
void CommandListCalled();
|
||||
|
||||
private:
|
||||
int row_count;
|
||||
std::vector<std::pair<u32,GraphicsDebugger::PicaCommandList>> command_list;
|
||||
struct TreeItem : public QObject
|
||||
{
|
||||
enum Type {
|
||||
ROOT,
|
||||
COMMAND_LIST,
|
||||
COMMAND
|
||||
};
|
||||
|
||||
TreeItem(Type type, int index, TreeItem* item_parent, QObject* parent) : QObject(parent), type(type), index(index), parent(item_parent) {}
|
||||
|
||||
Type type;
|
||||
int index;
|
||||
std::vector<TreeItem*> children;
|
||||
TreeItem* parent;
|
||||
};
|
||||
|
||||
std::vector<std::pair<u32,GraphicsDebugger::PicaCommandList>> command_lists;
|
||||
TreeItem* root_item;
|
||||
};
|
||||
|
||||
class GPUCommandListWidget : public QDockWidget
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue