summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2013-08-11 17:08:12 +0200
committerPierre Bourdon <delroth@gmail.com>2013-08-14 23:16:46 +0200
commit26f58e1ba5e88959f73813d1fcc0dd586a0bd236 (patch)
treea96678fc158f010e5b77edae483018e82551e311 /Source/Core/VideoCommon
parentffdd79df3634a379cb94789e036434b80f16f22a (diff)
Add an option to enable performance queries in gameini files, disable it by default
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/PerfQueryBase.cpp6
-rw-r--r--Source/Core/VideoCommon/Src/PerfQueryBase.h5
-rw-r--r--Source/Core/VideoCommon/Src/VideoConfig.cpp1
-rw-r--r--Source/Core/VideoCommon/Src/VideoConfig.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/Src/PerfQueryBase.cpp b/Source/Core/VideoCommon/Src/PerfQueryBase.cpp
index c537d176f6..af8bfa72e5 100644
--- a/Source/Core/VideoCommon/Src/PerfQueryBase.cpp
+++ b/Source/Core/VideoCommon/Src/PerfQueryBase.cpp
@@ -1,3 +1,9 @@
#include "PerfQueryBase.h"
+#include "VideoConfig.h"
PerfQueryBase* g_perf_query = 0;
+
+bool PerfQueryBase::ShouldEmulate() const
+{
+ return g_ActiveConfig.bPerfQueriesEnable;
+}
diff --git a/Source/Core/VideoCommon/Src/PerfQueryBase.h b/Source/Core/VideoCommon/Src/PerfQueryBase.h
index b979449edb..bf5474b4db 100644
--- a/Source/Core/VideoCommon/Src/PerfQueryBase.h
+++ b/Source/Core/VideoCommon/Src/PerfQueryBase.h
@@ -25,9 +25,12 @@ enum PerfQueryGroup
class PerfQueryBase
{
public:
- PerfQueryBase() {};
+ PerfQueryBase() {}
virtual ~PerfQueryBase() {}
+ // Checks if performance queries are enabled in the gameini configuration.
+ bool ShouldEmulate() const;
+
// Begin querying the specified value for the following host GPU commands
virtual void EnableQuery(PerfQueryGroup type) {}
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.cpp b/Source/Core/VideoCommon/Src/VideoConfig.cpp
index d422c3d01d..b3e9a8815f 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.cpp
+++ b/Source/Core/VideoCommon/Src/VideoConfig.cpp
@@ -181,6 +181,7 @@ void VideoConfig::GameIniLoad(const char *ini_file)
iniFile.GetIfExists("Video", "PH_ZFar", &sPhackvalue[1]);
iniFile.GetIfExists("Video", "ZTPSpeedupHack", &bZTPSpeedHack);
iniFile.GetIfExists("Video", "UseBBox", &bUseBBox);
+ iniFile.GetIfExists("Video", "PerfQueriesEnable", &bPerfQueriesEnable);
}
void VideoConfig::VerifyValidity()
diff --git a/Source/Core/VideoCommon/Src/VideoConfig.h b/Source/Core/VideoCommon/Src/VideoConfig.h
index a0a5cabacf..b856683595 100644
--- a/Source/Core/VideoCommon/Src/VideoConfig.h
+++ b/Source/Core/VideoCommon/Src/VideoConfig.h
@@ -108,6 +108,7 @@ struct VideoConfig
// Hacks
bool bEFBAccessEnable;
bool bDlistCachingEnable;
+ bool bPerfQueriesEnable;
bool bEFBCopyEnable;
bool bEFBCopyCacheEnable;