From e04ec0ce291af6321fcaf79c7dcb6d108165cc7b Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 7 May 2024 16:39:31 +0200 Subject: [PATCH] opengl: make GLRenderTimeQuery::query non-destructive --- src/opengl/glrendertimequery.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/opengl/glrendertimequery.cpp b/src/opengl/glrendertimequery.cpp index d666f3956a..bea498f2a5 100644 --- a/src/opengl/glrendertimequery.cpp +++ b/src/opengl/glrendertimequery.cpp @@ -55,11 +55,7 @@ void GLRenderTimeQuery::end() std::optional 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 GLRenderTimeQuery::query() .end = end, }; } - }