aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/citra_qt/debugger/graphics_cmdlists.h
blob: a465d044c3872f9136b680363244e03703e4cae8 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <QAbstractListModel>
#include <QDockWidget>

#include "video_core/gpu_debugger.h"
#include "video_core/debug_utils/debug_utils.h"

class QPushButton;
class QTreeView;

class GPUCommandListModel : public QAbstractListModel
{
    Q_OBJECT

public:
    enum {
        CommandIdRole = Qt::UserRole,
    };

    GPUCommandListModel(QObject* parent);

    int columnCount(const QModelIndex& parent = QModelIndex()) const override;
    int rowCount(const QModelIndex& parent = QModelIndex()) const override;
    QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;

public slots:
    void OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace& trace);

private:
    Pica::DebugUtils::PicaTrace pica_trace;
};

class GPUCommandListWidget : public QDockWidget
{
    Q_OBJECT

public:
    GPUCommandListWidget(QWidget* parent = 0);

public slots:
    void OnToggleTracing();
    void OnCommandDoubleClicked(const QModelIndex&);

    void SetCommandInfo(const QModelIndex&);

signals:
    void TracingFinished(const Pica::DebugUtils::PicaTrace&);

private:
    std::unique_ptr<Pica::DebugUtils::PicaTrace> pica_trace;

    QTreeView* list_widget;
    QWidget* command_info_widget;
    QPushButton* toggle_tracing;
};

class TextureInfoDockWidget : public QDockWidget {
    Q_OBJECT

public:
    TextureInfoDockWidget(const Pica::DebugUtils::TextureInfo& info, QWidget* parent = nullptr);

signals:
    void UpdatePixmap(const QPixmap& pixmap);

private slots:
    void OnAddressChanged(qint64 value);
    void OnFormatChanged(int value);
    void OnWidthChanged(int value);
    void OnHeightChanged(int value);
    void OnStrideChanged(int value);

private:
    QPixmap ReloadPixmap() const;

    Pica::DebugUtils::TextureInfo info;
};