aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-12-10 12:11:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-10 13:32:25 +0100
commitfb72bb3cf27d1f94760709aaab82e3524ae936f4 (patch)
tree52bfc5c07700b43c0b5abd77a946a8e52dae397c /src
parentabf74b112d3bffa9406f2effd971189001f500db (diff)
QSGRenderer: sanity check attribute regs only when QSG_SANITY_CHECK=1
The sanity check that attribute registers are disabled that was always done in debug mode took roughly 16ms on my machine and caused a trivial QML animation to eat 100% CPU. Task-number: QTBUG-35443 Change-Id: I8ba2a80db341d17e08216b3cad1678dd59b9b1a5 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index 3c9c353bd8..df70b5c5eb 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
//#define RENDERER_DEBUG
//#define QT_GL_NO_SCISSOR_TEST
-
+static bool qsg_sanity_check = qgetenv("QSG_SANITY_CHECK").toInt();
#ifndef QSG_NO_RENDER_TIMING
static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
@@ -243,9 +243,8 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
bindTime = frameTimer.nsecsElapsed();
#endif
-#ifndef QT_NO_DEBUG
// Sanity check that attribute registers are disabled
- {
+ if (qsg_sanity_check) {
GLint count = 0;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &count);
GLint enabled;
@@ -256,7 +255,6 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
}
}
}
-#endif
render();
#ifndef QSG_NO_RENDER_TIMING