summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/profiler.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-04-29 00:07:10 -0700
committerGravatar Yuri Kunde Schlesner2016-04-29 00:07:10 -0700
commite3a8292495cf0fb4297be27c696649dc44e011f0 (patch)
treef188b106e2d1b39ed7a87972db9f942e15987375 /src/citra_qt/debugger/profiler.cpp
parentMake Citra build with MICROPROFILE_ENABLED set to 0 (#1709) (diff)
downloadyuzu-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.cpp26
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
39static 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
49ProfilerModel::ProfilerModel(QObject* parent) : QAbstractItemModel(parent) 40ProfilerModel::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
56QVariant ProfilerModel::headerData(int section, Qt::Orientation orientation, int role) const 45QVariant 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