opengl: move timer query detection to OpenGLContext

This commit is contained in:
Xaver Hugl 2024-02-28 13:46:05 +01:00
parent 568da29fbf
commit c41da588f6
3 changed files with 2 additions and 9 deletions

View file

@ -1051,7 +1051,7 @@ void GLPlatform::printResults() const
}
print(QByteArrayLiteral("Requires strict binding:"), !m_looseBinding ? QByteArrayLiteral("yes") : QByteArrayLiteral("no"));
print(QByteArrayLiteral("Virtual Machine:"), m_virtualMachine ? QByteArrayLiteral("yes") : QByteArrayLiteral("no"));
print(QByteArrayLiteral("Timer query support:"), supports(GLFeature::TimerQuery) ? QByteArrayLiteral("yes") : QByteArrayLiteral("no"));
print(QByteArrayLiteral("Timer query support:"), m_context->supportsTimerQueries() ? QByteArrayLiteral("yes") : QByteArrayLiteral("no"));
}
bool GLPlatform::supports(GLFeature feature) const
@ -1059,8 +1059,6 @@ bool GLPlatform::supports(GLFeature feature) const
switch (feature) {
case GLFeature::LooseBinding:
return m_looseBinding;
case GLFeature::TimerQuery:
return m_context && m_context->supportsTimerQueries();
}
return false;
}

View file

@ -30,11 +30,6 @@ enum class GLFeature {
* has changed.
*/
LooseBinding,
/**
* Set if the driver supports GL_ARB_timer_query extension or OpenGL 3.3.
*/
TimerQuery,
};
enum Driver {

View file

@ -14,7 +14,7 @@ namespace KWin
GLRenderTimeQuery::GLRenderTimeQuery()
{
if (GLPlatform::instance()->supports(GLFeature::TimerQuery)) {
if (OpenGlContext::currentContext()->supportsTimerQueries()) {
glGenQueries(1, &m_gpuProbe.query);
}
}