diff options
| author | Rachel Bryk <RachelBryk@gmail.com> | 2013-08-15 09:00:04 -0400 |
|---|---|---|
| committer | Rachel Bryk <RachelBryk@gmail.com> | 2013-08-15 09:00:04 -0400 |
| commit | 6d67ea2fdabab5b4daff88409dcb746fab52b483 (patch) | |
| tree | bec0234d1b07915570ca3296b109ab4eb2fd2868 /Source/Plugins/Plugin_VideoOGL/Src/PerfQuery.cpp | |
| parent | f51cb0b7eb9c0f261abd3f5d68707ba1f93e3888 (diff) | |
| parent | d16f089e88f63931d792cb4b2fca05747ed8c90a (diff) | |
Merge remote-tracking branch 'origin/master' into wiimote-netplay
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/PerfQuery.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoOGL/Src/PerfQuery.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/PerfQuery.cpp b/Source/Plugins/Plugin_VideoOGL/Src/PerfQuery.cpp index 31d2af6107..a1582c0c62 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/PerfQuery.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/PerfQuery.cpp @@ -23,6 +23,9 @@ PerfQuery::~PerfQuery() void PerfQuery::EnableQuery(PerfQueryGroup type) { + if (!ShouldEmulate()) + return; + // Is this sane? if (m_query_count > ARRAYSIZE(m_query_buffer) / 2) WeakFlush(); @@ -47,6 +50,9 @@ void PerfQuery::EnableQuery(PerfQueryGroup type) void PerfQuery::DisableQuery(PerfQueryGroup type) { + if (!ShouldEmulate()) + return; + // stop query if (type == PQG_ZCOMP_ZCOMPLOC || type == PQG_ZCOMP) { @@ -56,11 +62,17 @@ void PerfQuery::DisableQuery(PerfQueryGroup type) bool PerfQuery::IsFlushed() const { + if (!ShouldEmulate()) + return true; + return 0 == m_query_count; } void PerfQuery::FlushOne() { + if (!ShouldEmulate()) + return; + auto& entry = m_query_buffer[m_query_read_pos]; GLuint result = 0; @@ -76,12 +88,18 @@ void PerfQuery::FlushOne() // TODO: could selectively flush things, but I don't think that will do much void PerfQuery::FlushResults() { + if (!ShouldEmulate()) + return; + while (!IsFlushed()) FlushOne(); } void PerfQuery::WeakFlush() { + if (!ShouldEmulate()) + return; + while (!IsFlushed()) { auto& entry = m_query_buffer[m_query_read_pos]; @@ -108,6 +126,9 @@ void PerfQuery::ResetQuery() u32 PerfQuery::GetQueryResult(PerfQueryType type) { + if (!ShouldEmulate()) + return 0; + u32 result = 0; if (type == PQ_ZCOMP_INPUT_ZCOMPLOC || type == PQ_ZCOMP_OUTPUT_ZCOMPLOC) |
