aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/citra_qt/debugger/graphics_cmdlists.hxx
blob: b4e6e3c8a91b39352d4cc52b67c1d6a0cc98c75a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.

#pragma once

#include <QAbstractItemModel>
#include <QDockWidget>

#include "video_core/gpu_debugger.h"

// 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;

public:
    void OnCommandListCalled(const GraphicsDebugger::PicaCommandList& lst, bool is_new) override;

public slots:
    void OnCommandListCalledInternal();

signals:
    void CommandListCalled();

private:
    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
{
    Q_OBJECT

public:
    GPUCommandListWidget(QWidget* parent = 0);

private:
};