diff options
| author | 2016-04-29 00:07:10 -0700 | |
|---|---|---|
| committer | 2016-04-29 00:07:10 -0700 | |
| commit | e3a8292495cf0fb4297be27c696649dc44e011f0 (patch) | |
| tree | f188b106e2d1b39ed7a87972db9f942e15987375 /src/citra_qt/debugger/profiler.cpp | |
| parent | Make Citra build with MICROPROFILE_ENABLED set to 0 (#1709) (diff) | |
| download | yuzu-e3a8292495cf0fb4297be27c696649dc44e011f0.tar.gz yuzu-e3a8292495cf0fb4297be27c696649dc44e011f0.tar.xz yuzu-e3a8292495cf0fb4297be27c696649dc44e011f0.zip | |
Common: Remove section measurement from profiler (#1731)
This has been entirely superseded by MicroProfile. The rest of the code
can go when a simpler frametime/FPS meter is added to the GUI.
Diffstat (limited to 'src/citra_qt/debugger/profiler.cpp')
| -rw-r--r-- | src/citra_qt/debugger/profiler.cpp | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index e90973b8e..7bb010f77 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "citra_qt/debugger/profiler.h" | 9 | #include "citra_qt/debugger/profiler.h" |
| 10 | #include "citra_qt/util/util.h" | 10 | #include "citra_qt/util/util.h" |
| 11 | 11 | ||
| 12 | #include "common/common_types.h" | ||
| 12 | #include "common/microprofile.h" | 13 | #include "common/microprofile.h" |
| 13 | #include "common/profiler_reporting.h" | 14 | #include "common/profiler_reporting.h" |
| 14 | 15 | ||
| @@ -36,21 +37,9 @@ static QVariant GetDataForColumn(int col, const AggregatedDuration& duration) | |||
| 36 | } | 37 | } |
| 37 | } | 38 | } |
| 38 | 39 | ||
| 39 | static const TimingCategoryInfo* GetCategoryInfo(int id) | ||
| 40 | { | ||
| 41 | const auto& categories = GetProfilingManager().GetTimingCategoriesInfo(); | ||
| 42 | if ((size_t)id >= categories.size()) { | ||
| 43 | return nullptr; | ||
| 44 | } else { | ||
| 45 | return &categories[id]; | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 49 | ProfilerModel::ProfilerModel(QObject* parent) : QAbstractItemModel(parent) | 40 | ProfilerModel::ProfilerModel(QObject* parent) : QAbstractItemModel(parent) |
| 50 | { | 41 | { |
| 51 | updateProfilingInfo(); | 42 | updateProfilingInfo(); |
| 52 | const auto& categories = GetProfilingManager().GetTimingCategoriesInfo(); | ||
| 53 | results.time_per_category.resize(categories.size()); | ||
| 54 | } | 43 | } |
| 55 | 44 | ||
| 56 | QVariant ProfilerModel::headerData(int section, Qt::Orientation orientation, int role) const | 45 | QVariant ProfilerModel::headerData(int section, Qt::Orientation orientation, int role) const |
| @@ -87,7 +76,7 @@ int ProfilerModel::rowCount(const QModelIndex& parent) const | |||
| 87 | if (parent.isValid()) { | 76 | if (parent.isValid()) { |
| 88 | return 0; | 77 | return 0; |
| 89 | } else { | 78 | } else { |
| 90 | return static_cast<int>(results.time_per_category.size() + 2); | 79 | return 2; |
| 91 | } | 80 | } |
| 92 | } | 81 | } |
| 93 | 82 | ||
| @@ -106,17 +95,6 @@ QVariant ProfilerModel::data(const QModelIndex& index, int role) const | |||
| 106 | } else { | 95 | } else { |
| 107 | return GetDataForColumn(index.column(), results.interframe_time); | 96 | return GetDataForColumn(index.column(), results.interframe_time); |
| 108 | } | 97 | } |
| 109 | } else { | ||
| 110 | if (index.column() == 0) { | ||
| 111 | const TimingCategoryInfo* info = GetCategoryInfo(index.row() - 2); | ||
| 112 | return info != nullptr ? QString(info->name) : QVariant(); | ||
| 113 | } else { | ||
| 114 | if (index.row() - 2 < (int)results.time_per_category.size()) { | ||
| 115 | return GetDataForColumn(index.column(), results.time_per_category[index.row() - 2]); | ||
| 116 | } else { | ||
| 117 | return QVariant(); | ||
| 118 | } | ||
| 119 | } | ||
| 120 | } | 98 | } |
| 121 | } | 99 | } |
| 122 | 100 | ||