2014-05-18 15:52:22 +00:00
|
|
|
// Copyright 2014 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-05-18 17:59:36 +00:00
|
|
|
#include <QAbstractItemModel>
|
2014-05-18 15:52:22 +00:00
|
|
|
#include <QDockWidget>
|
|
|
|
|
|
|
|
#include "video_core/gpu_debugger.h"
|
|
|
|
|
2014-05-18 17:59:36 +00:00
|
|
|
// TODO: Rename class, since it's not actually a list model anymore...
|
|
|
|
class GPUCommandListModel : public QAbstractItemModel, public GraphicsDebugger::DebuggerObserver
|
2014-05-18 15:52:22 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GPUCommandListModel(QObject* parent);
|
|
|
|
|
2014-05-18 17:59:36 +00:00
|
|
|
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
|
|
|
|
QModelIndex parent(const QModelIndex& child) const;
|
|
|
|
int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
2014-05-18 15:52:22 +00:00
|
|
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void OnCommandListCalled(const GraphicsDebugger::PicaCommandList& lst, bool is_new) override;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void OnCommandListCalledInternal();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void CommandListCalled();
|
|
|
|
|
|
|
|
private:
|
2014-05-18 17:59:36 +00:00
|
|
|
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;
|
2014-05-18 15:52:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class GPUCommandListWidget : public QDockWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GPUCommandListWidget(QWidget* parent = 0);
|
|
|
|
|
|
|
|
private:
|
|
|
|
};
|