aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcontext.cpp
diff options
context:
space:
mode:
authorenkore <public@enkore.de>2014-10-06 19:39:27 +0200
committerMarian Beermann <public@enkore.de>2014-10-07 00:12:00 +0200
commit4cc76248e81307be41b84c71e95e267daed6f728 (patch)
tree55e960e5cf2df415c309052b4d0c9f0d1600913a /src/quick/scenegraph/qsgcontext.cpp
parent1670097fa2b0a549a9509ba4c8be13924bd25c4c (diff)
Add QSG_OPENGL_DEBUG environment variable
If QSG_OPENGL_DEBUG is set the OpenGL context is always created as a debug context. Not setting QSG_OPENGL_DEBUG uses the default value obtained from QSurfaceFormat::defaultFormat(). Change-Id: I8cc2c8f995cfdb2ed762eb155d77ca11b2db7b72 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/scenegraph/qsgcontext.cpp')
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index fdf27085b9..e7b37e50d2 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -247,6 +247,7 @@ void QSGContext::renderContextInitialized(QSGRenderContext *renderContext)
QByteArray all; foreach (const QByteArray &e, exts) all += ' ' + e;
qCDebug(QSG_LOG_INFO) << "GL_EXTENSIONS: " << all.constData();
qCDebug(QSG_LOG_INFO) << "Max Texture Size: " << renderContext->maxTextureSize();
+ qCDebug(QSG_LOG_INFO) << "Debug context: " << format.testOption(QSurfaceFormat::DebugContext);
}
d->mutex.unlock();
@@ -337,8 +338,11 @@ QSurfaceFormat QSGContext::defaultSurfaceFormat() const
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
static bool useDepth = qEnvironmentVariableIsEmpty("QSG_NO_DEPTH_BUFFER");
static bool useStencil = qEnvironmentVariableIsEmpty("QSG_NO_STENCIL_BUFFER");
+ static bool enableDebug = qEnvironmentVariableIsSet("QSG_OPENGL_DEBUG");
format.setDepthBufferSize(useDepth ? 24 : 0);
format.setStencilBufferSize(useStencil ? 8 : 0);
+ if (enableDebug)
+ format.setOption(QSurfaceFormat::DebugContext);
if (QQuickWindow::hasDefaultAlphaBuffer())
format.setAlphaBufferSize(8);
format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);