Merge pull request #2302 from lioncash/perf
PerfQueryBase: Move common implementation variables into base class
This commit is contained in:
commit
cd0212ab1c
|
@ -6,7 +6,6 @@ namespace DX11 {
|
||||||
|
|
||||||
PerfQuery::PerfQuery()
|
PerfQuery::PerfQuery()
|
||||||
: m_query_read_pos()
|
: m_query_read_pos()
|
||||||
, m_query_count()
|
|
||||||
{
|
{
|
||||||
for (ActiveQuery& entry : m_query_buffer)
|
for (ActiveQuery& entry : m_query_buffer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,10 +36,6 @@ private:
|
||||||
|
|
||||||
std::array<ActiveQuery, PERF_QUERY_BUFFER_SIZE> m_query_buffer;
|
std::array<ActiveQuery, PERF_QUERY_BUFFER_SIZE> m_query_buffer;
|
||||||
int m_query_read_pos;
|
int m_query_read_pos;
|
||||||
|
|
||||||
// TODO: sloppy
|
|
||||||
volatile int m_query_count;
|
|
||||||
volatile u32 m_results[PQG_NUM_MEMBERS];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -22,7 +22,6 @@ PerfQueryBase* GetPerfQuery()
|
||||||
|
|
||||||
PerfQuery::PerfQuery()
|
PerfQuery::PerfQuery()
|
||||||
: m_query_read_pos()
|
: m_query_read_pos()
|
||||||
, m_query_count()
|
|
||||||
{
|
{
|
||||||
ResetQuery();
|
ResetQuery();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,10 +37,6 @@ protected:
|
||||||
std::array<ActiveQuery, PERF_QUERY_BUFFER_SIZE> m_query_buffer;
|
std::array<ActiveQuery, PERF_QUERY_BUFFER_SIZE> m_query_buffer;
|
||||||
u32 m_query_read_pos;
|
u32 m_query_read_pos;
|
||||||
|
|
||||||
// TODO: sloppy
|
|
||||||
volatile u32 m_query_count;
|
|
||||||
volatile u32 m_results[PQG_NUM_MEMBERS];
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Implementation
|
// Implementation
|
||||||
std::unique_ptr<PerfQuery> m_query;
|
std::unique_ptr<PerfQuery> m_query;
|
||||||
|
|
|
@ -24,7 +24,11 @@ enum PerfQueryGroup
|
||||||
class PerfQueryBase
|
class PerfQueryBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PerfQueryBase() {}
|
PerfQueryBase()
|
||||||
|
: m_query_count(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~PerfQueryBase() {}
|
virtual ~PerfQueryBase() {}
|
||||||
|
|
||||||
// Checks if performance queries are enabled in the gameini configuration.
|
// Checks if performance queries are enabled in the gameini configuration.
|
||||||
|
@ -50,6 +54,11 @@ public:
|
||||||
// True if there are no further pending query results
|
// True if there are no further pending query results
|
||||||
// NOTE: Called from CPU thread
|
// NOTE: Called from CPU thread
|
||||||
virtual bool IsFlushed() const { return true; }
|
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;
|
extern PerfQueryBase* g_perf_query;
|
||||||
|
|
Loading…
Reference in New Issue