From 26f58e1ba5e88959f73813d1fcc0dd586a0bd236 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 11 Aug 2013 17:08:12 +0200 Subject: [PATCH] Add an option to enable performance queries in gameini files, disable it by default --- Source/Core/VideoCommon/Src/PerfQueryBase.cpp | 6 ++++++ Source/Core/VideoCommon/Src/PerfQueryBase.h | 5 ++++- Source/Core/VideoCommon/Src/VideoConfig.cpp | 1 + Source/Core/VideoCommon/Src/VideoConfig.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) 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;