aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/items/qquickshadereffect.cpp5
-rw-r--r--src/quick/items/qquickwindow.cpp7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp
index b4d9f9f69d..5365ab071e 100644
--- a/src/quick/items/qquickshadereffect.cpp
+++ b/src/quick/items/qquickshadereffect.cpp
@@ -1158,6 +1158,11 @@ static inline QVariant getValueFromProperty(QObject *item, const QMetaObject *it
using QQuickShaderInfoCache = QHash<QUrl, QSGGuiThreadShaderEffectManager::ShaderInfo>;
Q_GLOBAL_STATIC(QQuickShaderInfoCache, shaderInfoCache)
+void qtquick_shadereffect_purge_gui_thread_shader_cache()
+{
+ shaderInfoCache()->clear();
+}
+
bool QQuickShaderEffectImpl::updateShader(Shader shaderType, const QUrl &fileUrl)
{
QSGGuiThreadShaderEffectManager *mgr = shaderEffectManager();
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 698ac341a4..37525d99d8 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1681,6 +1681,10 @@ QQuickWindow::~QQuickWindow()
QQuickPixmap::purgeCache();
}
+#if QT_CONFIG(quick_shadereffect)
+void qtquick_shadereffect_purge_gui_thread_shader_cache();
+#endif
+
/*!
This function tries to release redundant resources currently held by the QML scene.
@@ -1707,6 +1711,9 @@ void QQuickWindow::releaseResources()
if (d->windowManager)
d->windowManager->releaseResources(this);
QQuickPixmap::purgeCache();
+#if QT_CONFIG(quick_shadereffect)
+ qtquick_shadereffect_purge_gui_thread_shader_cache();
+#endif
}