opengl: make GLRenderTimeQuery::query non-destructive

This commit is contained in:
Xaver Hugl 2024-05-07 16:39:31 +02:00
parent b167d1f56a
commit e04ec0ce29

View file

@ -55,11 +55,7 @@ void GLRenderTimeQuery::end()
std::optional<RenderTimeSpan> GLRenderTimeQuery::query()
{
if (!m_hasResult) {
return std::nullopt;
}
m_hasResult = false;
Q_ASSERT(m_hasResult);
if (m_gpuProbe.query) {
const auto context = m_context.lock();
if (!context) {
@ -80,5 +76,4 @@ std::optional<RenderTimeSpan> GLRenderTimeQuery::query()
.end = end,
};
}
}