Merge pull request #9731 from JosJuice/perf-queries-slow

Fix perf query regression
This commit is contained in:
Mai M 2021-05-21 10:14:51 -04:00 committed by GitHub
commit bc89df897e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View File

@ -27,16 +27,20 @@ PerfQuery::~PerfQuery() = default;
void PerfQuery::EnableQuery(PerfQueryGroup type)
{
const u32 query_count = m_query_count.load(std::memory_order_relaxed);
u32 query_count = m_query_count.load(std::memory_order_relaxed);
// Is this sane?
if (query_count > m_query_buffer.size() / 2)
{
WeakFlush();
query_count = m_query_count.load(std::memory_order_relaxed);
}
if (m_query_buffer.size() == query_count)
{
// TODO
FlushOne();
query_count = m_query_count.load(std::memory_order_relaxed);
ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
}

View File

@ -99,15 +99,19 @@ PerfQueryGL::~PerfQueryGL()
void PerfQueryGL::EnableQuery(PerfQueryGroup type)
{
const u32 query_count = m_query_count.load(std::memory_order_relaxed);
u32 query_count = m_query_count.load(std::memory_order_relaxed);
// Is this sane?
if (query_count > m_query_buffer.size() / 2)
{
WeakFlush();
query_count = m_query_count.load(std::memory_order_relaxed);
}
if (m_query_buffer.size() == query_count)
{
FlushOne();
query_count = m_query_count.load(std::memory_order_relaxed);
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
}
@ -195,14 +199,19 @@ PerfQueryGLESNV::~PerfQueryGLESNV()
void PerfQueryGLESNV::EnableQuery(PerfQueryGroup type)
{
const u32 query_count = m_query_count.load(std::memory_order_relaxed);
u32 query_count = m_query_count.load(std::memory_order_relaxed);
// Is this sane?
if (query_count > m_query_buffer.size() / 2)
{
WeakFlush();
query_count = m_query_count.load(std::memory_order_relaxed);
}
if (m_query_buffer.size() == query_count)
{
FlushOne();
query_count = m_query_count.load(std::memory_order_relaxed);
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
}