diff --git a/src/plugins/effectcomposer/effectcomposermodel.cpp b/src/plugins/effectcomposer/effectcomposermodel.cpp index 966465ff31d..1edc70c75b4 100644 --- a/src/plugins/effectcomposer/effectcomposermodel.cpp +++ b/src/plugins/effectcomposer/effectcomposermodel.cpp @@ -618,6 +618,20 @@ R"( )" }; + if (m_shaderFeatures.enabled(ShaderFeatures::Mipmap)) { + QString mipmap1{ + R"(parent.layer.smooth = true + parent.layer.mipmap = true + %1)" + }; + QString mipmap2{ + R"(_oldParent.layer.smooth = false + _oldParent.layer.mipmap = false + %2)" + }; + parentChanged = parentChanged.arg(mipmap1, mipmap2); + } + parentChanged = parentChanged.arg(m_shaderFeatures.enabled(ShaderFeatures::Source) ? QString("source = parent") : QString(), m_shaderFeatures.enabled(ShaderFeatures::Source) diff --git a/src/plugins/effectcomposer/shaderfeatures.cpp b/src/plugins/effectcomposer/shaderfeatures.cpp index 5690db5f174..fc1cf95a34b 100644 --- a/src/plugins/effectcomposer/shaderfeatures.cpp +++ b/src/plugins/effectcomposer/shaderfeatures.cpp @@ -73,8 +73,12 @@ void ShaderFeatures::checkLine(const QString &line, Features &features) if (m_gridMeshWidth > 1 || m_gridMeshHeight > 1) features.setFlag(GridMesh, true); } + if (line.contains("@blursources")) features.setFlag(BlurSources, true); + + if (line.contains("textureLod(")) + features.setFlag(Mipmap, true); } int ShaderFeatures::gridMeshHeight() const diff --git a/src/plugins/effectcomposer/shaderfeatures.h b/src/plugins/effectcomposer/shaderfeatures.h index 10418c7f81d..30bf9e68516 100644 --- a/src/plugins/effectcomposer/shaderfeatures.h +++ b/src/plugins/effectcomposer/shaderfeatures.h @@ -19,7 +19,8 @@ public: Mouse = 1 << 4, FragCoord = 1 << 5, GridMesh = 1 << 6, - BlurSources = 1 << 7 + BlurSources = 1 << 7, + Mipmap = 1 << 8 }; Q_DECLARE_FLAGS(Features, Feature)