[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: disable culling in `PartialEffect`

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Mon Jul 21 14:18:40 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
c8d5779c by Fatih Uzunoglu at 2025-07-21T13:26:59+00:00
qml: disable culling in `PartialEffect`

`PartialEffect` is used in `MainDisplay` to
provide frosted glass backdrop effect for the
mini player. When a dialog opens, it uses
layering for the whole `MainDisplay` where the
culled partial effect becomes a descendant of
that layered item. Due to a Qt bug (QTBUG-136611),
this breaks the rendering with OpenGL, as
apparently the winding order wrongfully gets
reversed and we need to use front face culling
to cull the back face.

In the interface case, in theory at least, we
would like to use (back face) culling in all items
because we are not rotating any item in a way that
its back face is revealed.

Culling is not considered that important in 2D
environment, so it is hard to justify having a
workaround for this Qt bug. When they fix it in
the future, we can start using it again. For now,
I propose using culling only in cases where we
would not suffer from this bug (practically no-
where).

Culling can be an improvement, but it also requires
adjusting the graphics pipeline state (since most
items do not use culling). Besides, Qt does not
offer an option to use it consistently among all
items (only `ShaderEffect` allows configuring it).

- - - - -
ce8fda57 by Fatih Uzunoglu at 2025-07-21T13:26:59+00:00
qml: refer the qt bug regarding culling not being used

Normally culling is a matter for all quick items, but Qt
Quick only allows using it with `ShaderEffect` (built-in
items, as custom items always have that option with
`QSGMaterialShader`).

- - - - -


4 changed files:

- modules/gui/qt/widgets/qml/DropShadowImage.qml
- modules/gui/qt/widgets/qml/ImageExt.qml
- modules/gui/qt/widgets/qml/PartialEffect.qml
- modules/gui/qt/widgets/qml/RoundedRectangleShadow.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/DropShadowImage.qml
=====================================
@@ -102,7 +102,7 @@ Item {
 
         supportsAtlasTextures: true
         blending: true
-        // cullMode: ShaderEffect.BackFaceCulling
+        // cullMode: ShaderEffect.BackFaceCulling // QTBUG-136611 (Layering breaks culling with OpenGL)
 
         readonly property Image source: image
 


=====================================
modules/gui/qt/widgets/qml/ImageExt.qml
=====================================
@@ -147,9 +147,7 @@ Item {
 
         antialiasing: root.antialiasing
 
-        // FIXME: Culling seems to cause issues, such as when the view is layered due to
-        //        fading edge effec, this is most likely a Qt bug.
-        // cullMode: ShaderEffect.BackFaceCulling
+        // cullMode: ShaderEffect.BackFaceCulling // QTBUG-136611 (Layering breaks culling with OpenGL)
 
         readonly property real radius: Math.min(1.0, Math.max(root.radius / (Math.min(width, height) / 2), 0.0))
         readonly property real radiusTopRight: radius


=====================================
modules/gui/qt/widgets/qml/PartialEffect.qml
=====================================
@@ -66,7 +66,7 @@ Item {
                 return Qt.rect(0, 0, 0, 0)
         }
 
-        cullMode: ShaderEffect.BackFaceCulling
+        // cullMode: ShaderEffect.BackFaceCulling // QTBUG-136611 (Layering breaks culling with OpenGL)
 
         // Simple filter that is only enabled when blending is active.
         // We do not want the source to be rendered below the frosted glass effect.
@@ -94,7 +94,7 @@ Item {
         // there is no effect to show.
         visible: layer.enabled
 
-        // cullMode: ShaderEffect.BackFaceCulling
+        // cullMode: ShaderEffect.BackFaceCulling // QTBUG-136611 (Layering breaks culling with OpenGL)
 
         property rect effectRect
 


=====================================
modules/gui/qt/widgets/qml/RoundedRectangleShadow.qml
=====================================
@@ -68,7 +68,7 @@ ShaderEffect {
 
     supportsAtlasTextures: true // irrelevant, but nevertheless...
 
-    // cullMode: ShaderEffect.BackFaceCulling // problematic with item layers
+    // cullMode: ShaderEffect.BackFaceCulling // QTBUG-136611 (Layering breaks culling with OpenGL)
 
     fragmentShader: hollow ? "qrc:///shaders/RoundedRectangleShadow_hollow.frag.qsb"
                            : "qrc:///shaders/RoundedRectangleShadow.frag.qsb"



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7697b36abac930bf56bdb04d9b34e8355d68812e...ce8fda5759386de1e0eceae31be868cca89cae91

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7697b36abac930bf56bdb04d9b34e8355d68812e...ce8fda5759386de1e0eceae31be868cca89cae91
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list