[vlc-commits] [Git][videolan/vlc][master] qml: do not use indirection if not necessary for effect source in `PartialEffect`

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Apr 3 15:43:06 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
4aed5fc2 by Fatih Uzunoglu at 2026-04-03T14:44:29+00:00
qml: do not use indirection if not necessary for effect source in `PartialEffect`

Although texture provider indirection has minimal overhead, we can avoid it as
long as the effect accepts "sourceRect".

Unlike Qt's own effects, our `DualKawaseBlur` supports it through a custom
vertex shader.

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/PartialEffect.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/PartialEffect.qml
=====================================
@@ -139,11 +139,24 @@ Item {
             }
         }
 
-        // Effect's source is sub-texture through the texture provider:
+        readonly property bool effectAcceptsSourceRect: (typeof root.effect?.sourceRect !== "undefined") // typeof `rect` is "object"
+
+        // Effect's source is sub-texture through the texture provider, as long as the effect does not accept setting `sourceRect`.
+        // Unlike Qt's own effects, our `DualKawaseBlur` supports that. Note that we are not using a `Loader` to not load the
+        // indirection in case it is accepted by the effect, since its overhead is minimal. Also note that the texture provider
+        // is only created when `textureProvider()` is called, such that when this indirection is actually used (for example as
+        // a shader effect source).
         Binding {
             target: root.effect
             property: root.samplerName
-            value: textureProviderIndirection
+            value: textureProviderIndirection.effectAcceptsSourceRect ? root.source : textureProviderIndirection
+        }
+
+        Binding {
+            target: root.effect
+            property: "sourceRect"
+            when: textureProviderIndirection.effectAcceptsSourceRect
+            value: textureProviderIndirection.textureSubRect
         }
 
         // Adjust the blending. Currently MultiEffect/FastBlur does not



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4aed5fc25237c0cb69ec74cb315ee09ebf9ae418

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4aed5fc25237c0cb69ec74cb315ee09ebf9ae418
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list