diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-26 13:42:08 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-26 13:42:08 +0100 |
commit | 3832b1e05b80a0f509be17dd3619a2f8bb70074f (patch) | |
tree | 3763c243b13c8228b1508ce5902dc2f587cabfdd /src/quick/items/qquickshadereffectnode_p.h | |
parent | f9fae251ca07401ee1b0039edc6ea6b7a522b5a7 (diff) | |
parent | 5c53861cced2d40490e4c7bfc202aadc532df4c2 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
tests/auto/qml/qml.pro
tools/qmlprofiler/qmlprofilerclient.cpp
Change-Id: Id47f15a5ab38f8ec79f0a26c92805acba62caac4
Diffstat (limited to 'src/quick/items/qquickshadereffectnode_p.h')
-rw-r--r-- | src/quick/items/qquickshadereffectnode_p.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/quick/items/qquickshadereffectnode_p.h b/src/quick/items/qquickshadereffectnode_p.h index 420ca1237b..76aecd1b04 100644 --- a/src/quick/items/qquickshadereffectnode_p.h +++ b/src/quick/items/qquickshadereffectnode_p.h @@ -73,7 +73,6 @@ struct QQuickShaderEffectMaterialKey { uint qHash(const QQuickShaderEffectMaterialKey &key); - class QQuickCustomMaterialShader; class QQuickShaderEffectNode; class Q_QUICK_PRIVATE_EXPORT QQuickShaderEffectMaterial : public QSGMaterial @@ -117,13 +116,12 @@ public: protected: friend class QQuickCustomMaterialShader; - // The type pointer needs to be unique. It is not safe to let the type object be part of the - // QQuickShaderEffectMaterial, since it can be deleted and a new one constructed on top of the old - // one. The new QQuickShaderEffectMaterial would then get the same type pointer as the old one, and - // CustomMaterialShaders based on the old one would incorrectly be used together with the new - // one. To guarantee that the type pointer is unique, the type object must live as long as - // there are any CustomMaterialShaders of that type. - QSharedPointer<QSGMaterialType> m_type; + // Each material needs a unique type to ensure that the renderer has a one + // and exactly one GL program for every unique set of shader sources. + // setProgramSource() stores the sources in a cache along with the right + // type. The type is cleaned up in cleanupMaterialCache() which is called + // when the GL context is shut down. + QSGMaterialType *m_type; QQuickShaderEffectMaterialKey m_source; QQuickShaderEffectNode *m_node; |