diff options
author | Tarja Sundqvist <[email protected]> | 2025-06-03 13:43:35 +0300 |
---|---|---|
committer | Tarja Sundqvist <[email protected]> | 2025-06-03 13:43:35 +0300 |
commit | 0f0972d542d9869c2dcfaf9c963d42ff32766460 (patch) | |
tree | f283360ffbf0453e04a321e01f0c3df1c07df3e3 /src/quick/items/qquickshadereffect.cpp | |
parent | 07e23b0f4983631524716f034c0268fd11d037f9 (diff) | |
parent | ff0a47c8f267e905113b82c53af2742027f0eca6 (diff) |
Merge tag 'v6.5.6-lts-lgpl' into 6.56.5
Qt 6.5.6-lts-lgpl release
Diffstat (limited to 'src/quick/items/qquickshadereffect.cpp')
-rw-r--r-- | src/quick/items/qquickshadereffect.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index fa528765bd..2a6d40c8aa 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -981,9 +981,11 @@ void QQuickShaderEffectPrivate::handleEvent(QEvent *event) { if (event->type() == QEvent::DynamicPropertyChange) { const auto propertyName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName(); - const auto mappedId = findMappedShaderVariableId(propertyName); - if (mappedId) - propertyChanged(*mappedId); + for (int i = 0; i < NShader; ++i) { + const auto mappedId = findMappedShaderVariableId(propertyName, Shader(i)); + if (mappedId) + propertyChanged(*mappedId); + } } } @@ -1438,6 +1440,17 @@ std::optional<int> QQuickShaderEffectPrivate::findMappedShaderVariableId(const Q return {}; } +std::optional<int> QQuickShaderEffectPrivate::findMappedShaderVariableId(const QByteArray &name, Shader shaderType) const +{ + const auto &vars = m_shaders[shaderType].shaderInfo.variables; + for (int idx = 0; idx < vars.size(); ++idx) { + if (vars[idx].name == name) + return indexToMappedId(shaderType, idx); + } + + return {}; +} + bool QQuickShaderEffectPrivate::sourceIsUnique(QQuickItem *source, Shader typeToSkip, int indexToSkip) const { for (int shaderType = 0; shaderType < NShader; ++shaderType) { |