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

Fix perf query regression
This commit is contained in:
Mai M authored and GitHub committed 2021-05-21 10:14:51 -04:00
commit bc89df897e
2 files changed
+16 -3

No files matched your search

@@ -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!");
}
+11 -2
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!");
}