From 63393570fb3e0f1ddf6b2219a2398fe3784026a6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 15 Apr 2015 19:22:16 -0400 Subject: [PATCH] PerfQueryBase: Move common implementation variables into base class --- Source/Core/VideoBackends/D3D/PerfQuery.cpp | 1 - Source/Core/VideoBackends/D3D/PerfQuery.h | 4 ---- Source/Core/VideoBackends/OGL/PerfQuery.cpp | 1 - Source/Core/VideoBackends/OGL/PerfQuery.h | 4 ---- Source/Core/VideoCommon/PerfQueryBase.h | 11 ++++++++++- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Source/Core/VideoBackends/D3D/PerfQuery.cpp b/Source/Core/VideoBackends/D3D/PerfQuery.cpp index d80d934c7c..b5eb89b5ad 100644 --- a/Source/Core/VideoBackends/D3D/PerfQuery.cpp +++ b/Source/Core/VideoBackends/D3D/PerfQuery.cpp @@ -6,7 +6,6 @@ namespace DX11 { PerfQuery::PerfQuery() : m_query_read_pos() - , m_query_count() { for (ActiveQuery& entry : m_query_buffer) { diff --git a/Source/Core/VideoBackends/D3D/PerfQuery.h b/Source/Core/VideoBackends/D3D/PerfQuery.h index 98cdbc7d68..adeba4eefe 100644 --- a/Source/Core/VideoBackends/D3D/PerfQuery.h +++ b/Source/Core/VideoBackends/D3D/PerfQuery.h @@ -36,10 +36,6 @@ private: std::array m_query_buffer; int m_query_read_pos; - - // TODO: sloppy - volatile int m_query_count; - volatile u32 m_results[PQG_NUM_MEMBERS]; }; } // namespace diff --git a/Source/Core/VideoBackends/OGL/PerfQuery.cpp b/Source/Core/VideoBackends/OGL/PerfQuery.cpp index 372cd17cf8..702a82dae2 100644 --- a/Source/Core/VideoBackends/OGL/PerfQuery.cpp +++ b/Source/Core/VideoBackends/OGL/PerfQuery.cpp @@ -22,7 +22,6 @@ PerfQueryBase* GetPerfQuery() PerfQuery::PerfQuery() : m_query_read_pos() - , m_query_count() { ResetQuery(); } diff --git a/Source/Core/VideoBackends/OGL/PerfQuery.h b/Source/Core/VideoBackends/OGL/PerfQuery.h index aaf6863eac..c20b949010 100644 --- a/Source/Core/VideoBackends/OGL/PerfQuery.h +++ b/Source/Core/VideoBackends/OGL/PerfQuery.h @@ -37,10 +37,6 @@ protected: std::array m_query_buffer; u32 m_query_read_pos; - // TODO: sloppy - volatile u32 m_query_count; - volatile u32 m_results[PQG_NUM_MEMBERS]; - private: // Implementation std::unique_ptr m_query; diff --git a/Source/Core/VideoCommon/PerfQueryBase.h b/Source/Core/VideoCommon/PerfQueryBase.h index 7b68b84d75..391e59e6b3 100644 --- a/Source/Core/VideoCommon/PerfQueryBase.h +++ b/Source/Core/VideoCommon/PerfQueryBase.h @@ -24,7 +24,11 @@ enum PerfQueryGroup class PerfQueryBase { public: - PerfQueryBase() {} + PerfQueryBase() + : m_query_count(0) + { + } + virtual ~PerfQueryBase() {} // Checks if performance queries are enabled in the gameini configuration. @@ -50,6 +54,11 @@ public: // True if there are no further pending query results // NOTE: Called from CPU thread virtual bool IsFlushed() const { return true; } + +protected: + // TODO: sloppy + volatile u32 m_query_count; + volatile u32 m_results[PQG_NUM_MEMBERS]; }; extern PerfQueryBase* g_perf_query;