opengl: move timer query detection to OpenGLContext
This commit is contained in:
parent
568da29fbf
commit
c41da588f6
3 changed files with 2 additions and 9 deletions
|
@ -1051,7 +1051,7 @@ void GLPlatform::printResults() const
|
||||||
}
|
}
|
||||||
print(QByteArrayLiteral("Requires strict binding:"), !m_looseBinding ? QByteArrayLiteral("yes") : QByteArrayLiteral("no"));
|
print(QByteArrayLiteral("Requires strict binding:"), !m_looseBinding ? QByteArrayLiteral("yes") : QByteArrayLiteral("no"));
|
||||||
print(QByteArrayLiteral("Virtual Machine:"), m_virtualMachine ? 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
|
bool GLPlatform::supports(GLFeature feature) const
|
||||||
|
@ -1059,8 +1059,6 @@ bool GLPlatform::supports(GLFeature feature) const
|
||||||
switch (feature) {
|
switch (feature) {
|
||||||
case GLFeature::LooseBinding:
|
case GLFeature::LooseBinding:
|
||||||
return m_looseBinding;
|
return m_looseBinding;
|
||||||
case GLFeature::TimerQuery:
|
|
||||||
return m_context && m_context->supportsTimerQueries();
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,11 +30,6 @@ enum class GLFeature {
|
||||||
* has changed.
|
* has changed.
|
||||||
*/
|
*/
|
||||||
LooseBinding,
|
LooseBinding,
|
||||||
|
|
||||||
/**
|
|
||||||
* Set if the driver supports GL_ARB_timer_query extension or OpenGL 3.3.
|
|
||||||
*/
|
|
||||||
TimerQuery,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Driver {
|
enum Driver {
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace KWin
|
||||||
|
|
||||||
GLRenderTimeQuery::GLRenderTimeQuery()
|
GLRenderTimeQuery::GLRenderTimeQuery()
|
||||||
{
|
{
|
||||||
if (GLPlatform::instance()->supports(GLFeature::TimerQuery)) {
|
if (OpenGlContext::currentContext()->supportsTimerQueries()) {
|
||||||
glGenQueries(1, &m_gpuProbe.query);
|
glGenQueries(1, &m_gpuProbe.query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue