Merge pull request #9731 from JosJuice/perf-queries-slow
Fix perf query regression
This commit is contained in:
commit
bc89df897e
|
@ -27,16 +27,20 @@ PerfQuery::~PerfQuery() = default;
|
||||||
|
|
||||||
void PerfQuery::EnableQuery(PerfQueryGroup type)
|
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?
|
// Is this sane?
|
||||||
if (query_count > m_query_buffer.size() / 2)
|
if (query_count > m_query_buffer.size() / 2)
|
||||||
|
{
|
||||||
WeakFlush();
|
WeakFlush();
|
||||||
|
query_count = m_query_count.load(std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_query_buffer.size() == query_count)
|
if (m_query_buffer.size() == query_count)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
FlushOne();
|
FlushOne();
|
||||||
|
query_count = m_query_count.load(std::memory_order_relaxed);
|
||||||
ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,15 +99,19 @@ PerfQueryGL::~PerfQueryGL()
|
||||||
|
|
||||||
void PerfQueryGL::EnableQuery(PerfQueryGroup type)
|
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?
|
// Is this sane?
|
||||||
if (query_count > m_query_buffer.size() / 2)
|
if (query_count > m_query_buffer.size() / 2)
|
||||||
|
{
|
||||||
WeakFlush();
|
WeakFlush();
|
||||||
|
query_count = m_query_count.load(std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_query_buffer.size() == query_count)
|
if (m_query_buffer.size() == query_count)
|
||||||
{
|
{
|
||||||
FlushOne();
|
FlushOne();
|
||||||
|
query_count = m_query_count.load(std::memory_order_relaxed);
|
||||||
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,14 +199,19 @@ PerfQueryGLESNV::~PerfQueryGLESNV()
|
||||||
|
|
||||||
void PerfQueryGLESNV::EnableQuery(PerfQueryGroup type)
|
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?
|
// Is this sane?
|
||||||
if (query_count > m_query_buffer.size() / 2)
|
if (query_count > m_query_buffer.size() / 2)
|
||||||
|
{
|
||||||
WeakFlush();
|
WeakFlush();
|
||||||
|
query_count = m_query_count.load(std::memory_order_relaxed);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_query_buffer.size() == query_count)
|
if (m_query_buffer.size() == query_count)
|
||||||
{
|
{
|
||||||
FlushOne();
|
FlushOne();
|
||||||
|
query_count = m_query_count.load(std::memory_order_relaxed);
|
||||||
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
// ERROR_LOG_FMT(VIDEO, "Flushed query buffer early!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue