diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-08-30 11:10:08 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-09-04 11:00:14 +0000 |
commit | ac080cda6d9391663f882a4317be78ad89986ee2 (patch) | |
tree | d6f8dc1a91b240ea03f36f3137cdb55486083d4c /src/quick/scenegraph/qsgthreadedrenderloop.cpp | |
parent | d031e8f7b51a28a9c609f40a6245657f303277f2 (diff) |
Make releaseResources() free the renderer's shader cache
Normally all shader programs from materials are cached in a simple table
that is alive as long as the renderer exists, in practice this means being
tied to the QQuickWindow which is often the entire lifetime of an
application.
Use releaseResources(), which is mostly a no-op on the scenegraph level
at the moment, to free this cache.
Task-number: QTBUG-62392
Change-Id: I279e595874fee1ab4fe0dede0843a3686dea5806
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index d28a73da20..e0f78a9873 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -406,6 +406,13 @@ bool QSGRenderThread::event(QEvent *e) stopEventProcessing = true; } else { qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- not releasing because window is still active"; + if (window) { + QQuickWindowPrivate *d = QQuickWindowPrivate::get(window); + if (d->renderer) { + qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- requesting renderer to release cached resources"; + d->renderer->releaseCachedResources(); + } + } } waitCondition.wakeOne(); wm->m_lockedForSync = false; |