aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/scenegraph
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-06-15 10:08:43 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-06-15 10:08:43 +0200
commit4c0f5e2da92e861228abc89e4b9b116803a761ce (patch)
tree9e77b303147c76c26236b15fbb537c793906d8a9 /src/declarative/scenegraph
parent129161d232e1d30cd248385eb6d91f5c92e3c246 (diff)
Print out a warning when attributes are enabled
Diffstat (limited to 'src/declarative/scenegraph')
-rw-r--r--src/declarative/scenegraph/coreapi/qsgrenderer.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
index dbf704b64a..cc24cc066b 100644
--- a/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/declarative/scenegraph/coreapi/qsgrenderer.cpp
@@ -229,6 +229,21 @@ void QSGRenderer::renderScene(const Bindable &bindable)
int bindTime = frameTimer.elapsed();
#endif
+#ifndef QT_NO_DEBUG
+ // Sanity check that attribute registers are disabled
+ {
+ GLint count;
+ glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &count);
+ GLint enabled;
+ for (int i=0; i<count; ++i) {
+ glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &enabled);
+ if (enabled) {
+ qWarning("QSGRenderer: attribute %d is enabled, this can lead to memory corruption and crashes.", i);
+ }
+ }
+ }
+#endif
+
render();
#ifdef QSG_RENDERER_TIMING
int renderTime = frameTimer.elapsed();